Video encoding / decoding method and apparatus, and bitstream storage medium
By building a block vector candidate list and performing deblocking filtering, video encoding/decoding in intra-blocking mode is optimized, and the encoding efficiency limitation caused by the block partition structure of brightness components and chrominance components is solved, achieving a more efficient encoding process.
Patent Information
- Application Number
- CN202510498311.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2019-06-20
- Filing Date
- 2020-06-22
- Publication Date
- 2025-07-22
AI Technical Summary
In video encoding/decoding based on intra-block copying, the difference in block partition structures of the luminance component and the chrominance component leads to limited encoding efficiency, and it is difficult for the prior art to effectively improve encoding efficiency.
By building a block vector candidate list and performing deblocking filtering on the reconstructed block according to the intra-blocking copy mode, the determination process of block vector candidates is optimized, including determining the block vector candidate list and deblocking filtering steps to improve coding efficiency.
The encoding efficiency of video encoding/decoding based on intra-block replication is improved, and the encoding efficiency is improved by effectively constructing the block vector candidate list and deblocking filtering.
Smart Images

Figure CN120358342A_ABST
Abstract
Description
[0001] This application is a divisional application of the patent application for invention with the application date of June 22, 2020, application number 202080040541.0, and invention title "Video Encoding / Decoding Method and Apparatus and Bitstream Storage Medium". Technical Field
[0002] The present invention relates to a video encoding / decoding method and apparatus. More specifically, the present invention relates to a method and apparatus for encoding / decoding video images based on intra block copy. Background Art
[0003] Recently, in various applications, the demand for high-resolution and high-quality images such as high-definition (HD) or ultra-high-definition (UHD) images has increased. As the resolution and quality of images increase, the amount of data increases accordingly. This is one of the reasons 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 the 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 the 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 shorter codes to frequently occurring pixel values and longer codes to less frequently occurring pixel values.
[0005] In conventional image encoding / decoding methods and apparatuses, if the luminance component and the chrominance component have different block partition structures in the encoding / decoding process based on intra block copy, the encoding information of the luminance component is restrictively used for the encoding / decoding process of the chrominance component. Therefore, there are limitations in improving the encoding efficiency. Summary of the Invention
[0006] Technical Problem
[0007] In video encoding / decoding based on intra block copy, the encoding efficiency can be improved by effectively constructing a block vector candidate list and performing deblocking filtering on the reconstructed block according to the intra block copy mode.
[0008] Technical Solution
[0009] A video decoding method according to an exemplary embodiment of the present disclosure may include: obtaining an intra block copy mode enable flag indicating whether to enable the intra block copy mode for a current sequence; when the intra block copy mode enable flag indicates that the intra block copy mode is enabled for the current sequence, obtaining information about a maximum number of block vector candidates of a block vector candidate list; when a prediction mode of a current block is the intra block copy mode, determining, according to the information about the maximum number of block vector candidates, a block vector candidate list of the current block including one or more block vector candidates; determining a block vector of the current block based on one or more block vector candidates of the block vector candidate list of the current block; and determining a predicted block of the current block according to the block vector.
[0010] According to an embodiment, the intra block copy mode enable flag and the information about the maximum number of block vector candidates are obtained from a sequence parameter set referred to by the current sequence.
[0011] According to an embodiment, the information about the maximum number of block vector candidates indicates a difference between a predetermined positive integer and the maximum number of block vector candidates of the block vector candidate list.
[0012] According to an embodiment, the video decoding method may further include: reconstructing the current block based on the predicted block; and performing deblocking filtering on a block boundary of the reconstructed current block.
[0013] According to an embodiment, the step of performing deblocking filtering on the block boundary of the reconstructed current block includes: performing deblocking filtering on the block boundary when a prediction mode of the current block is the intra block copy mode and at least one neighboring block adjacent to the block boundary is in the intra block copy mode.
[0014] According to an embodiment, the intra block copy mode may be at least one of a block copy skip mode, a block copy merge mode, and a block copy AMVP mode.
[0015] According to an embodiment, the step of determining the block vector candidate list of the current block may include: when a number of block vector candidates included in the block vector candidate list is less than a maximum number of block vector candidates allowed in the block vector candidate list, adding at least one history-based block vector candidate of a history-based block vector candidate list to the block vector candidate list until the number of block vector candidates included in the block vector candidate list becomes equal to the maximum number of block vector candidates allowed in the block vector candidate list.
[0016] According to an embodiment, the step of adding the history-based block vector candidate to the block vector candidate list includes: adding the history-based block vector candidate to the block vector candidate list when the history-based block vector candidate does not duplicate with a block vector candidate included in the block vector candidate list.
[0017] According to an embodiment, the video decoding method may include: updating the history-based block vector candidate list based on the block vector of a current block.
[0018] According to an embodiment, the step of updating the history-based block vector candidate list may include: updating the history-based block vector candidate list when the size of the current block is greater than a predetermined size.
[0019] A video encoding method according to an exemplary embodiment of the present disclosure may include: when a prediction mode of a current block is an intra block copy mode, determining a block vector candidate list of the current block including one or more block vector candidates according to information on a maximum number of block vector candidates; determining a block vector of the current block based on the one or more block vector candidates of the block vector candidate list of the current block; determining a predicted block of the current block according to the block vector; entropy encoding an intra block copy mode enable flag indicating whether to enable the intra block copy mode for a current sequence; and when the intra block copy mode enable flag indicates that the intra block copy mode is enabled for the current sequence, entropy encoding information on the maximum number of block vector candidates of the block vector candidate list.
[0020] According to an embodiment, the intra block copy mode enable flag and the information on the maximum number of block vector candidates are included in a sequence parameter set referred to by the current sequence.
[0021] According to an embodiment, the information on the maximum number of block vector candidates indicates a difference between a predetermined positive integer and the maximum number of block vector candidates of the block vector candidate list.
[0022] According to an embodiment, the video encoding method may further include: reconstructing the current block based on the predicted block; and performing deblocking filtering on a block boundary of the reconstructed current block.
[0023] According to an embodiment, the step of performing deblocking filtering on the block boundary of the reconstructed current block includes: performing deblocking filtering on the block boundary when the prediction mode of the current block is the intra block copy mode and at least one neighboring block adjacent to the block boundary is in the intra block copy mode.
[0024] According to an embodiment, the intra block copy mode may be at least one of a block copy skip mode, a block copy merge mode, and a block copy AMVP mode.
[0025] According to an embodiment, the step of determining the block vector candidate list of the current block may include: when the number of block vector candidates included in the block vector candidate list is less than the maximum number of block vector candidates allowed in the block vector candidate list, adding at least one history-based block vector candidate from the history-based block vector candidate list to the block vector candidate list until the number of block vector candidates included in the block vector candidate list becomes equal to the maximum number of block vector candidates allowed in the block vector candidate list.
[0026] According to an embodiment, the step of adding the history-based block vector candidate to the block vector candidate list includes: adding the history-based block vector candidate to the block vector candidate list when the history-based block vector candidate does not duplicate with the block vector candidates included in the block vector candidate list.
[0027] According to an embodiment, the video encoding method may include: updating the history-based block vector candidate list based on the block vector of the current block.
[0028] According to an embodiment, the step of updating the history-based block vector candidate list may include: updating the history-based block vector candidate list when the size of the current block is greater than a predetermined size.
[0029] The present disclosure provides a computer-readable recording medium for storing a bitstream generated by encoding a video via a video encoding method. Here, the video encoding method includes: when the prediction mode of the current block is the intra block copy mode, determining a block vector candidate list of the current block including one or more block vector candidates according to information on the maximum number of block vector candidates; determining the block vector of the current block based on the one or more block vector candidates of the block vector candidate list of the current block; determining a predicted block of the current block according to the block vector; performing entropy coding on an intra block copy mode enable flag indicating whether to enable the intra block copy mode for the current sequence; and when the intra block copy mode enable flag indicates that the intra block copy mode is enabled for the current sequence, performing entropy coding on the information on the maximum number of block vector candidates of the block vector candidates of the block vector candidate list.
[0030] Advantageous Effects
[0031] The present invention can provide a method and apparatus for improving the encoding efficiency in intra block copy-based video encoding / decoding by effectively constructing a block vector candidate list and performing deblocking filtering on a reconstructed block according to the intra block copy mode. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 is a block diagram showing the configuration of an encoding device according to an embodiment of applying the present invention.
[0033] Figure 2 is a block diagram showing the configuration of a decoding device according to an embodiment of the present invention.
[0034] Figure 3 is a view schematically showing the partitioning structure of an image when the image is encoded and decoded.
[0035] Figure 4 is a view showing the intra prediction process.
[0036] Figure 5 is a diagram showing an embodiment of the inter prediction process.
[0037] Figure 6 is a diagram showing the transform and quantization process.
[0038] Figure 7 is a diagram showing reference sample points that can be used for intra prediction.
[0039] Figure 8 is a flowchart showing an image encoding method according to an embodiment of the present invention.
[0040] Figure 9 is a flowchart showing an image decoding method according to an embodiment of the present invention.
[0041] Figure 10 is a view showing the relationship between a current block and a prediction block according to an embodiment of the present invention.
[0042] Figure 11 is a view showing neighboring blocks adjacent to a current block according to an embodiment of the present invention.
[0043] Figure 12 is a view showing a current block partitioned when a predetermined threshold is 32 according to an embodiment of the present invention.
[0044] Figure 13 is a view showing the process of sharing and using a block vector candidate list constructed in a parent block according to an embodiment of the present invention.
[0045] Figure 14 is a view showing the relationship between a current block and a reference prediction block according to an embodiment of the present invention.
[0046] Figure 15 is a view showing a reference prediction block of a current block in the intra block copy mode according to an embodiment of the present invention.
[0047] Figure 16 is a view showing a reference region buffer in the intra block copy mode according to an embodiment of the present invention.
[0048] Figure 17 A view showing the range of values of block vectors according to an embodiment of the present invention.
[0049] Figure 18 A view showing the region encoded / decoded before the current block according to an embodiment of the present invention.
[0050] Figure 19 A view showing a reference area buffer in an intra block copy mode according to another embodiment of the present invention.
[0051] Figure 20 A view showing the correspondence between a chrominance component block and a luminance component region according to an embodiment of the present invention.
[0052] Figure 21 A view showing luminance sub - blocks according to an embodiment of the present invention.
[0053] Figure 22 A view showing the relationship between a current block and a prediction block according to an embodiment of the present invention.
[0054] Figure 23 A view showing the case when the prediction coding modes of luminance sub - blocks corresponding to a chrominance component block are the same according to an embodiment of the present invention.
[0055] Figure 24 A view showing the case when the prediction coding modes of luminance sub - blocks corresponding to a chrominance component block are different according to an embodiment of the present invention.
[0056] Figures 25a to 28 A view showing encoded information transmitted in association with an intra block partition according to an embodiment of the present invention.
[0057] Figures 29 to 32 Shows encoded information encoded / decoded in association with a block vector in an intra block mode according to an embodiment of the present invention.
[0058] Figure 33 Shows a video decoding method according to an embodiment of the present invention.
[0059] Figure 34 Shows a video encoding method according to an embodiment of the present invention. Detailed implementation
[0060] Various modifications can be made to the present invention, and there are various embodiments of the present invention. Examples thereof will now be provided and described in detail with reference to the accompanying drawings. However, the present invention is not limited thereto, but rather the exemplary embodiments can be construed to include all modifications, equivalents, or alternatives within the technical concept and technical 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 by way of example specific embodiments in which the present invention can be practiced. The 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 within other embodiments without departing from the spirit and scope of the present disclosure. Additionally, 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 considered limiting in nature, and the scope of the present disclosure is defined only by the appended claims (interpreted appropriately, together with the full scope of equivalents claimed by the claims).
[0061] The terms "first", "second", etc. used in the specification may be used to describe various components, but these components should not be construed as limited to these terms. These terms are only used to distinguish one component from other components. For example, without departing from the scope of the present invention, a "first" component may be referred to as a "second" component, and a "second" component may similarly be referred to as a "first" component. The term "and / or" includes combinations of multiple items or any one of multiple terms.
[0062] It should be understood that when an element is simply referred to as "connected to" or "coupled to" another element in this specification rather than "directly connected to" or "directly coupled to" another element, it can be "directly connected to" or "directly coupled to" another element, or connected to or coupled to another element with another element intervening therebetween. Conversely, it should be understood that when an element is referred to as "directly coupled" or "directly connected" to another element, there is no intervening element.
[0063] In addition, the constituent 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 constituent component is constituted by separate hardware or software constituent units. In other words, for convenience, each constituent component includes each of the listed constituent components. Therefore, at least two constituent components of each constituent component can be combined to form one constituent component, or one constituent component can be divided into multiple constituent components to perform each function. Embodiments of combining each constituent component and embodiments of dividing one constituent component are also included within the scope of the present invention without departing from the essence of the present invention.
[0064] 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 cover plural expressions unless they have a clearly different meaning in the context. In this specification, it should be understood that terms such as "including", "having", etc. are intended to indicate the existence of features, quantities, 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, quantities, 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.
[0065] In addition, some constituent components may not be essential constituent components for performing the basic functions of the present invention, but are only optional constituent components for improving its performance. In addition to the constituent components for improving performance, the present invention can be implemented by including only the essential constituent components for realizing the essence of the present invention. Structures including only the essential constituent components except for the optional constituent components for only improving performance are also included within the scope of the present invention.
[0066] 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 structures will not be described in detail because they may unnecessarily obscure the understanding of the present invention. The same constituent elements in the drawings are denoted by the same reference numerals, and repeated descriptions of the same elements will be omitted.
[0067] Hereinafter, an image may represent a frame constituting a video, or may represent the video itself. For example, "encoding or decoding or both encoding and decoding of an image" may represent "encoding or decoding or both encoding and decoding of a moving picture", and may represent "encoding or decoding or both encoding and decoding of one image in the images of a moving picture".
[0068] Hereinafter, the terms "moving picture" and "video" may be used with the same meaning and may be replaced with each other.
[0069] 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.
[0070] Hereinafter, the terms "image", "picture", "frame", and "screen" may be used with the same meaning and may be replaced with each other.
[0071] 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 the 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.
[0072] Hereinafter, the terms "block" and "unit" may be used with the same meaning and may be replaced with each other. Alternatively, "block" may represent a specific unit.
[0073] Hereinafter, the terms "region" and "segment" may be replaced with each other.
[0074] 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.
[0075] In an embodiment, each of specific information, data, flag, index, element, and attribute, etc. may have a value. The value of 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. The value of 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.
[0076] When the 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 may be an integer equal to or greater than 1. That is, columns, rows, indexes, etc. may be counted from 0 or may be counted from 1.
[0077] Term Explanation
[0078] Encoder: Represents a device that performs encoding. That is, it refers to an encoding device.
[0079] Decoder: Represents a device that performs decoding. That is, it refers to a decoding device.
[0080] Block: A block is an M×N sample array. Here, M and N can represent positive integers, and the block can represent a sample array in two-dimensional form. A block can refer to a unit. The current block can represent an encoding target block that becomes a target during encoding, or can represent a decoding target block that becomes a target during decoding. Additionally, the current block can be at least one of an encoding block, a prediction block, a residual block, and a transform block.
[0081] Sample: A sample is a basic unit that constitutes a block. It can be represented as a value from 0 to 2 Bd -1 according to the bit depth (Bd). 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.
[0082] Unit: A unit can refer to an encoding and decoding unit. When encoding and decoding an image, the unit can be a region generated by partitioning a single image. Additionally, when a single image is partitioned into sub-partition units during encoding or decoding, the unit can represent the sub-partition unit. That is, an image can be partitioned into multiple units. When encoding and decoding an image, a predetermined process can be performed on each unit. A single unit can be divided into sub-units having a size smaller than the size of the unit. According to the function, the 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. Additionally, in order to distinguish the unit from the block, the 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. The unit can have various sizes and forms, and specifically, the form of the unit can be a two-dimensional geometric figure such as a square shape, a rectangular shape, a trapezoidal shape, a triangular shape, a pentagonal shape, etc. Additionally, the 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, a sequence of encoding and decoding of the unit, etc.
[0083] 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. Additionally, the coding tree unit can represent including 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. The 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.
[0084] When the size of a coding block is within a predetermined range, quadtree partitioning can be used for partitioning only. Here, the predetermined range can be defined as at least one of the maximum size and the minimum size of coding blocks that can be partitioned using quadtree partitioning only. Information indicating the maximum size / minimum size of coding blocks allowing quadtree partitioning can be signaled via 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 size / 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, quadtree partitioning can be used for partitioning only. Optionally, when the size of a coding block is larger than the size of the maximum transform block, quadtree partitioning can be used for partitioning only. Here, the block to be partitioned can be at least one of a coding block and a transform block. In this case, the 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 the predetermined range, binary tree or ternary tree partitioning can be used for partitioning only. In this case, the above description of quadtree partitioning can be applied to binary tree partitioning or ternary tree partitioning in the same way.
[0085] 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.
[0086] Neighboring block: A block that can represent a block adjacent to a 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.
[0087] Reconstructed neighboring block: A block that can represent a neighboring block adjacent to the current block and that has been encoded or decoded spatially / temporally. In this document, 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 by encoding or decoding or both encoding and decoding. A reconstructed temporal neighboring block is a block at the position corresponding to the current block of the current picture in a reference image or a neighboring block of the block.
[0088] 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. Additionally, the highest node can have the minimum depth value. In this case, the highest node can have a depth of 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. Additionally, when a unit is represented as a tree structure, the level where the unit is located can represent the unit depth.
[0089] Bitstream: It can represent a bitstream including encoded image information.
[0090] Parameter set: It corresponds to the header information in the configuration within the 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. Additionally, the parameter set can include slice header, parallel block group header, and parallel block header information. The term "parallel block group" represents a group of parallel blocks and has the same meaning as a slice.
[0091] An adaptive parameter set can represent a parameter set that can be shared by referring to different pictures, sub-pictures, slices, parallel block groups, parallel blocks, or blocks. Additionally, the information in the adaptive parameter set can be used by referring to different adaptive parameter sets for sub-pictures, slices, parallel block groups, parallel blocks, or blocks within a picture.
[0092] Additionally, 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, parallel block groups, parallel blocks, or blocks within a picture.
[0093] Additionally, regarding the adaptive parameter set, different adaptive parameter sets can be referenced by using the identifiers of different adaptive parameter sets for slices, parallel block groups, parallel blocks, or blocks within a sub-picture.
[0094] Additionally, regarding the adaptive parameter set, different adaptive parameter sets can be referenced by using the identifiers of different adaptive parameter sets for parallel blocks or blocks within a slice.
[0095] Additionally, regarding the adaptive parameter set, different adaptive parameter sets can be referenced by using the identifiers of different adaptive parameter sets for blocks within a parallel block.
[0096] Information about an adaptive parameter set identifier may be included in a parameter set or a header of a sub - picture, and the adaptive parameter set corresponding to the adaptive parameter set identifier may be used for the sub - picture.
[0097] Information about an adaptive parameter set identifier may be included in a parameter set or a header of a parallel block, and the adaptive parameter set corresponding to the adaptive parameter set identifier may be used for the parallel block.
[0098] Information about an adaptive parameter set identifier may be included in a header of a partitioned block, and the adaptive parameter set corresponding to the adaptive parameter set identifier may be used for the partitioned block.
[0099] A picture may be partitioned into one or more parallel block rows and one or more parallel block columns.
[0100] A sub - picture may be partitioned into one or more parallel block rows and one or more parallel block columns within the picture. The sub - picture may be a rectangular / square - shaped region within the picture and may include one or more CTUs. Additionally, at least one or more parallel blocks / partitioned blocks / strips may be included within one sub - picture.
[0101] A parallel block may be a rectangular / square - shaped region within the picture and may include one or more CTUs. Additionally, a parallel block may be partitioned into one or more partitioned blocks.
[0102] 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.
[0103] A strip may include one or more parallel blocks within the picture and may include one or more partitioned blocks within the parallel block.
[0104] Parsing: It may represent determining the value of a syntax element by performing entropy decoding or may represent entropy decoding itself.
[0105] Symbol: It may represent at least one of a syntax element, an encoding parameter, and a transform coefficient value of an encoding / decoding target unit. Additionally, a symbol may represent an entropy encoding target or an entropy decoding result.
[0106] Prediction mode: It may be information indicating a mode encoded / decoded using intra - frame prediction or a mode encoded / decoded using inter - frame prediction.
[0107] Prediction Unit: It can represent the basic unit when performing prediction (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 lower-level prediction units. Multiple partitions can be the basic units for performing prediction or compensation. The partitions generated by dividing the prediction unit can also be prediction units.
[0108] Prediction Unit Partition: It can represent the form obtained by partitioning the prediction unit.
[0109] The reference picture list can refer to a list including one or more reference pictures for inter-frame prediction or motion compensation. There are multiple types of available reference picture lists, including LC (Combined List), L0 (List 0), L1 (List 1), L2 (List 2), L3 (List 3).
[0110] The inter-frame prediction indicator can refer to the direction of inter-frame prediction (unidirectional prediction, bidirectional prediction, etc.) of the current block. 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.
[0111] 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 the first value zero (0), it means 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 the second value one (1), it means that the reference picture list is used to generate the prediction block.
[0112] The reference picture index can refer to the index indicating a specific reference picture in the reference picture list.
[0113] The reference picture can be represented as 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 interchanged.
[0114] 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 coded / 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.
[0115] The search range can be a two-dimensional region that is searched during inter 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.
[0116] When predicting a motion vector, a motion vector candidate can refer to a predicted candidate block or the motion vector of a predicted candidate block. Additionally, the motion vector candidate can be included in a motion vector candidate list.
[0117] The motion vector candidate list can represent a list composed of one or more motion vector candidates.
[0118] The motion vector candidate index can represent an indicator that indicates a motion vector candidate in the motion vector candidate list. Optionally, the motion vector candidate index can be an index of a motion vector predictor.
[0119] Motion information can represent information that includes at least one of a plurality of items, the plurality of items including a motion vector, a reference picture index, an inter prediction indicator, a prediction list utilization flag, reference picture list information, a reference picture, a motion vector candidate, a motion vector candidate index, a merge candidate, and a merge index.
[0120] The merge candidate list can represent a list composed of one or more merge candidates.
[0121] 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 a reference picture index, a motion vector, a prediction list utilization flag, and an inter prediction indicator for each list.
[0122] The merge index can represent an indicator that indicates a merge candidate in the merge candidate list. Optionally, the merge index can indicate a block in a reconstructed block that is adjacent to the current block spatially / temporally from which the merge candidate is derived. Optionally, the merge index can indicate at least one motion information of the merge candidate.
[0123] Transform unit: can represent a basic unit when performing encoding / decoding of a residual signal (such as transform, inverse transform, quantization, dequantization, transform coefficient encoding / decoding). A single transform unit can be partitioned into multiple lower-level 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.
[0124] 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.
[0125] Quantization parameter: A value that can be used to generate quantization levels using transform coefficients during quantization. The quantization parameter can also represent a value used to generate transform coefficients by scaling quantization levels during dequantization. The quantization parameter can be a value mapped to a quantization step size.
[0126] 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.
[0127] Scanning: A method that can represent the ordering of 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.
[0128] Transform coefficient: A coefficient value generated after performing a transform in an encoder. It can represent a coefficient value generated after performing at least one of entropy decoding and dequantization in a decoder. The quantization level or quantization transform coefficient level obtained by quantizing a transform coefficient or a residual signal can also fall within the meaning of a transform coefficient.
[0129] Quantization level: A value generated by quantizing a transform coefficient or a residual signal in an encoder. Optionally, the quantization level can represent a value that is the target of dequantization in a decoder. Similarly, the quantization transform coefficient level as a result of transform and quantization can also fall within the meaning of a quantization level.
[0130] Non-zero transform coefficient: Can represent a transform coefficient with a non-zero value, or a transform coefficient level or quantization level with a non-zero value.
[0131] Quantization matrix: A matrix that can be used in a quantization process or a dequantization process performed to improve subjective or objective image quality. The quantization matrix can also be referred to as a scaling list.
[0132] Quantization matrix coefficient: Each element within a quantization matrix. The quantization matrix coefficient can also be referred to as a matrix coefficient.
[0133] Default matrix: A predefined quantization matrix in an encoder or decoder.
[0134] Non-default matrix: A quantization matrix that is not predefined in an encoder or decoder but signaled by a user.
[0135] Statistical value: The statistical value for at least one of a variable, coding parameter, constant value, etc. with a computable specific value can be one or more of the average value, sum value, weighted average value, weighted sum value, minimum value, maximum value, most frequently occurring value, median value, interpolation of the corresponding specific value.
[0136] Figure 1 It is a block diagram showing the configuration of an encoding device according to an embodiment of the present invention.
[0137] 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 perform sequential encoding on at least one image.
[0138] 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.
[0139] The encoding device 100 may perform encoding on an input image by using an intra mode or an inter mode or both the intra mode and the inter mode. Additionally, 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 the prediction mode, the switch 115 may be switched to intra. Optionally, when the inter mode is used as the prediction mode, the switch 115 may be switched 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. Additionally, 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 the current encoding target. The input block may be referred to as a current block that is the current encoding target or as an encoding target block.
[0140] When the prediction mode is the intra mode, the intra prediction unit 120 may use the samples of the encoded / decoded blocks adjacent to the current block as reference samples. The intra prediction unit 120 may perform spatial prediction on the current block by using the reference samples or generate prediction samples of the input block by performing spatial prediction. Here, the intra prediction may represent a prediction within a frame.
[0141] When the prediction mode is the inter mode, the motion prediction unit 111 may retrieve, when performing motion prediction, a region in a reference image that best matches the input block and infer 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 the encoding / decoding of the reference image has been performed, the reference image may be stored in the reference picture buffer 190.
[0142] The motion compensation unit 112 can generate a prediction block by performing motion compensation on a current block using a motion vector. Herein, inter-frame prediction can represent inter-frame prediction or motion compensation.
[0143] When the value of the motion vector is not an integer, the motion prediction unit 111 and the motion compensation unit 112 can generate a prediction block by applying an interpolation filter to a partial region of a reference picture. To perform inter-picture prediction or motion compensation on an encoding unit, it can be determined which 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 can be performed differently according to the determined mode.
[0144] The subtractor 125 can generate a residual block by using the difference between an input block and a prediction block. The residual block can be referred to as a residual signal. The residual signal can represent the difference between an original signal and a prediction signal. Additionally, the residual signal can be a signal generated by transforming or quantifying the difference between the original signal and the prediction signal or by transforming and quantifying the difference between the original signal and the prediction signal. The residual block can be a residual signal of a block unit.
[0145] The transform unit 130 can generate transform coefficients by performing a transform on the residual block and output the generated transform coefficients. Here, the transform coefficients can be coefficient values generated by performing a transform on the residual block. When the transform skip mode is applied, the transform unit 130 can skip the transform of the residual block.
[0146] Quantization levels can be generated by applying quantization to the transform coefficients or the residual signal. Hereinafter, in an embodiment, the quantization levels can also be referred to as transform coefficients.
[0147] The quantization unit 140 can generate quantization levels by quantifying the transform coefficients or the residual signal according to parameters and output the generated quantization levels. Here, the quantization unit 140 can quantify the transform coefficients by using a quantization matrix.
[0148] The entropy encoding unit 150 can generate a bitstream by performing entropy encoding according to a probability distribution on the value calculated by the quantization unit 140 or on the encoding parameter values calculated during encoding and output the generated bitstream. The entropy encoding unit 150 can perform entropy encoding on sample information of an image and information for decoding the image. For example, the information for decoding the image can include syntax elements.
[0149] 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. Thus, the size of the bitstream for the symbols to be encoded can be reduced. The entropy coding unit 150 may use an encoding method for entropy coding, such as exponential Golomb, context-adaptive variable length coding (CAVLC), context-adaptive binary arithmetic coding (CABAC), etc. For example, the entropy coding unit 150 may perform entropy coding by using a variable length coding / code (VLC) table. Additionally, the entropy coding unit 150 may derive a binarization method for a target symbol and a probability model for the target symbol / bits, and perform arithmetic coding by using the derived binarization method, probability model, and context model.
[0150] To encode the transform coefficient levels (quantization levels), the entropy coding unit 150 may change the two-dimensional block form coefficients into a one-dimensional vector form by using a transform coefficient scanning method.
[0151] Coding parameters may contain information (flags, indices, etc.), such as syntax elements encoded in an encoder and signaled to a decoder, and information derived during encoding or decoding. The coding parameters may represent information required for encoding or decoding an image. For example, at least one value of the following items or a combination of the following items may be included in the bitstream: unit / block size, unit / block depth, unit / block partition information, unit / block shape, unit / block partition structure, whether to perform quadtree partitioning, whether to perform binary tree partitioning, binary tree partitioning direction (horizontal or vertical), binary tree partitioning form (symmetric or asymmetric), whether the current coding unit is partitioned by ternary tree partitioning, ternary tree partitioning direction (horizontal or vertical), prediction mode (intra prediction or inter prediction), luminance intra prediction mode / direction, chrominance intra prediction mode / direction, intra partition information, inter partition information, coding block partition flag, prediction block partition flag, transform block partition flag, reference sample filtering method, reference sample filter 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 merge mode, merge index, merge candidate, merge candidate list, whether to use skip mode, interpolation filter type, interpolation filter taps, interpolation filter coefficients, motion vector magnitude, representation precision of motion vector, transform type, transform size, information on whether to use primary (first) transform, information on whether to use secondary transform, primary transform index, secondary transform index, information on whether there is a residual signal, coding block mode, coding block flag (CBF), quantization parameter, quantization parameter of residual, quantization matrix, whether to apply loop filter, loop filter coefficients, loop filter taps, 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 normal mode, whether to execute bypass mode, context bits, bypass bits, valid coefficient flag, last valid coefficient flag, coding flag for the unit of coefficient group, position of the last valid coefficient, flag indicating whether the value of the coefficient is greater than 1,Flags indicating whether the value of a coefficient is greater than 2, flags indicating whether the value of a coefficient is greater than 3, information about the values of remaining coefficients, sign information, reconstructed luminance samples, reconstructed chrominance samples, residual luminance samples, residual chrominance samples, luminance transform coefficients, chrominance transform coefficients, quantization luminance levels, quantization chrominance levels, transform coefficient level scanning methods, the size of the motion vector search area on the decoder side, the shape of the motion vector search area on the decoder side, the 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, the bit depth of input samples, the bit depth of reconstructed samples, the bit depth of residual samples, the bit depth of transform coefficients, the bit depth of quantization levels, and information about the luminance signal or information about the chrominance signal.
[0152] Here, it can be indicated by a signaling flag or index that the corresponding flag or index is entropy-coded by the encoder and included in the bitstream, and it can be indicated that the corresponding flag or index is entropy-decoded from the bitstream by the decoder.
[0153] When the encoding device 100 performs encoding by inter prediction, the encoded current image can be used as a reference image for another image to be processed later. Therefore, the encoding device 100 can reconstruct or decode the encoded current image, or store the reconstructed or decoded image in the reference picture buffer 190 as a reference image.
[0154] The quantization levels can be dequantized in the dequantization unit 160, or can be inverse-transformed in the inverse transform unit 170. The dequantized or inverse-transformed coefficients or the coefficients that have been both dequantized and inverse-transformed can be added to the prediction block by the adder 175. By adding the dequantized or inverse-transformed coefficients or the coefficients that have been both dequantized and inverse-transformed to the prediction block, a reconstructed block can be generated. Here, the dequantized or inverse-transformed coefficients or the coefficients that have been both dequantized and inverse-transformed can represent the coefficients for which at least one of dequantization and inverse transformation has been performed, and can represent the reconstructed residual block.
[0155] 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 an adaptive loop filter (ALF) to the reconstructed samples, reconstructed block, or reconstructed image. The filter unit 180 can be referred to as a loop filter.
[0156] 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 current block. When the deblocking filter is applied to a block, different filters can be applied according to the required deblocking filter strength.
[0157] 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 partitioning the samples of an image into a predetermined number of regions, determining the regions to which the offset is to be applied, and applying the offset to the determined regions can be used, or a method of applying the offset in consideration of edge information about each sample can be used.
[0158] 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 by the coding unit (CU), and the form and coefficients of the ALF to be applied to each block can vary.
[0159] 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 a part of the reference image. That is, the reference image is a reconstructed image composed of the reconstructed blocks processed by the filter unit 180. The stored reference image can be used later for inter-frame prediction or motion compensation.
[0160] Figure 2 is a block diagram showing the configuration of a decoding device to which the present invention is applied according to an embodiment.
[0161] The decoding device 200 can be a decoder, a video decoding device, or an image decoding device.
[0162] Referring to Figure 2 , the decoding device 200 may include an entropy decoding unit 210, an inverse quantization unit 220, an inverse transform unit 230, an intra prediction unit 240, a motion compensation unit 250, an adder 225, a filter unit 260, and a reference picture buffer 270.
[0163] The decoding device 200 can receive the bitstream output from the encoding device 100. The decoding device 200 can receive the bitstream stored in a computer-readable recording medium, or can receive the bitstream streamed through a wired / wireless transmission medium. The decoding device 200 can decode the bitstream by using an intra mode or an inter mode. Additionally, the decoding device 200 can generate a reconstructed image or a decoded image generated by decoding, and output the reconstructed image or the decoded image.
[0164] When the prediction mode used during decoding is the intra mode, the switcher can be switched to intra. Optionally, when the prediction mode used during decoding is the inter mode, the switcher can be switched to the inter mode.
[0165] The decoding device 200 can 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 can generate a reconstructed block to be decoded by adding the reconstructed residual block and the prediction block. The block to be decoded can be referred to as the current block.
[0166] The entropy decoding unit 210 can generate symbols by performing entropy decoding on the bitstream according to a probability distribution. The generated symbols can include symbols in the form of quantization levels. Here, the entropy decoding method can be the inverse process of the above entropy encoding method.
[0167] In order to decode the transform coefficient levels (quantization levels), the entropy decoding unit 210 can change the one-dimensional vector form coefficients into a two-dimensional block form by using a transform coefficient scanning method.
[0168] The quantization levels can be dequantized in the dequantization unit 220, or can be inverse-transformed in the inverse transform unit 230. The quantization levels can be the result of dequantization or inverse transformation or both the result of dequantization and inverse transformation, and can be generated as a reconstructed residual block. Here, the dequantization unit 220 can apply a quantization matrix to the quantization levels.
[0169] When using the intra mode, the intra prediction unit 240 can generate a prediction block by performing spatial prediction on the current block, and the spatial prediction uses the sample values of the blocks adjacent to the block to be decoded and that have already been decoded.
[0170] When using the inter mode, the motion compensation unit 250 can 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.
[0171] The adder 225 can generate a reconstructed block by adding the reconstructed residual block and the prediction block. The filter unit 260 can 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 can output the reconstructed image. The reconstructed block or the reconstructed image can be stored in the reference picture buffer 270 and used during inter prediction. The reconstructed block processed by the filter unit 260 can 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 can be used later for inter prediction or motion compensation.
[0172] Figure 3 is a view schematically showing a partition structure of an image when the image is encoded and decoded. Figure 3 Schematically shows an example of dividing a single unit into a plurality of lower-level units.
[0173] To effectively partition an image, a coding unit (CU) can be used during encoding and decoding. When encoding / decoding an image, the coding unit can serve as a basic unit. Additionally, when encoding / decoding an image, the coding unit can be used as a unit for distinguishing between intra prediction modes and inter prediction modes. The coding unit can be a basic unit for prediction, transformation, quantization, inverse transformation, dequantization, or encoding / decoding processing of transform coefficients.
[0174] Referring to Figure 3 , the image 300 is partitioned in the order of the largest coding unit (LCU), and the LCU unit is determined as the partition structure. Herein, the LCU can be used with the same meaning as the coding tree unit (CTU). Unit partitioning can represent partitioning of a block associated with the unit. Information on the unit depth can be included in the block partitioning information. The depth information can 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 can 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 can correspond to a node and the children of the node, respectively. Each of the partitioned lower-level units can have depth information. The depth information can be information representing the size of the CU and can be stored in each CU. The unit depth represents the number of times and / or the degree associated with partitioning the unit. Therefore, the partitioning information of the lower-level units can include information on the size of the lower-level units.
[0175] The partition structure may represent the distribution of coding units (CUs) within the LCU 310. Such a distribution may be determined based on whether a single CU is partitioned into multiple (positive integers equal to or greater than 2, including 2, 4, 8, 16, etc.) CUs. The horizontal size and vertical size of the CUs generated by the partition may be half of the horizontal size and vertical size of the CU before the partition, respectively, or may have sizes less than the horizontal size and vertical size before the partition according to the number of partitions. The CU may be recursively partitioned into multiple CUs. Through recursive partitioning, at least one of the height and width of the CU after the partition may be reduced compared to at least one of the height and width of the CU before the partition. The partitioning of the CU may be recursively performed until a predefined depth or a predefined size is reached. For example, the depth of the LCU may be 0, and the depth of the smallest coding unit (SCU) may be the predefined maximum depth. Here, as described above, the LCU may be a coding unit with the maximum coding unit size, and the SCU may be a coding unit with the smallest coding unit size. Starting from the LCU 310 for partitioning, as the horizontal size or vertical size or both the horizontal size and vertical size of the CU are reduced by the partition, the CU depth increases by 1. For example, for each depth, the non-partitioned CU may have a size of 2N×2N. In addition, in the case where the CU is partitioned, the CU with a size of 2N×2N may be partitioned into four CUs with a size of N×N. As the depth increases by 1, the size of N may be reduced to half.
[0176] In addition, information indicating whether the CU is partitioned may be represented by using the partition information of the CU. The partition information may be 1-bit information. All CUs except the SCU may include the partition information. For example, when the value of the partition information is the first value, the CU may not be partitioned, and when the value of the partition information is the second value, the CU may be partitioned.
[0177] Referring to Figure 3 , the LCU with a depth of 0 may be a 64×64 block. 0 may be the minimum depth. The SCU with a depth of 3 may be an 8×8 block. 3 may be the maximum depth. The CUs of 32×32 blocks and 16×16 blocks may be represented as depth 1 and depth 2, respectively.
[0178] For example, when a single coding unit is partitioned into four coding units, the horizontal size and vertical size of the four partitioned coding units may be half the size of the horizontal size and vertical size of the CU before the partition. In one embodiment, when a coding unit with a size of 32×32 is partitioned into four coding units, each of the four partitioned coding units may have a size of 16×16. When a single coding unit is partitioned into four coding units, it may be said that the coding unit may be partitioned into a quadtree form.
[0179] For example, when a coding unit is partitioned into two sub-coding units, the horizontal or vertical dimension (width or height) of each of the two sub-coding units can be half of the horizontal or vertical dimension 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 divided into two sub-coding units, the coding unit can be said to be binary partitioned or partitioned by a binary tree partitioning structure.
[0180] For example, when a coding unit is partitioned into three sub-coding units, the horizontal or vertical dimension of the coding unit can be partitioned at a ratio of 1:2:1, resulting in three sub-coding units with a horizontal or vertical dimension 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 topmost sub-coding unit to the bottommost sub-coding unit. For example, when a coding unit with a size of 32×32 is vertically partitioned 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, the coding unit can be said to be ternary partitioned or partitioned by a ternary tree partitioning structure.
[0181] 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.
[0182] 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 that can no longer be partitioned using the quadtree partitioning structure can correspond to a leaf node of the quadtree. A coding unit corresponding to a leaf node of the quadtree can serve as the root node of a binary tree and / or ternary tree partitioning structure. That is, a coding unit corresponding to a leaf node of the quadtree can be further partitioned by a binary tree partitioning structure or a ternary tree partitioning structure, or may not be further partitioned. Therefore, by preventing coding units generated by binary tree partitioning or ternary tree partitioning of coding units corresponding to leaf nodes of the quadtree from being further quad-tree partitioned, block partitioning and / or signaling of partitioning information can be effectively performed.
[0183] The quad-partition information can be used to signal the fact that a coding unit corresponding to a node of a quadtree is partitioned. The quad-partition information having a first value (e.g., "1") can indicate that the current coding unit is partitioned according to the quadtree partitioning structure. The quad-partition information having a second value (e.g., "0") can indicate that the current coding unit is not partitioned according to the quadtree partitioning structure. The quad-partition information can be a flag having a predetermined length (e.g., one bit).
[0184] 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 be further partitioned by either binary-tree partitioning or ternary-tree partitioning. Additionally, a coding unit generated by binary-tree partitioning or ternary-tree partitioning can be further partitioned by binary-tree partitioning or further ternary-tree partitioning, or may not be further partitioned.
[0185] 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 serve as the root node of a multi-type tree. At least one of multi-type tree partitioning indication information, partitioning direction information, and partitioning tree information can be used to signal whether a coding unit corresponding to a node of a multi-type tree is partitioned. To partition a coding unit corresponding to a node of a multi-type tree, the multi-type tree partitioning indication information, partitioning direction information, and partitioning tree information can be signaled in sequence.
[0186] The multi-type tree partitioning indication information having a first value (e.g., "1") can indicate that the current coding unit will be subjected to multi-type tree partitioning. The multi-type tree partitioning indication information having a second value (e.g., "0") can indicate that the current coding unit will not be subjected to multi-type tree partitioning.
[0187] When a coding unit corresponding to a node of a multi-type tree is further partitioned by a multi-type tree partitioning structure, the coding unit can include partitioning direction information. The partitioning direction information can indicate in which direction the current coding unit will be partitioned for multi-type tree partitioning. The partitioning direction information having a first value (e.g., "1") can indicate that the current coding unit will be vertically partitioned. The partitioning direction information having a second value (e.g., "0") can indicate that the current coding unit will be horizontally partitioned.
[0188] When a coding unit corresponding to a node of a multi-type tree is further partitioned by a multi-type tree partitioning structure, the current coding unit can include partitioning tree information. The partitioning tree information can indicate the tree partitioning structure that will be used to partition the node of the multi-type tree. The partitioning tree information having a first value (e.g., "1") can indicate that the current partitioning unit will be partitioned by a binary-tree partitioning structure. The partitioning tree information having a second value (e.g., "0") can indicate that the current coding unit will be partitioned by a ternary-tree partitioning structure.
[0189] The partition indication information, the partition tree information, and the partition direction information may each be a flag having a predetermined length (e.g., one bit).
[0190] At least any one of the quadtree partition indication information, the multi-type tree partition indication information, the partition direction information, and the partition tree information may be entropy-coded / decoded. For the entropy coding / decoding of these types of information, information about neighboring coding units adjacent to the current coding unit may be used. For example, the probability that the partition type (partitioned or unpartitioned, partition tree, and / or partition direction) of the left neighboring coding unit and / or the upper neighboring coding unit of the current coding unit is similar to the partition type of the current coding unit is very high. Therefore, context information for entropy-coding / decoding information about the current coding unit can be derived from information about neighboring coding units. Information about neighboring coding units may include at least any one of the quad-partition information, the multi-type tree partition indication information, the partition direction information, and the partition tree information.
[0191] 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 be subjected to binary tree partitioning, and then the coding unit corresponding to the leaf node of the binary tree may be set as the root node for ternary tree partitioning. In this case, quadtree partitioning and binary tree partitioning may not be performed on the coding unit corresponding to the node of the ternary tree.
[0192] A coding unit that cannot be partitioned by a quadtree partition structure, a binary tree partition structure, and / or a ternary tree partition 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, the partition structure information and the partition information for partitioning the coding unit into a prediction unit and / or a transformation unit may not be present in the bitstream.
[0193] 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 or vertical size of the coding unit with the horizontal 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.
[0194] 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.
[0195] 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 intra-picture slice and the inter-picture slice.
[0196] 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.
[0197] 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.
[0198] According to the size and depth information of the above various blocks, the four-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.
[0199] 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 four-partition information. The four-partition information can be derived as a second value.
[0200] For example, when the size (horizontal size and vertical size) of the coding unit corresponding to the node of the multi-type tree is greater than the maximum size (horizontal size and vertical size) of the binary tree and / or the maximum size (horizontal size and vertical size) of the ternary tree, the coding unit may not be bipartitioned or tripartitioned. Therefore, the multi-type tree partition indication information may not be signaled, and the multi-type tree partition indication information can be derived from the second value.
[0201] Optionally, when the size (horizontal and vertical sizes) of a coding unit corresponding to a node of a multi-type tree is the same as the maximum size (horizontal size and vertical size) of a binary tree and / or twice as large as the maximum size (horizontal size and vertical size) of a ternary tree, the coding unit may not be further bipartitioned or tripartitioned. Thus, instead of signaling the multi-type tree partitioning indication information, the multi-type tree partitioning indication information may be derived from a second value. This is because when a coding unit is partitioned by a binary tree partitioning structure and / or a ternary tree partitioning structure, coding units smaller than the minimum size of the binary tree and / or the minimum size of the ternary tree are generated.
[0202] Optionally, the binary tree partitioning or ternary tree partitioning may be restricted based on the size of a virtual pipeline data unit (hereinafter, 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 partitioning or ternary tree partitioning, the corresponding binary tree partitioning or ternary tree partitioning may be restricted. The pipeline buffer size may be the partitioning of a maximum transform block (e.g., 64×64). For example, when the pipeline buffer size is 64×64, the following divisions may be restricted.
[0203] - Ternary tree partitioning for an N×M (N and / or M is 128) coding unit
[0204] - Binary tree partitioning for a 128×N (N <= 64) coding unit in the horizontal direction
[0205] - Binary tree partitioning for an N×128 (N <= 64) coding unit in the vertical direction
[0206] Optionally, when the depth of a coding unit corresponding to a node of a 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. Thus, instead of signaling the multi-type tree partitioning indication information, the multi-type tree partitioning indication information may be derived from a second value.
[0207] Optionally, the multi-type tree partitioning indication information may be signaled only when at least one of the vertical binary tree partitioning, horizontal binary tree partitioning, vertical ternary tree partitioning, and horizontal ternary tree partitioning is possible for a coding unit corresponding to a node of a multi-type tree. Otherwise, the coding unit may not be bipartitioned and / or tripartitioned. Thus, instead of signaling the multi-type tree partitioning indication information, the multi-type tree partitioning indication information may be derived from a second value.
[0208] Optionally, the partitioning direction information may be signaled only when both a vertical binary tree partitioning and a horizontal binary tree partitioning or both a vertical ternary tree partitioning and a horizontal ternary tree partitioning are possible for a coding unit corresponding to a node of a multi-type tree. Otherwise, instead of signaling the partitioning direction information, the partitioning direction information may be derived from values indicating possible partitioning directions.
[0209] Optionally, the partitioning tree information may be signaled only when both a vertical binary tree partitioning and a vertical ternary tree partitioning or both a horizontal binary tree partitioning and a horizontal ternary tree partitioning are possible for a coding tree corresponding to a node of a multi-type tree. Otherwise, instead of signaling the partitioning tree information, the partitioning tree information may be derived from values indicating possible partitioning tree structures.
[0210] Figure 4 is a diagram showing an intra prediction process.
[0211] Figure 4 The arrows from the center to the outside in may represent the prediction direction of the intra prediction mode.
[0212] 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 of reference samples included in the reconstructed neighboring blocks or coding parameters.
[0213] 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.
[0214] Intra prediction may be performed according to the intra prediction mode of 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 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.
[0215] Regardless of the block size, the number of intra prediction modes may be fixed at N. Optionally, 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 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.
[0216] The intra prediction mode may be a non - angular mode or an angular mode. The non - angular mode may be a DC mode or a planar mode, and the angular mode may be a prediction mode with a specific direction or angle. The intra prediction mode may be represented by at least one of a mode number, a mode value, a mode digit, a mode angle, and a mode direction. The number of intra prediction modes may be M 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 the samples included in the reconstructed neighboring blocks can be used as reference samples for the current block may be executed. When there are samples that cannot be used as reference samples for the current block, the unavailable sample values of the samples may be replaced with values obtained by copying or performing interpolation or both copying and performing difference on at least one of the sample values included in the reconstructed neighboring blocks, so that the replaced sample values are used as reference samples for the current block.
[0217] Figure 7 is a diagram showing reference samples that can be used for intra prediction.
[0218] As Figure 7 shown, at least one of reference sample lines 0 to 3 may be used for intra prediction of the current block. In Figure 7 , the samples of segment A and segment F may be filled with the samples closest to segment B and segment E respectively, instead of being retrieved from the reconstructed neighboring blocks. Index information of the reference sample line to be used for intra prediction of the current block may be signaled. For example, in Figure 7 , the reference sample line indicators 0, 1, and 2 may be signaled as index information indicating reference sample lines 0, 1, and 2. When the upper boundary of the current block is the boundary of a CTU, only reference sample line 0 may be available. Therefore, in this case, the index information may not be signaled. When using a reference sample line other than reference sample line 0, the filtering for the prediction block described later may not be performed.
[0219] When performing intra prediction, a filter may be applied to at least one of the reference samples and the prediction samples based on at least one of the intra prediction mode and the current block size.
[0220] In the case of the planar mode, when generating a prediction block of a current block, according to the position of a prediction target sample within the prediction block, the sample value of the prediction target sample can be generated by using a weighted sum of the upper-side reference sample and the left-side reference sample of the current block, and the upper-right-side reference sample and the lower-left-side reference sample of the current block. Additionally, in the case of the DC mode, when generating a prediction block of a current block, the average value of the upper-side reference sample and the left-side reference sample of the current block can be used. Additionally, in the case of the angular mode, a prediction block can be generated by using the upper-side reference sample, the left-side reference sample, the upper-right-side reference sample, and / or the lower-left-side reference sample of the current block. To generate a prediction sample value, interpolation of real number units can be performed.
[0221] In the case of intra prediction between color components, a prediction block of a current block of a second color component can be generated based on a corresponding reconstructed block of a 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, 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 upper neighboring samples and / or left neighboring samples of the current block, and upper neighboring samples 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 reconstructed block of the first color component and neighboring samples of 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 derivation of the parameters 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.
[0222] The current block can be partitioned into two or four sub-blocks either horizontally or vertically. The partitioned sub-blocks can be reconstructed sequentially. That is, intra prediction can be performed on the sub-blocks to generate sub-prediction blocks. Additionally, 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 samples for intra prediction of sub-sub-blocks. The sub-blocks can be blocks including a predetermined number (e.g., 16) or more samples. Thus, for example, when the current block is an 8×4 block or a 4×8 block, the current block can be partitioned into two sub-blocks. Further, 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 regarding whether to perform intra prediction based on the sub-blocks and / or the partition direction (horizontal or vertical) can be signaled. The intra prediction based on the sub-blocks can be limited to be performed only when using reference sample line 0. When performing intra prediction based on the sub-blocks, filtering for the prediction blocks described later may not be performed.
[0223] The final prediction block can be generated by performing filtering on the prediction block of the intra prediction. The filtering can be performed by applying predetermined weights to the filtering target sample, the left reference sample, the upper reference sample, and / or the upper-left reference sample. The weights and / or the reference samples (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 in the prediction block. The filtering can be performed only in the case of predetermined intra prediction modes (e.g., DC, planar, vertical, horizontal, diagonal, and / or adjacent diagonal modes). The adjacent diagonal mode can be a mode obtained by adding k to or subtracting k from the diagonal mode. For example, k can be a positive integer of 8 or less.
[0224] The intra prediction mode of the current block can be entropy-coded / decoded by predicting the intra prediction mode of the block adjacent to the current block. When the intra prediction modes of the current block and the neighboring block are the same, the information that the intra prediction modes of the current block and the neighboring block are the same can be signaled by using predetermined flag information. Additionally, the 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 modes of the current block and the neighboring block are different, the intra prediction mode information of the current block can be entropy-coded / decoded by performing entropy coding / decoding based on the intra prediction mode of the neighboring block.
[0225] Figure 5 is a diagram showing an embodiment of an inter picture prediction process.
[0226] In Figure 5 a rectangle can represent a picture. In Figure 5In the figure, the arrow indicates the prediction direction. The pictures can be classified into intra pictures (I pictures), predicted pictures (P pictures), and bi - directionally predicted pictures (B pictures) according to the coding type of the picture.
[0227] 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 preset 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.
[0228] Hereinafter, embodiments of inter - picture prediction will be described in detail.
[0229] Reference pictures and motion information can be used to perform inter - picture prediction or motion compensation.
[0230] 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 co - located block (also referred to as the col block or the 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 in the same position as the current block within the previously reconstructed co - located picture (also referred to as the col picture or the co - located picture). The co - located picture can be one of one or more reference pictures included in the reference picture list.
[0231] The method for deriving motion information may vary depending on 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 prediction mode, the affine mode, etc. Herein, the merge mode can be referred to as the motion merge mode.
[0232] For example, when the 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.
[0233] The encoding device 100 may calculate a motion vector difference (MVD) between a motion vector of a current block and a candidate motion vector, 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 a best motion vector candidate among motion vector candidates included in a motion vector candidate list. The decoding device may perform entropy decoding on the candidate motion vector index included in the bitstream, and may select a candidate motion vector of a decoding target block from among the candidate motion vectors included in the candidate motion vector list by using the entropy-decoded candidate motion vector index. In addition, the decoding device 200 may add the entropy-decoded MVD to the candidate motion vector extracted by entropy decoding, thereby deriving a motion vector of the decoding target block.
[0234] 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.
[0235] In addition, the encoding device 100 calculates a motion vector difference (MVD) between a motion vector in a current block and a candidate motion vector based on an affine model, and performs entropy encoding on the MVD. The decoding device 200 derives an affine control motion vector of a decoding target block based on each sub-block by deriving a sum of the entropy-decoded MVD and an affine control motion vector candidate, thereby deriving a motion vector.
[0236] 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 a bitstream to the decoding device 200. The decoding device 200 may generate a prediction block of a decoding target block based on the derived motion vector and the reference picture index information.
[0237] Another example of a method for deriving current motion information 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-prediction indicator. The prediction indicator may indicate uni-directional prediction (L0 prediction or L1 prediction) or bi-directional prediction (L0 prediction and L1 prediction).
[0238] 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 candidate), motion information of co-located blocks of the current block in a reference picture (temporal merge candidate), new motion information generated by a combination of motion information existing in the merge candidate list, motion information of a block encoded / decoded before the current block (history-based merge candidate), and zero merge candidate.
[0239] The encoding device 100 may generate a bitstream by performing entropy encoding on at least one of a merge flag and a merge index, and may signal the bitstream to the decoding device 200. The merge flag may be information indicating whether to perform the merge mode 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 on the left side of the current block, an upper neighboring block arranged above the current block, and a temporal neighboring block temporally adjacent to the current block.
[0240] 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 to perform correction, 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.
[0241] The skip mode may be a mode in which the motion information of a neighboring block is applied 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 a syntax element regarding at least any one of motion vector difference information, coded block flag, and transform coefficient level to the decoding device 200.
[0242] The sub-block merge mode may represent a mode of deriving motion information in units of sub-blocks of a coded 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 picture (sub-block-based temporal merge candidate) and / or affine control point motion vector merge candidate may be used to generate a sub-block merge candidate list.
[0243] The geometric partitioning mode may represent a mode of deriving motion information by partitioning a current block in a predetermined direction, deriving each predicted sample using each of the derived motion information, and deriving the predicted sample of the current block by weighting each of the derived predicted samples.
[0244] The inter-intra combined prediction mode may represent a mode of deriving the predicted sample of the current block by weighting the predicted sample generated by inter-frame prediction and the predicted sample generated by intra-frame prediction.
[0245] 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.
[0246] The decoding device 200 may use optical flow to compensate the predicted sample derived via inter-frame prediction.
[0247] Figure 6 is a diagram showing the transform and quantization processes.
[0248] As Figure 6 shown, a transform and / or quantization process is performed on the residual signal to generate a quantized level signal. The residual signal is the difference between the original block and the predicted block (i.e., an intra-frame predicted block or an 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. Performing a primary transform on the residual signal generates transform coefficients, and performing a secondary transform on the transform coefficients generates secondary transform coefficients.
[0249] 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 (KLT) transform. The transform coefficients generated by the primary transform may be subjected to 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 is signaled. The DCT-based transform may include, for example, DCT-2, DCT-8, etc. The DST-based transform may include (e.g.) DST-7.
[0250] A quantized level signal (quantization coefficient) can be generated by performing quantization on a residual signal or on the result of performing a primary transform and / or a secondary transform. Depending on the intra prediction mode or block size / shape of a block, the quantized level signal can be scanned according to at least one of a right-up diagonal scan, a vertical scan, and a horizontal scan. For example, when coefficients are scanned according to a right-up diagonal scan, the coefficients in block form are changed to a one-dimensional vector form. In addition to the right-up diagonal scan, a horizontal scan that horizontally scans the coefficients in two-dimensional block form or a vertical scan that vertically scans the coefficients in two-dimensional block form can be used according to the intra prediction mode and / or the size of the transform block. The scanned quantized level coefficients can be entropy coded for insertion into a bitstream.
[0251] The decoder entropy decodes the bitstream to obtain the quantized level coefficients. The quantized level coefficients can be arranged in two-dimensional block form by inverse scanning. For inverse scanning, at least one of a right-up diagonal scan, a vertical scan, and a horizontal scan can be used.
[0252] Then, the quantized level coefficients can be dequantized, then a secondary inverse transform can be performed as needed, and finally a primary inverse transform can be performed as needed to generate a reconstructed residual signal.
[0253] Inverse mapping in the dynamic range can be performed on the reconstructed luminance component by intra prediction or inter prediction before loop filtering. The dynamic range can be divided into 16 equal segments, and a mapping function for each segment can be signaled. The mapping function can be signaled at the slice level or at the parallel block group level. An inverse mapping function for performing inverse mapping can be derived based on the mapping function. Loop filtering, reference picture storage, and motion compensation are performed in the inverse mapping region, and a predicted block generated by inter prediction is converted to the mapped region by mapping using the mapping function and then used to generate a reconstructed block. However, since intra prediction is performed in the mapped region, the predicted block generated by intra prediction can be used to generate a reconstructed block without mapping / inverse mapping.
[0254] When the current block is a residual block of a chrominance component, the residual block can be transformed into an 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 of 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 chroma 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 of the segment to which the average of the sample values of the luminance prediction block belongs to refer to a lookup table. Finally, by scaling the residual block using the derived value, the residual block can be transformed into the inverse mapped region. Then, chrominance component block recovery, intra prediction, inter prediction, loop filtering, and reference picture storage can be performed in the inverse mapped region.
[0255] 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.
[0256] A prediction block of the current block can be generated based on a block vector indicating the displacement between the current block and a reference block in the current picture. In this way, the prediction mode for generating a prediction block by referring to the current picture is referred to as the intra block copy (IBC) mode. The IBC mode can be applied to M×N (M <= 64, N <= 64) coding units. The IBC mode can include a skip mode, a merge mode, an AMVP mode, and the like. In the case of the skip mode or the merge mode, a merge candidate list is constructed, and a merge index is signaled so that one merge candidate can be specified. The block vector of the 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. Additionally, 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 reconstructed region. For example, the value of the block vector can be limited such 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 limiting the value of the block vector in this way, the memory consumption and device complexity according to the IBC mode implementation can be reduced.
[0257] Figure 8 is a flowchart showing an image coding method according to an embodiment of the present invention. Additionally, Figure 9 is a flowchart showing an image decoding method according to an embodiment of the present invention.
[0258] In the following, an image encoding / decoding method according to the present disclosure will be described.
[0259] A single picture can be encoded by at least one of intra prediction, inter prediction, and intra block copy prediction.
[0260] In addition, a single block can be encoded / decoded in at least one of an intra prediction mode, an inter prediction mode, and an intra block copy mode.
[0261] The encoding / decoding method based on intra block copy prediction can be used in at least one of the following cases: the luminance component and the chrominance component have an independent block partition structure (i.e., a dual-tree structure); and the luminance component and the chrominance component have the same block partition structure (i.e., a single-tree structure).
[0262] The intra block copy prediction mode can be a method of deriving a prediction block from an already encoded / decoded region within the same picture / sub-picture / strip / parallel block (i.e., intra-frame) through a derived block vector (BV). Here, the same picture / sub-picture / strip / parallel block can represent the current picture / sub-picture / strip / parallel block. Here, the block vector can represent an intra block vector. Here, the already encoded / decoded region can be a region within the reconstructed image or the decoded image for the current picture / sub-picture / strip / parallel block. Here, the region within the reconstructed image can represent a reconstructed region, and the region within the decoded image can represent a decoded region.
[0263] Here, the already encoded / decoded region within the current picture can be a reconstructed region within the current picture, in which at least one of chrominance scaling and luminance mapping such as loop filtering, deblocking filtering, adaptive sample offset, and adaptive loop filtering is not performed. In addition, the already encoded / decoded region within the current picture can be a reconstructed / decoded region within the current picture, in which at least one of chrominance scaling and luminance mapping such as loop filtering, deblocking filtering, adaptive sample offset, and adaptive loop filtering is performed.
[0264] When encoding / decoding a current encoding / decoding target block (current block) in the intra block copy mode and the derived block vector is (x, y), the following reference block (the block corresponding to the already encoded / decoded region) can be used as the prediction block for the current block: having the same size as the current block and being x samples away from the current block in the horizontal direction (i.e., if x is a positive integer, being x samples away from the current block in the right horizontal direction, and if x is a negative integer, being -x samples away from the current block in the left horizontal direction) and being y samples away from the current block in the vertical direction (i.e., if y is a positive integer, being y samples away from the current block in the downward vertical direction, and if y is a negative integer, being -y samples away from the current block in the upward vertical direction).
[0265] Here, according to the signs, the sample points can be in opposite directions. For example, when x is a positive integer, the block vector can indicate a region away from the x sample point in the left horizontal direction. When x is a negative integer, the block vector can indicate a region away from the -x sample point in the right horizontal direction. Additionally, for example, when y is a positive integer, the block vector can indicate a region away from the y sample point in the upward vertical direction. When y is a negative integer, the block vector can indicate a region away from the -y sample point in the downward vertical direction.
[0266] The current block and the reference block can have different sizes from each other. For example, after reducing the size of the current block by performing downsampling or subsampling on the current block, the reference block can be determined. The reference block can be used as a prediction block for the current block by performing upsampling or interpolation on the thus determined reference block.
[0267] At least one of the size of the current block or the size of the reference block can be determined according to at least one coding parameter of the current block / CTB / CTU.
[0268] As in the Figure 10 example, both x and y can be negative integers, the top-left sample point position of the current block can be (x0, y0), and the top-left sample point position of the prediction block of the current block can be (x0 + x, y0 + y). Here, the prediction block of the current block can represent the reference block of the current block.
[0269] When prediction using the intra-block copy mode is performed on the current block, the current block can be encoded / decoded in one of the following ways.
[0270] The current block can be encoded / decoded according to the intra-block copy skip mode. According to the intra-block copy skip mode (similar to the skip mode in the inter prediction mode), the block vector of the current block can be derived from the block vectors of the blocks encoded / decoded before the current block, and the residual block can be not entropy encoded / decoded.
[0271] The current block can be encoded / decoded according to the intra-block copy merge mode. According to the intra-block copy merge mode (similar to the merge mode in the inter prediction mode), the block vector of the current block can be derived from the block vectors of the blocks encoded / decoded before the current block, and the residual block can be entropy encoded / decoded.
[0272] The current block can be encoded / decoded according to the intra-block copy AMVP (Advanced Motion Vector Prediction) mode. According to the intra-block copy AMVP mode (similar to the AMVP mode in the inter prediction mode), the block vector can be encoded / decoded, and the block can be encoded / decoded according to the block vector.
[0273] The current block can be encoded / decoded according to the Intra Block Copy AMVR (Adaptive Motion Vector Resolution) mode. According to the Intra Block Copy AMVR mode (similar to the AMVR mode in the inter prediction mode), the resolution of the block vector can be encoded / decoded into one of one or more resolutions, and the block vector can be encoded / decoded according to this resolution. The Intra Block Copy AMVP mode can represent the Intra Block Copy AMVR mode.
[0274] The current block can be encoded / decoded according to the multi-hypothesis Intra Block Copy mode. According to the multi-hypothesis Intra Block Copy mode, at least one reference block can be determined based on at least one block vector. Additionally, a predicted block of the current block can be generated by performing a weighted sum of the sample values in at least one reference block. Here, statistical values can be used instead of the weighted sum.
[0275] Information indicating whether to use at least one of the Intra Block Copy Skip mode, Intra Block Copy Merge mode, Intra Block Copy AMVP mode, Intra Block Copy AMVR mode, and multi-hypothesis Intra Block Copy mode can be entropy encoded / decoded based on at least one coding parameter of the current block / CTB / CTU and neighboring blocks / CTBs / CTUs adjacent to the current block / CTB / CTU.
[0276] Deblocking filtering can be performed on the block boundary according to whether the Intra Block Copy mode is executed.
[0277] For example, when at least one of the neighboring blocks adjacent to the block boundary is in the Intra Block Copy mode, the block boundary can be set as the target block boundary to be deblocked filtered. In addition, deblocking filtering can be performed on the block boundary.
[0278] As another example, when all neighboring blocks adjacent to the block boundary are in the Intra Block Copy mode, the block boundary can be set as the target block boundary to be deblocked filtered. In addition, deblocking filtering can be performed on the block boundary.
[0279] As another example, when the neighboring blocks adjacent to the block boundary do not use the Intra Block Copy mode, the block boundary can not be set as the target block boundary to be deblocked filtered. In addition, deblocking filtering can not be performed on the block boundary.
[0280] As another example, when at least one of the neighboring blocks adjacent to the block boundary is in the Intra Block Copy mode, the block using the Intra Block Copy mode can be regarded as an inter prediction block. Additionally, the block boundary can be set as the target block boundary to be deblocked filtered. Deblocking filtering can be performed on the block boundary.
[0281] As another example, when at least one of the neighboring blocks adjacent to a block boundary is in an intra block copy mode, the block using the intra block copy mode can be regarded as an intra prediction block. In addition, the block boundary can be set as the target block boundary to be deblocked. Deblocking can be performed on the block boundary.
[0282] As another example, when the block vector difference of the neighboring blocks adjacent to a block boundary is at least one sample point, the block boundary can be set as the target block boundary to be deblocked. In addition, deblocking can be performed on the block boundary.
[0283] As another example, when the block vectors of the neighboring blocks adjacent to a block boundary are different from each other, the block boundary can be set as the target block boundary to be deblocked. In addition, deblocking can be performed on the block boundary.
[0284] As another example, when the block vectors of the neighboring blocks adjacent to a block boundary are different in at least one of the x component and the y component, the block boundary can be set as the target block boundary to be deblocked. In addition, deblocking can be performed on the block boundary.
[0285] When it is determined that deblocking will be performed on a block boundary, deblocking can be performed on the block boundary of blocks with an 8×8 unit in the area of the block using the intra block copy mode.
[0286] Whether to perform deblocking on the block boundary, the filter strength, etc. can be determined according to at least one coding parameter for the intra block copy mode.
[0287] When it is determined that deblocking will be performed on a block boundary, the filter strength can be set. Here, the filter strength can be set as a positive integer equal to or greater than 1.
[0288] The block boundary can represent the boundary of the current block. In other words, the block boundary can represent the boundary between the current block and the neighboring block.
[0289] In the encoder / decoder, the coding mode of the current luminance component can be derived as follows. The coding mode can represent the prediction mode.
[0290] At least one of the following multiple pieces of coding information can be used to determine the coding mode of the current luminance component, and at least one of the following multiple pieces of coding information can be entropy encoded / decoded.
[0291] The coding information can include information indicating that the luminance component block is in a skip mode (for example, skip mode identifier, flag, index, skip_flag, cu_skip_flag, etc.).
[0292] Based on the information indicating the skip mode, it can be determined whether to apply the skip mode to the current block. For example, when the information indicating the skip mode has a first value (1), the skip mode can be applied to the current block. Additionally, when the information indicating the skip mode has a second value (0), the skip mode may not be applied to the current block. The coding information may include prediction mode information (e.g., index, identifier, flag, etc.) of the luminance component block. The prediction mode information may include intra prediction mode, inter prediction mode, and intra block copy mode.
[0293] For example, when the syntax element indicating the prediction mode information has a first value (0), a second value (1), or a third value (2), it may indicate an intra prediction mode, an inter prediction mode, or an intra block copy mode, respectively.
[0294] In addition, for example, the first prediction mode information (e.g., index, flag, identifier, pred_mode_flag, etc.) may indicate whether to apply the intra prediction mode. When the first prediction mode information has a first value (1), it may indicate applying the intra prediction mode. When the first prediction mode information has a second value (0), it may indicate not applying the intra prediction mode. When it is indicated not to apply the intra prediction mode, the second prediction mode information (e.g., index, flag, identifier, pred_mode_ibc_flag, etc.) can be encoded / decoded to show whether to apply the inter prediction mode or the intra block copy mode. When the second prediction mode information has a first value (1), it may indicate applying the intra block copy mode. When the second prediction mode information has a second value (0), it may indicate applying the inter prediction mode.
[0295] As another example, the first prediction mode information (e.g., index, flag, identifier, pred_mode_flag, etc.) may indicate whether to apply the intra prediction mode or the inter prediction mode. When the first prediction mode information has a first value (1), the intra prediction mode can be applied to the corresponding luminance component block. Additionally, when the first prediction mode information has a second value (0), the inter prediction mode can be applied to the corresponding luminance component block. Additionally, the second prediction mode information (e.g., index, flag, identifier, pred_mode_ibc_flag, etc.) can be entropy encoded / decoded or derived. When the second prediction mode information has a first value (1), the intra block copy mode can be applied to the corresponding luminance component block. When the second prediction mode information has a second value (0), the prediction mode of the corresponding luminance component block can be determined as the intra prediction mode or the inter prediction mode determined in the first prediction mode information.
[0296] 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.).
[0297] When the current luminance component block is not in the skip mode but in the intra block copy mode, and the information indicating the merge mode has a specific value, the merge mode can be applied to the current luminance component block. For example, when the information indicating the merge mode has a first value (1), the merge mode can be applied to the current luminance component block. When the information indicating the merge mode has a second value (0), the merge mode may not be applied to the current luminance component block.
[0298] The coding mode of the current luminance component block can be derived based on at least one coding parameter of the current block / CTB / CTU and neighboring blocks / CTBs / CTUs adjacent to the current block / CTB / CTU.
[0299] In the foregoing and / or other embodiments described herein, the first value and the second value may have different values. For example, the first value may be 0 and the second value may be 1.
[0300] In the foregoing and / or other embodiments described herein, chrominance component blocks may be used instead of luminance component blocks. For example, the current chrominance component block may be applied to the above and / or other embodiments of the present invention in place of the current luminance component block.
[0301] The coding mode of the current luminance component block can be determined by using the following coding information. Herein, the coding mode may represent a prediction mode. Additionally, the coding information may represent prediction mode information.
[0302] When the luminance component block is in the skip mode and the corresponding sub-picture, block, parallel block group, stripe, or parallel block is not of type I, entropy coding / decoding can be performed on the prediction mode information.
[0303] When the luminance component block is in the skip mode and the corresponding sub-picture, block, parallel block group, stripe, or parallel block is of type I, entropy coding / decoding may not be performed on the prediction mode information, and the corresponding block can be determined as the block copy skip mode. This is because the intra prediction mode and the inter prediction mode are prediction modes that can be used in the case of type I, and type I is not used for the skip mode.
[0304] When the luminance component block is in the skip mode and the corresponding sub-picture, block, parallel block group, stripe, or parallel block is not of type I, entropy coding / decoding can be performed on the prediction mode information. In this case, when the corresponding luminance component block is determined to be in the intra block copy mode based on the prediction mode information, the corresponding luminance component block can be determined as the intra block copy skip mode.
[0305] In addition, when the luminance component block is not in the skip mode, the residual blocks of the luminance component block and the chrominance component block are encoded / decoded, and when the luminance component block is determined to be in the intra block copy mode according to the prediction mode information, the information indicating the merge mode can be entropy encoded / decoded. Here, when the information indicating the merge mode indicates that the corresponding luminance component block is in the merge mode, the corresponding luminance component block can be predicted according to the intra block copy merge mode.
[0306] When the luminance component block is not in the skip mode and the corresponding luminance component block is determined to be in the intra block copy mode according to the prediction mode information, the information indicating whether the prediction mode is the merge mode can be entropy encoded / decoded. Optionally, for example, when the luminance component block is not in the skip mode, the information indicating whether the luminance component block is in the merge mode can be encoded / decoded. Here, when the information indicating whether the prediction mode is the merge mode indicates that the corresponding luminance component block is in the merge mode, the corresponding luminance component block can be determined to be in the intra block copy merge mode.
[0307] When the luminance component block is neither in the skip mode nor in the merge mode but in the intra block copy mode, the luminance component block can be encoded / decoded according to the intra block copy AMVP mode. For example, based on the information indicating whether the prediction mode is the merge mode, it can be determined whether the prediction mode for the corresponding luminance component block is the intra block copy mode or the intra block copy AMVP mode. Here, the information indicating whether the prediction mode is the merge mode can be the information indicating whether the inter prediction coding parameters of the current block are derived from the inter prediction coding parameters of the neighboring blocks of the current block.
[0308] The coding mode of the luminance component block can be derived according to at least one of the above-mentioned multiple coding information and at least one coding parameter of the current block / CTB / CTU and the neighboring block / CTB / CTU adjacent to the current block / CTB / CTU.
[0309] qtbtt_dual_tree_intra_flag can indicate that for slice I, each CTU is partitioned into 64×64 coding units, and the 64×64 coding units are used as the root nodes of the luminance component and the chrominance component.
[0310] For example, when qtbtt_dual_tree_intra_flag is the first value (e.g., 0), each CTU can be partitioned into 64×64 coding units, and the 64×64 coding units are not used as the root nodes of the luminance component and the chrominance component. In addition, when qtbtt_dual_tree_intra_flag is the second value (e.g., 1), each CTU can be partitioned into 64×64 coding units, and the 64×64 coding units are used as the root nodes of the luminance component and the chrominance component.
[0311] When the qtbtt_dual_tree_intra_flag is the first value (e.g., 0), the block partitioning structure of the luminance component and the block partitioning structure of the chrominance component can be the same as each other. However, depending on the type of the chrominance component, the block size of the luminance component and the block size of the chrominance component can be different from each other. In this case, it can be said that a single-tree structure is used. The single-tree type can be identified as SINGLE_TREE.
[0312] When the slice type is slice I and the qtbtt_dual_tree_intra_flag is the second value (e.g., 1), in a 64×64 coding unit, the block partitioning structure of the luminance component and the block partitioning structure of the chrominance component can be different from each other. Here, the block partitioning structure of the luminance component and the block partitioning structure of the chrominance component can be independent of each other. In this case, it can be said that a dual-tree structure is used. In the dual-tree structure, the tree type of the luminance component can be identified as DUAL_TREE_LUMA, and the tree type of the chrominance component can be identified as DUAL_TREE_CHROMA.
[0313] In the case of the single-tree structure, the minimum block for the chrominance component using at least one of the multiple intra-block copy modes can be set to a 2×2 block. Here, blocks with a size smaller than 2×2 may not be used for the chrominance component. In other words, it may not be permitted to partition a block with a size of 2×2 or larger using at least one of the multiple intra-block copy modes into blocks with a size smaller than 2×2.
[0314] In addition, in the case of the single-tree structure, the minimum block for the chrominance component using at least one of the multiple intra-block copy modes can be set to a 4×4 block. Here, 2×2 blocks, 2×4 blocks, and 4×2 blocks may not be used for the chrominance component. In other words, it may not be permitted to partition a block with a size larger than at least one of 2×2, 2×4, and 4×2 into blocks with a size of at least one of 2×2, 2×4, and 4×2.
[0315] In addition, in the case of the dual-tree structure, the minimum block for the chrominance component using at least one of the multiple intra-block copy modes can be set to a 4×4 block. Here, 2×2 blocks, 2×4 blocks, and 4×2 blocks may not be used for the chrominance component. In other words, it may not be permitted to partition a block with a size larger than at least one of 2×2, 2×4, and 4×2 into blocks with a size of at least one of 2×2, 2×4, and 4×2.
[0316] To improve the subjective / objective quality of an image, an encoder may generate primary transform coefficients by performing a primary transform on a residual block, generate secondary transform coefficients by performing a secondary transform on the primary transform coefficients, generate quantized coefficient levels by quantizing the secondary transform coefficients, and perform entropy coding on the quantized coefficient levels.
[0317] A decoder may perform entropy decoding on the quantized coefficient levels, generate secondary transform coefficients by dequantizing the quantized coefficient levels, generate primary transform coefficients by performing a secondary inverse transform on the secondary transform coefficients, and generate a reconstructed residual block by performing a primary inverse transform on the primary transform coefficients.
[0318] In the encoder, the secondary transform may be performed between the primary transform and quantization, and in the decoder, the secondary inverse transform may be performed between dequantization and the primary inverse transform. Here, the secondary transform may be a simplified secondary transform or a low-frequency non-separable transform (LFNST).
[0319] When at least one intra-block copy mode among multiple intra-block copy modes is used for the current block, the secondary transform / inverse transform may be performed on the current block. Here, the secondary transform / inverse transform may be performed on at least one of a luminance component block and a chrominance component block.
[0320] In addition, a set of transform matrices may be determined according to at least one intra-block copy mode among multiple intra-block copy modes of the current block.
[0321] Here, when the secondary transform is performed on the current block, entropy coding / decoding may be performed on a transform matrix index, where the transform matrix index indicates which transform matrix in the set of transform matrices will be used for the secondary transform / inverse transform.
[0322] In the encoder / decoder, the coding mode of the current luminance component block or the current chrominance component block may be derived as follows. Here, the coding mode may represent a prediction mode. In addition, the coding information may represent prediction mode information.
[0323] When the luminance component and the chrominance component have the same block partition structure (single tree type: SINGLE_TREE), the coding mode may be determined as described below.
[0324] For example, the prediction mode of the chrominance component block (e.g., intra prediction, inter prediction, intra-block copy prediction) may be the same as the prediction mode of the corresponding luminance component block. In the foregoing and / or other embodiments described herein, the intra-block copy mode may represent at least one of an intra-block copy skip mode, an intra-block copy merge mode, an intra-block copy AMVP mode, and an intra-block copy AMVR mode.
[0325] In addition, when the corresponding luma component block is in the intra block copy skip mode, the residual block of the chroma component block can be encoded / decoded, and the residual block information may not be signaled. Here, the information indicating whether to signal the information of the corresponding residual block (e.g., cu_cbf, tu_cbf, etc.) may not be entropy encoded / decoded. tu_cbf may include at least one of tu_cbf_cb and tu_cbf_cr.
[0326] In addition, when the corresponding luma component block is in the intra block copy merge mode, the residual block of the chroma component block may not be encoded / decoded, and the residual block information may not be signaled. Here, the information indicating that the residual block information is not signaled (e.g., cu_cbf, tu_cbf, etc.) may not be entropy encoded / decoded. tu_cbf may include at least one of tu_cbf_cb and tu_cbf_cr.
[0327] In addition, for example, when the luma component and the chroma component have the same block partitioning structure and the current chroma component block is in the intra block copy mode (or when the luma component block corresponding to the current chroma component block is in the intra block copy mode), the information required for encoding / decoding the current chroma component block can be derived from the encoding / decoding information of the luma component block corresponding to the current chroma component block.
[0328] Here, the information required for encoding / decoding the current chroma component block can be derived from the encoding information of the luma component block corresponding to the sample position corresponding to the center of the chroma component block. In addition, the information required for encoding / decoding the current chroma component block can be derived from the encoding information of the luma component block corresponding to the sample position at the upper left side of the chroma component block.
[0329] The encoding mode of the current chroma component block can be derived based on at least one encoding parameter of the current chroma component block / CTB and the luma component block / CTB corresponding to the chroma component block / CTB.
[0330] When the luma component and the chroma component have independent block partitioning structures (tree types DUAL_TREE_LUMA or DUAL_TREE_CHROMA for the dual-tree structure), the encoding mode of the chroma component block can be determined from the encoding mode information of the luma component block that has been entropy encoded / decoded. Similar to the encoding mode of the luma component block, the encoding mode of the chroma component block can be an intra prediction mode, an inter prediction mode, or an intra block copy mode. Here, the encoding mode can represent the prediction mode.
[0331] For example, when the syntax element indicating the prediction mode information has a first value (0), a second value (1), or a third value (2), the intra prediction mode, the inter prediction mode, or the intra block copy mode can be applied to the current block, respectively.
[0332] As another example, the first prediction mode information (e.g., index, flag, identifier, pred_mode_flag, etc.) may indicate whether an intra prediction mode is applied to a current block. When the first prediction mode information has a first value (1), the prediction mode of the current block may be determined as an intra prediction mode. When the first prediction mode information has a second value (0), the prediction mode of the current block may not be determined as an intra prediction mode. When it is indicated that the intra prediction mode is not applied, entropy coding / decoding may be performed on the second prediction mode information (e.g., index, flag, identifier, pred_mode_ibc_flag, etc.). The second prediction mode information may indicate at least one of an inter prediction mode and an intra block copy mode. When the second prediction mode information has a first value (1), the prediction mode of the current block may be an intra block copy mode. When the second prediction mode information has a second value (0), the prediction mode of the current block may be determined as an inter prediction mode.
[0333] As another example, the first prediction mode information (e.g., index, flag, identifier, pred_mode_flag, etc.) may indicate whether an intra prediction mode or an inter prediction mode is applied. When the first prediction mode information has a first value (1), the prediction mode of the current block may be determined as an intra prediction mode. When the first prediction mode information has a second value (0), the prediction mode of the current block may be determined as an inter prediction mode. Additionally, entropy coding / decoding or derivation may be performed on the second prediction mode information (e.g., index, flag, identifier, pred_mode_ibc_flag, etc.). When the second prediction mode information has a first value (1), the prediction mode of the current block may be determined as an intra block copy mode. When the second prediction mode information has a second value (0), the prediction mode of the corresponding chrominance component block may be determined as an intra prediction mode or an inter prediction mode according to the first prediction mode information.
[0334] As another example, the second prediction mode information (e.g., index, flag, identifier, pred_mode_ibc_flag, etc.) may be signaled or derived. Additionally, when the second prediction mode information has a first value (1), the prediction mode of the current block may be determined as an intra block copy mode. Additionally, when the second prediction mode information has a second value (0), the prediction mode of the current block may be determined as an intra prediction mode.
[0335] The luminance component and the chrominance component may have an independent block partitioning structure. When the current chrominance component block is in an intra block copy mode, the information (e.g., block vector) required for encoding / decoding of the current chrominance component block may be derived from the encoding information of the luminance component block corresponding to the current chrominance component block.
[0336] Here, information required for encoding / decoding the current chrominance component block can be derived from the encoding information of the luminance component block corresponding to the sample position at the center of the chrominance component block. Additionally, information required for encoding / decoding the current chrominance component block can be derived from the encoding information of the luminance component block corresponding to the sample position at the upper left side of the chrominance component block.
[0337] The encoding mode of the chrominance component block can be derived based on at least one encoding parameter of the current chrominance component block / CTB and neighboring blocks / CTBs adjacent to the current chrominance component block / CTB.
[0338] Hereinafter, a method for deriving a block vector for intra block copy prediction will be described.
[0339] 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 of a luminance component block and the step of deriving a block vector of a chrominance component block.
[0340] Hereinafter, the steps for deriving a block vector of a luminance component block will be described. For example, when the current block is a luminance component block and is encoded / decoded in intra block copy skip mode or intra block copy merge mode, the method for deriving the block vector may be as follows.
[0341] To derive the block vector of the luminance component block, a block vector candidate configuration block vector candidate list of the luminance component block encoded / decoded before the current block can be used. Additionally, at least one of the candidates included in the configured block vector candidate list can be used as the block vector of the current block. Here, at least one piece of vector candidate information (e.g., identifier, index, flag, merge_idx, etc.) for identifying the candidates in the block vector candidate list can be entropy encoded / decoded. Optionally, the block vector candidate information can be derived based on at least one encoding parameter.
[0342] Here, at least one or more block vector candidate lists can be configured. Additionally, at least one block vector candidate can be used in the current block. Additionally, at least one piece of block vector candidate information can be entropy encoded / decoded.
[0343] The block vector candidate list can consist of up to N candidates. Here, N can be a positive integer. Here, N can represent the maximum number of candidates in the block vector candidate list. N can be derived based on at least one encoding parameter of the current block / CTB / CTU.
[0344] The block vector candidate list can be used in intra block copy skip mode, intra block copy merge mode, and intra block copy AMVP mode. Additionally, intra block copy skip mode, intra block copy merge mode, and intra block copy AMVP mode can configure and use a common block vector candidate list.
[0345] In addition, at least one of the following candidates may be included in the block vector candidate list.
[0346] As in the example of Figure 11 a block vector may be derived from at least one of the following blocks: B1 adjacent to the top of the current block X, A1 adjacent to the left of the current block X, B0 adjacent to the upper right corner of the current block X, B2 adjacent to the upper left corner of the current block X, and A0 adjacent to the lower left corner of the current block X. In addition, the block vector derived therefrom may be determined as the block vector of the current block candidate. Here, at least one of the block vectors derived therefrom may be included in the block vector candidate list. Here, the block vector derived therefrom may be a block vector candidate of an adjacent neighboring block of the current block.
[0347] When there is a block vector in the remaining 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. In other words, the block vector of block B2 may not be included in the block vector candidate list.
[0348] In addition, for at least one block included in positions A0, A1, B0, B1, and B2, it may be determined whether there is a block vector in each block according to a predetermined priority order (in other words, whether the corresponding block is encoded / decoded using the intra-block copy mode or the corresponding block is the intra-block copy mode). When there is a block vector in the corresponding block, the block vector may be determined as a block vector candidate. Here, at least one of the block vectors determined therefrom may be included in the block vector candidate list. Here, the predetermined priority order for configuring the block vector candidate list may be the order of A1, B1, B0, A0, and B2. According to the predetermined priority order, the block vectors of M neighboring blocks may be determined as block vector candidates. Here, when the block vectors of N neighboring blocks are determined as block vector candidates (where N is less than M), the block vectors of the remaining neighboring blocks according to the priority order may not be determined as block vector candidates. For example, M and N may be 5 and 4, respectively. However, they are not limited thereto and may be positive integers including 1.
[0349] When configuring the block vector candidate list according to the predetermined priority order, a redundancy test may be performed between the block vector candidates existing in the block vector candidate list and the block vector candidates newly added to the block vector candidate list. For example, when the block vector candidate newly added to the block vector candidate list overlaps with the block vector candidates existing in the block vector candidate list, the overlapping block vector candidate may not be added to the block vector candidate list.
[0350] For example, when the block vector candidate list is configured in the order of A1, B1, B0, A0, and B2, a redundancy test can be performed between block B1 and block A1 and also between block B0 and block B1. Additionally, a redundancy test can be performed between block A0 and block A1. Additionally, a redundancy test can be performed on block B2, A1, and B1. The redundancy test can be performed only when there is a block vector in the corresponding block.
[0351] For example, a redundancy test can be performed between the block vector added to the block vector candidate list on the one hand and all the block vectors existing in the block vector candidate list on the other hand.
[0352] Additionally, when there is a block vector in at least one of the blocks included in positions A0, A1, B0, B1, and B2, it can be determined whether the block vector of the block is available in the current block. Only when the block vector is available can the block vectors of adjacent blocks be determined as block vector candidates. When the block vector of a block is not available, it cannot be used as a block vector candidate. Here, it can be determined whether the block vector is available based on whether the reference sample (block) at the position indicated by the block vector is available.
[0353] For example, when the region / position indicated by the corresponding block vector includes at least one of the samples included in the current block, the corresponding block vector can be determined as unavailable.
[0354] For example, when the region / position indicated by the corresponding block vector includes at least one of the regions / positions / samples located outside the boundaries of the picture, sub-picture, stripe, parallel block group, parallel block, and partitioned block, the corresponding block vector can be determined as unavailable.
[0355] Furthermore, at least one of the block vectors encoded / decoded before the current block can be stored in a buffer. At least one of the block vectors stored in the buffer can be determined as a block vector candidate for the current block. Here, at least one of the block vector candidates thus determined can be included in the block vector candidate list.
[0356] Here, the block vectors can be stored in a buffer of a specific size in the coding / decoding order. When the corresponding buffer is full, the first stored block vector can be deleted, and a new block vector (i.e., the block vector of the most recently coded / decoded block) can be stored in the buffer. The priority order of including the block vectors stored in the corresponding buffer in the block vector candidate list can be different according to the order in which the block vectors are stored in the buffer (e.g., in ascending or descending chronological order from the oldest to the most recent or from the most recent to the oldest). For example, the block vectors can be included in the block vector candidate list according to the ascending chronological order in which the block vectors are stored in the buffer. Optionally, the block vectors can be included in the block vector candidate list according to the descending chronological order of storing the block vectors. Such block vector candidates are called history-based block vector candidates. In other words, the block vectors stored in the buffer can represent history-based block vector candidates.
[0357] The buffer including the history-based block vectors can be managed and used as a buffer separate from the buffer used in the inter-frame prediction mode.
[0358] The buffer including the history-based block vectors can be the same as the buffer used in the inter-frame prediction mode.
[0359] When configuring the block vector candidate list by using at least one of the history-based block vector candidates, it can be determined whether the corresponding history-based block vector candidate is available in the current block. Only when the history-based block vector candidate is available can the history-based block vector candidate be added to the block vector candidate list. Here, it can be determined whether the corresponding history-based block vector is available according to whether the reference sample (block) at the position indicated by the block vector is available.
[0360] For example, when the region / position indicated by the corresponding history-based block vector includes at least one of the samples included in the current block, the corresponding history-based block vector can be determined to be unavailable.
[0361] For example, when the region / position indicated by the corresponding history-based block vector includes at least one of the regions / positions / samples located outside the boundaries of the picture, sub-picture, stripe, parallel block group, parallel block, and partitioned block, the corresponding history-based block vector can be determined to be unavailable.
[0362] When configuring the block vector candidate list by using at least one of the history-based block vector candidates, a redundancy test can be performed between the corresponding history-based block vector candidate and the block vector candidates in the block vector candidate list. When there are no identical (redundant) block vectors, the history-based block vector candidate can be added to the block vector candidate list.
[0363] As another example, when configuring a block vector candidate list by using at least one of the history-based block vector candidates, a redundancy test may be performed between the block vector candidates in the block vector candidate list and the corresponding history-based block vector candidates. When there is no identical block vector, the history-based block vector candidate may be added to the block vector candidate list.
[0364] As another example, when configuring a block vector candidate list by using at least one of the history-based block vector candidates, the history-based block vector candidate may be added to the block vector candidate list without performing a redundancy test between the history-based block vector candidate and the block vector candidates in the block vector candidate list. For example, a 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 block vector candidate that is stored first or most recently in the history-based block vector candidate list composed of the history-based block vector candidates.
[0365] When encoding / decoding is performed in units of pictures, slices, sub-pictures, blocks, parallel block groups, parallel blocks, CTUs, CTU rows, and CTU columns, a buffer including the history-based block vector candidates is maintained. Accordingly, the buffer may be used within units of pictures, slices, sub-pictures, blocks, parallel block groups, parallel blocks, CTUs, CTU rows, and CTU columns.
[0366] In addition, for example, when configuring a block vector candidate list by using one or more history-based block vector candidates, a redundancy test 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. As a result of the test, when there is no identical block vector, the predetermined candidate may be added to the block vector candidate list. For example, the predetermined candidate may represent the first candidate among the history-based block vector candidates. Here, the first candidate may represent the block vector candidate that is most recently stored in the history-based block vector candidate list composed of the history-based block vector candidates.
[0367] In addition, the buffer may include at least one piece of encoding information about a block encoded / decoded before the current block in units of pictures, slices, sub-pictures, blocks, parallel block groups, parallel blocks, CTUs, CTU rows, and CTU columns.
[0368] In addition, when the buffer is configured in units of pictures, slices, sub-pictures, blocks, parallel block groups, parallel blocks, CTUs, CTU rows, and CTU columns, the buffer can be initialized at the start position / region / block / cell of the picture, slice, sub-picture, block, parallel block group, parallel block, CTU, CTU row, and CTU column. Here, when the buffer is initialized, each block vector existing in the buffer can be deleted. In addition, when the buffer is initialized, each block vector existing in the buffer can be determined as a predetermined value. Here, the predetermined value can represent the values of x and y in the block vector (x, y). For example, x and y can be integer values.
[0369] Combined block vector candidates can be used, where the combined block vector candidates utilize at least two block vector candidates existing in the block vector candidate list. The combined block vector candidates can be added to the block vector candidate list. Here, the combined block vector candidates can each have statistical values for the x-components and y-components of at least two of the block vector candidates existing in the block vector candidate list. Here, when configuring the combined block vector candidates, history-based block vector candidates may not be used. Here, when configuring the combined block vector candidates, the encoder / decoder may not use at least one of the block vector candidates of the neighboring blocks of the current block. Here, the encoder / decoder can determine whether a combined block vector candidate composed of block vector candidates is available in the current block. Only when the combined block vector candidate is available can it be determined as a combined block vector candidate. Here, the encoder / decoder can determine whether a block vector is available based on whether the reference sample (block) at the position indicated by the block vector is available.
[0370] For example, when the region / position indicated by the corresponding combined block vector candidate includes at least one of the samples included in the current block, the encoder / decoder can determine the corresponding combined block vector candidate as unavailable.
[0371] For example, when the region / position indicated by the corresponding combined block vector candidate includes at least one of the regions / positions / samples located outside the boundaries of the picture, sub-picture, slice, parallel block group, parallel block, and block, the encoder / decoder can determine the corresponding combined block vector candidate as unavailable.
[0372] When the current luma component block has a horizontal length W and a vertical length H, (-(W<<n)+a,-(H<<n)+b), (-(W<<n)+c,0), or (0,-(H<<n)+d) can be block vector candidates included in the block vector candidate list. Here, n can be a positive integer, and a, b, c, and d can have integer values. This can be referred to as a fixed basic block vector candidate. The encoder / decoder can add the fixed basic block vector candidate to the block vector list.
[0373] The encoder / decoder can configure a block vector candidate list according to a predetermined order by using at least one of block vector candidates of neighboring blocks adjacent to the current block, history-based block vector candidates, combined block vector candidates, and fixed basic block vector candidates.
[0374] For example, the order of configuring the block vector candidate list can be set in the order of block vector candidates of neighboring blocks adjacent to the current block, history-based block vector candidates, combined block vector candidates, and fixed basic block vector candidates.
[0375] For example, the fixed basic block vector candidates can be configured in the following order until the number of candidates in the block vector candidate list reaches the maximum number of candidates in the block vector candidate list.
[0376] 1. (-(W << 1), 0)
[0377] 2. (0, -(H << 1))
[0378] 3. (-(W << 1) - 1, 0)
[0379] 4. (0, -(H << 1) - 1)
[0380] 5. (-(W << 1) - 2, 0)
[0381] 6. (0, -(H << 1) - 2)
[0382] 7. (-(W << 1) - 3, 0)
[0383] 8. (0, -(H << 1) - 3)
[0384] 9. (-(W << 1) - 4, 0)
[0385] 10. (0, -(H << 1) - 4)
[0386] As another example, the fixed basic block vector can be the (0, 0) vector. The encoder / decoder can configure a block vector candidate list with the maximum number of block vector candidates by adding the fixed basic block vector until the number of candidates in the block vector candidate list reaches the maximum number. For example, when the number of block vector candidates added to the block vector candidate list by using block vectors of neighboring blocks, history-based block vectors, and combined block vectors 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 is reached. In this article, the fixed basic block vector can be the (0, 0) vector.
[0387] When configuring the block vector candidate list, the maximum number of block vector candidates of neighboring blocks adjacent to the current block that can be included in the block vector candidate list can be the maximum number of block vector candidates (N) or (N - m). Here, N can be a positive integer, and m can be a positive integer. Additionally, N can have a value larger than m.
[0388] When configuring 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 of block vector candidates (N) or (N - m). Here, N can be a positive integer, and m can be a positive integer. Additionally, N can have a value larger than m.
[0389] When configuring the block vector candidate list, the maximum number of combined block vector candidates that can be included in the block vector candidate list can be the maximum number of block vector candidates (N) or (N - m). Here, N can be a positive integer, and m can be a positive integer. Additionally, N can have a value larger than m.
[0390] When the encoder / decoder partitions a parent block and encodes / decodes each block partitioned from the parent block in the intra block copy skip mode or the intra block copy merge mode, if the block size of at least one block obtained by partitioning the parent block is smaller than a predetermined threshold, the blocks obtained by this partitioning can generally use the block vector candidate list configured in the parent block.
[0391] When configuring the block vector candidate list, the maximum number of fixed basic block vector candidates that can be included in the block vector candidate list can be the maximum number of block vector candidates (N) or (N - m). Here, N can be a positive integer, and m can be a positive integer. Additionally, N can have a value larger than m.
[0392] The maximum number of candidates in the block vector candidate list can be a value set in the encoder / decoder or a value signaled from the encoder to the decoder. Optionally, the maximum number can be determined differently based on the coding parameters (e.g., size, form, etc.) of the current block. Optionally, the maximum number can be determined according to a combination of at least two of the above methods.
[0393] Block vector candidates can be derived according to at least one coding parameter of the current block / CTB / CTU.
[0394] Block vector candidates can be added to the block vector candidate list according to at least one coding parameter of the current block / CTB / CTU.
[0395] When partitioning a parent block and encoding / decoding each block in the intra block copy skip mode, intra block copy merge mode, intra block copy AMVP mode, or intra block copy AMVR mode, if at least one block obtained by partitioning the parent block is smaller than a predetermined threshold, at least one block among the blocks obtained by the partitioning may share the block vector candidate list configured in the parent block.
[0396] Whether to share the block vector candidate list configured in the parent block may be determined by using at least one of the horizontal length (W) and vertical length (H) of the parent block or child block. For example, when at least one of the following conditions is satisfied, the encoder / decoder may use the block vector candidate list configured in the parent block for at least one of the partitioned child blocks (blocks partitioned from the parent block).
[0397] Quadtree partitioning from the parent block to the child block: (horizontal length of the parent block × vertical length of the parent block) / 4 < threshold
[0398] Horizontal or vertical binary tree partitioning from the parent block to the child block: (horizontal length of the parent block × vertical length of the parent block) / 2 < threshold
[0399] Ternary tree partitioning from the parent block to the child block: (horizontal length of the parent block × vertical length of the parent block) / 4 < threshold
[0400] The threshold may be a value already set in the encoder / decoder or a value signaled from the encoder to the decoder.
[0401] Here, the threshold may be a positive integer. Additionally, the threshold may be at least one value representing the length or size of the block, such as the horizontal length of the block, the vertical length of the block, and the product of the horizontal length and vertical length of the block (the area of the block).
[0402] The threshold may be determined according to at least one coding parameter of the current block / CTB / CTU.
[0403] In Figure 12 when the threshold is 32, in the quadtree partitioning, vertical or horizontal binary tree partitioning, and ternary tree partitioning of the parent block, if the area of at least one child block is less than 32 and each child block is encoded / decoded in the intra block copy skip mode, intra block copy merge mode, intra block copy AMVP mode, or intra block copy AMVR mode, the encoder / decoder may encode / decode the child block by using the block vector candidate list composed of at least one of the block vectors of neighboring blocks (A1, B1, B0, B1). Here, the fixed basic block vector may be derived from the horizontal length and vertical length of the parent block.
[0404] When the horizontal length and the vertical length of the current block are equal to or less than a preset value, a predetermined vector candidate may not be permitted as a block vector candidate.
[0405] See Figure 12 , when the horizontal length and the vertical length of the current block are 4×4 (or the product of the horizontal length and the vertical length of the current block is equal to or less than 16), the block vectors of neighboring blocks may not be permitted as block vector candidates.
[0406] Here, the encoder / decoder may configure a block vector candidate list by using at least one of a history-based block vector, a combined block vector, and a fixed basic block vector. For example, the encoder / decoder may configure the block vector candidate list by using only the history-based block vector, or may configure the block vector candidate list by using both the history-based block vector and the fixed basic block vector.
[0407] In addition, here, an update process for the history-based block vector candidate list may not be performed. For example, when the horizontal length and the vertical length of the current block are 4×4 (or the product of the horizontal length and the vertical length of the current block is equal to or less than 16), the encoded / decoded block vector of the current block may not be added to the history-based block vector candidate list. On the contrary, when the horizontal length and the vertical length of the current block are greater than 4×4 (or the product of the horizontal length and the vertical length of the current block is greater than 16), the encoded / decoded block vector of the current block may be added to the history-based block vector candidate list.
[0408] In addition, the block vector candidate list may be configured by using the history-based block vector candidates that have been encoded / decoded in the upper-level block.
[0409] When the block vector candidate list configured in the upper-level block is shared in at least one lower-level block, the encoder / decoder may restrict the reference block indicated by the block vector of the lower-level block so that the reference block does not lie within the upper-level block.
[0410] As in the Figure 13 example, when the block vector candidate list at the upper-level block position (thick solid line) is shared in at least one lower-level block, the encoder / decoder determines the block vector as valid only when the region / position / sample indicated by the block vector (BV) of the block encoded / decoded in the intra-block copy mode in at least one lower-level block (thin solid line) indicates a region encoded / decoded before the upper-level block.
[0411] In other words, when the region / position / sample indicated by the block vector of the lower-level block includes at least one sample included in the upper-level block, the encoder / decoder may determine the block vector of the lower-level block as unavailable.
[0412] When a block vector candidate list configured in a higher-level block is shared in at least one lower-level block, the encoder / decoder may encode / decode at least one lower-level block by at least one of an intra block copy skip mode and an intra block copy merge mode.
[0413] When a block vector candidate list configured in a higher-level block is shared in at least one lower-level block, at least one lower-level block obtained by partitioning the higher-level block may be encoded / decode in accordance with an intra block copy skip mode or an intra block copy merge mode.
[0414] When a merge candidate list configured in a higher-level block is shared in at least one lower-level block, a lower-level block obtained by partitioning the higher-level block may not be encoded / decode in accordance with an intra block copy skip mode and an intra block copy merge mode. Here, an intra block copy AMVP mode may be applied. However, in this case, the encoder / decoder may determine a block vector as valid only when the block vector indicates a region that has been encoded / decode before the higher-level block. The merge candidate list may represent a list composed of not a block vector but one of the following motion vectors: a spatial motion vector, a temporal motion vector, a history-based motion vector, a combined motion vector, and a zero vector.
[0415] When the horizontal length or the vertical length or both the horizontal length and the vertical length of the current block are less than a threshold or equal to or less than the threshold, the encoder / decoder may not permit at least one of an intra block copy skip mode and an intra block copy merge mode. The threshold may be a positive integer value already set in the encoder / decoder or a value signaled from the encoder to the decoder. Optionally, a lookup table preset in the encoder / decoder may be shared, and an index for the lookup table may be signaled.
[0416] For example, when the horizontal length and the vertical length of the current block are less than 8, the encoder / decoder may not permit at least one of an intra block copy skip mode and an intra block copy merge mode.
[0417] When the product of the horizontal length and the vertical length of the current block is equal to or less than a threshold condition for using a merge candidate list configured in a higher-level block in a lower-level block, the encoder / decoder may not permit at least one of an intra block copy skip mode and an intra block copy merge mode.
[0418] For example, when the threshold for using a merge candidate list configured in a higher-level block in a lower-level block is 32, the encoder / decoder may permit at least one of an intra block copy skip mode and an intra block copy merge mode only when the product of the horizontal length and the vertical length of the current block is greater than 32.
[0419] Conversely, when the product of the horizontal length and the vertical length of the current block is equal to or less than a threshold condition for using the block vector candidate list configured in the upper-level block in the lower-level block, the encoder / decoder may not permit at least one of the skip mode and the merge mode. At least one of the skip mode and the merge mode may represent a motion compensation mode encoded / decoded not by a block vector but by a motion vector of a spatial / temporal neighboring block of the current block.
[0420] For example, when the threshold condition for using the block vector candidate list configured in the upper-level block in the lower-level block is 32, the encoder / decoder may permit at least one of the skip mode and the merge mode based on a motion vector rather than a block vector only when the product of the horizontal length and the vertical length of the current block is greater than 32.
[0421] In the foregoing and / or other embodiments described herein, not permitting a specific mode may mean not using the specific mode as the encoding mode of the current block.
[0422] When at least one of the plurality of blocks obtained by partitioning the upper-level block is smaller than a predetermined threshold, the encoder / decoder may configure a combined merge candidate list configured with the motion vectors and block vectors of neighboring blocks in the upper-level block, and at least one of the plurality of blocks may share the combined merge candidate list.
[0423] The encoder / decoder may configure the combined merge candidate list by using at least one of a motion vector candidate of a neighboring block of the upper-level block, a block vector candidate of a neighboring block of the upper-level block, a temporal motion vector candidate, a history-based motion vector candidate, a history-based block vector candidate, a (0,0) motion vector candidate, and a fixed basic block vector candidate. Further, in the encoder / decoder, at least one of the lower-level blocks may share and use the block vector candidate list configured in the upper-level block.
[0424] For example, when encoding / decoding a corresponding block in the intra block copy skip mode or the intra block copy merge mode, the encoder / decoder may encode / decode the corresponding block by using at least one of the candidates corresponding to block vectors rather than motion vectors in the combined merge candidate list. Here, when encoding / decoding in the intra block copy skip mode or the intra block copy merge mode, the information for identifying the corresponding candidate in the combined merge candidate list may only indicate a block vector candidate.
[0425] For example, when encoding / decoding a corresponding block in skip mode or merge mode, the encoder / decoder may encode / decide the corresponding block by using at least one of the candidates in the combined merge candidate list that corresponds not to the block vector but to the motion vector. Here, when encoding / decoding in skip mode or merge mode, the information for identifying the corresponding candidate in the combined merge candidate list may indicate only the motion vector candidates.
[0426] When sharing the block vector candidate list configured in a higher-level block in at least one lower-level block, the block vectors of the lower-level blocks may not be added to the buffer for deriving history-based block vector candidates.
[0427] In addition, when not sharing the block vector candidate list configured in a higher-level block in at least one lower-level block, the block vectors of the lower-level blocks may be added to the buffer for deriving history-based block vector candidates.
[0428] As another example, when the current block is a luma component block and is encoded / decoded in the intra block copy AMVP mode, the block vector may be derived by the following method.
[0429] Similar to the intra block copy skip mode or intra block copy merge mode, the encoder / decoder may configure a predicted block vector candidate list having up to N predicted block vector candidates. Here, N may be a positive integer. Here, N may represent the maximum number of candidates in the predicted block vector candidate list. The encoder / decoder may use at least one of the candidates included in the configured predicted block vector candidate list as the predicted block vector of the current block. In addition, at least one piece of information (e.g., identifier, index, flag, mvp_10_flag, etc.) for identifying the corresponding predicted candidate in the corresponding predicted block vector candidate list may be entropy encoded / decoded. In addition, the information may be derived based on at least one coding parameter.
[0430] Here, at least one predicted block vector candidate list may be configured, and at least one predicted block vector candidate may be used in the current block. In addition, at least one piece of predicted block vector candidate information may be entropy encoded / decoded.
[0431] Here, when using the predicted block vector candidate in the current block according to the predicted block vector candidate information, the predicted block vector candidate may represent the predicted block vector.
[0432] The encoder may calculate the block vector difference (BVD) between the block vector of the current block and the predicted block vector and entropy encode the BVD.
[0433] The decoder may entropy decode the block vector difference and derive the block vector of the current block by adding the block vector difference to the predicted block vector of the current block.
[0434] In addition, at least one of the following candidates may be included in the predicted block vector candidate list.
[0435] Based on whether the corresponding block is encoded / decoded in the intra block copy mode in the order of A0 and A1 of Figure 11 the encoder / decoder may determine the block vector of the block encoded / decoded in the intra block copy mode as the predicted block vector candidate A.
[0436] Optionally, based on whether the block corresponding to A1 is encoded / decoded in the intra block copy mode, when the block is encoded / decoded in the intra block copy mode, the encoder / decoder may determine the block vector of the block as the predicted block vector candidate A.
[0437] Based on whether the corresponding block is encoded / decoded in the intra block copy mode in the order of B0, B1, and B2 of Figure 11 the encoder / decoder may determine the block vector of the block encoded / decoded in the intra block copy mode as the predicted block vector candidate B.
[0438] Optionally, based on whether the block corresponding to B1 is encoded / decoded in the intra block copy mode, when the block is encoded / decoded in the intra block copy mode, the encoder / decoder may determine the block vector of the block as the predicted block vector candidate B.
[0439] Here, at least one of the predicted block vector candidates thus determined may be included in the predicted block vector candidate list. Here, the predicted block vector candidate thus determined may be the predicted block vector candidate of a neighboring block adjacent to the current block.
[0440] Here, the predetermined priority order for configuring the predicted block vector candidate list may be the order of A and B.
[0441] In addition, the encoder / decoder may store at least one block vector of at least one block encoded / decoded before the current block in a buffer. In addition, the encoder / decoder may determine at least one of the block vectors stored in the buffer as the block vector candidate of the current block. Here, at least one of the predicted block vector candidates thus determined may be included in the predicted block vector candidate list.
[0442] Here, block vectors may be stored in a buffer of a specific size in the coding / decoding order. When the corresponding buffer is full, the encoder / decoder may delete the first stored block vector and then store a new block vector (i.e., the block vector of the most recently coded / decoded block). The priority order for including the block vectors stored in the corresponding buffer in the prediction block vector candidate list may vary according to the order in which the block vectors are stored in the buffer (e.g., the chronological order from the oldest to the most recent or from the most recent to the oldest). For example, the encoder / decoder may include the block vectors in the prediction block vector candidate list in ascending order of the time when the block vectors are stored in the buffer or in descending order of the time when the block vectors are stored in the buffer. Such prediction block vector candidates are referred to as history-based prediction block vector candidates. In other words, the block vectors stored in the corresponding buffer may represent history-based prediction block vector candidates.
[0443] When configuring the prediction block vector candidate list by using at least one of the history-based prediction block vector candidates, the encoder / decoder may determine whether the history-based prediction block vector candidate is available in the current block. Only when the history-based prediction block vector candidate is available, the encoder / decoder may add the history-based prediction block vector candidate to the prediction block vector candidate list. Here, the encoder / decoder may determine whether the corresponding history-based prediction block vector is available based on whether the reference sample (block) at the position indicated by the prediction block vector is available.
[0444] For example, when the region / position indicated by the corresponding history-based prediction block vector candidate includes at least one of the samples included in the current block, the encoder / decoder may determine the corresponding history-based prediction block vector candidate as unavailable.
[0445] For example, when the region / position indicated by the corresponding history-based prediction block vector candidate includes at least one of the regions / positions / samples located outside the boundaries of the picture, sub-picture, stripe, parallel block group, parallel block, and partitioned block, the encoder / decoder may determine the corresponding history-based prediction block vector candidate as unavailable.
[0446] When configuring the prediction block vector candidate list by using at least one of the history-based prediction block vector candidates, a redundancy test may be performed between the corresponding history-based prediction block vector candidate and the prediction block vector candidates in the prediction block vector candidate list. When there is no identical prediction block vector candidate, the encoder / decoder may add the corresponding history-based prediction block vector candidate to the prediction block vector candidate list.
[0447] As another example, when configuring a prediction block vector candidate list by using at least one of the history-based prediction block vector candidates, a redundancy test may be performed between the corresponding history-based prediction block vector candidate and the prediction block vector candidates. When there is no identical prediction block vector candidate, the encoder / decoder may add the corresponding history-based prediction block vector candidate to the prediction block vector candidate list.
[0448] As another example, when configuring a prediction block vector candidate list by using at least one of the history-based prediction block vector candidates, the encoder / decoder may add the corresponding history-based prediction block vector candidate to the prediction block vector candidate list without performing a redundancy test between the corresponding history-based prediction block vector candidate and the prediction block vector candidates in the prediction block vector candidate list. For example, a 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 block vector candidate that is stored first or most recently in the history-based block vector candidate list composed of the history-based block vector candidates.
[0449] When encoding / decoding in units of pictures, slices, sub-pictures, tiles, parallel block groups, parallel blocks, CTUs, CTU rows, and CTU columns, a buffer including the history-based prediction block vector candidates is maintained. Accordingly, the buffer may be used within units of pictures, slices, sub-pictures, tiles, parallel block groups, parallel blocks, CTUs, CTU rows, and CTU columns.
[0450] In addition, the buffer may include at least one piece of encoding information about blocks encoded / decoded in units of pictures, slices, sub-pictures, tiles, parallel block groups, parallel blocks, CTUs, CTU rows, and CTU columns before the current block.
[0451] In addition, when the buffer is configured in units of pictures, slices, sub-pictures, tiles, parallel block groups, parallel blocks, CTUs, CTU rows, and CTU columns, the buffer may be initialized at the start position / region / block / cell of the pictures, slices, sub-pictures, tiles, parallel block groups, parallel blocks, CTUs, CTU rows, and CTU columns. Here, when the buffer is initialized, each block vector existing in the buffer may be deleted. In addition, when the buffer is initialized, each block vector existing in the buffer may be determined as a predetermined value. Here, the predetermined value may represent the values of x and y in the block vector (x, y). For example, x and y may be integer values.
[0452] A combined prediction block vector candidate can be configured by using at least two prediction block vector candidates present in a prediction block vector candidate list. The combined prediction block vector candidate can be added to the prediction block vector candidate list. Here, the combined block vector candidate can respectively have statistical values for the x - component and y - component of at least two block vectors among the block vector candidates present in the block vector candidate list. Here, when configuring the combined prediction block vector candidate, the encoder / decoder may not use a history - based prediction vector candidate. Here, when configuring the combined prediction block vector candidate, the encoder / decoder may not use at least one of the prediction block vector candidates of neighboring blocks adjacent to the current block. Here, the encoder / decoder can determine whether a combined prediction block vector candidate composed of prediction block vector candidates is available in the current block. Only when the combined prediction block vector candidate is available can the encoder / decoder determine the combined block vector candidate. Here, the encoder / decoder can determine whether a prediction block vector is available based on whether a reference sample (block) at the position indicated by the prediction block vector is available.
[0453] For example, when the region / position indicated by the corresponding combined prediction block vector candidate includes at least one of the samples included in the current block, the encoder / decoder can determine the corresponding combined prediction block vector candidate as unavailable.
[0454] For example, when the region / position indicated by the corresponding combined prediction block vector candidate includes at least one of the regions / positions / samples located outside the boundaries of a picture, sub - picture, slice, parallel block group, parallel block, and partitioned block, the encoder / decoder can determine the combined prediction block vector candidate as unavailable.
[0455] When the current luminance component block has a horizontal length W and a vertical length H, (-(W << n)+a,-(H << n)+b), (-(W << n)+c,0), or (0,-(H << n)+d) can be prediction block vector candidates included in the prediction block vector candidate list. Here, n can be a positive integer, and a, b, c, and d can have integer values. This can be referred to as a fixed basic prediction block vector candidate. The encoder / decoder can add the fixed basic prediction block vector candidate to the prediction block vector candidate list.
[0456] The encoder / decoder can configure the prediction block vector candidate list according to a predetermined order by using at least one of the prediction block vector candidates of neighboring blocks adjacent to the current block, the history - based prediction block vector candidate, the combined prediction block vector candidate, and the fixed basic prediction block vector candidate.
[0457] For example, the order of configuring the prediction block vector candidate list may be set in the order of the prediction block vector candidates of the neighboring blocks adjacent to the current block first, the history-based prediction block vector candidates, the combined prediction block vector candidates, and the fixed basic prediction block vector candidates.
[0458] For example, the fixed basic prediction block vector may be configured in the following order until the number of candidates in the prediction block vector candidate list reaches the maximum number of candidates in the prediction block vector candidate list.
[0459] 1. (-(W<<1), 0)
[0460] 2. (0, -(H<<1))
[0461] 3. (-(W<<1)-1, 0)
[0462] 4. (0, -(H<<1)-1)
[0463] 5. (-(W<<1)-2, 0)
[0464] 6. (0, -(H<<1)-2)
[0465] 7. (-(W<<1)-3, 0)
[0466] 8. (0, -(H<<1)-3)
[0467] 9. (-(W<<1)-4, 0)
[0468] 10. (0, -(H<<1)-4)
[0469] As another example, the fixed basic prediction block vector may be the (0, 0) vector. The encoder / decoder may configure the prediction block vector candidate list with the maximum number of candidates by adding the fixed basic prediction block vector to the prediction block vector candidate list until the number of candidates in the prediction block vector candidate list reaches the maximum number of candidates in the prediction block vector candidate list.
[0470] When configuring the prediction block vector candidate list, the maximum number of prediction block vector candidates of the neighboring blocks adjacent to the current block that can be included in the prediction block vector candidate list may be the maximum number of prediction block vector candidates (N) or (N - m). Here, N may be a positive integer, and m may be a positive integer. In addition, N may have a value greater than m.
[0471] When configuring the prediction block vector candidate list, the maximum number of history-based prediction block vector candidates that can be included in the prediction block vector candidate list can be the maximum number of prediction block vector candidates (N) or (N - m). Here, N can be a positive integer, and m can be a positive integer. In addition, N can have a value larger than m.
[0472] When configuring the prediction block vector candidate list, the maximum number of combined prediction block vector candidates that can be included in the prediction block vector candidate list can be the maximum number of prediction block vector candidates (N) or (N - m). Here, N can be a positive integer, and m can be a positive integer. In addition, N can have a value larger than m.
[0473] When configuring the prediction block vector candidate list, the maximum number of fixed basic prediction block vector candidates that can be included in the prediction block vector candidate list can be the maximum number of prediction block vector candidates (N) or (N - m). Here, N can be a positive integer, and m can be a positive integer. In addition, N can have a value larger than m.
[0474] The maximum number of candidates in the prediction block vector candidate list can be a value already set in the encoder / decoder, or a value signaled from the encoder to the decoder.
[0475] The prediction block vector candidate list can have the same meaning as the block vector candidate list, and the prediction block vector candidate can have the same meaning as the block vector candidate.
[0476] The prediction block vector candidate can be derived according to at least one coding parameter of the current block / CTB / CTU.
[0477] The prediction block vector candidate can be added to the prediction block vector candidate list according to at least one coding parameter of the current block / CTB / CTU.
[0478] As another example, when the current block is a luma component block and is encoded / decoded in the intra block copy skip mode, intra block copy merge mode, intra block copy AMVP mode, or intra block copy AMVR mode, the method for deriving the block vector can be as follows.
[0479] The block vector candidate list can consist of up to N candidates. Here, N can be a positive integer. Here, N can represent the maximum number of candidates in the block vector candidate list. N can be derived according to at least one coding parameter of the current block / CTB / CTU.
[0480] Information indicating the maximum number of candidates in the merge candidate list for inter prediction modes can be encoded / decoded in a higher-level parameter set or header (such as a Sequence Parameter Set (SPS), a Picture Parameter Set (PPS), an Adaptive Parameter Set (APS), a picture header, a slice header, a strip header, a parallel block group header, and a parallel block header). Additionally, information indicating the maximum number of candidates in the block vector candidate list can be encoded / decoded in a higher-level parameter set or header (such as a Sequence Parameter Set (SPS), a Picture Parameter Set (PPS), an Adaptive Parameter Set (APS), a picture header, a slice header, a strip header, a parallel block group header, and a parallel block header).
[0481] The maximum number of candidates in the block vector candidate list can be determined based on the maximum number of candidates in the merge candidate list for inter prediction modes.
[0482] For example, information indicating the maximum number of candidates in the merge candidate list for inter prediction modes (e.g., six_minus_max_num_merge_cand) can be entropy encoded / decoded, and the maximum number of candidates in the merge candidate list for inter prediction modes (MaxNumMergeCand) can be derived as follows. The derived maximum number (MaxNumMergeCand) can be defined as the maximum number of candidates in the block vector candidate list (MaxNumIBCCand).
[0483] The maximum number of candidates in the merge candidate list for inter prediction modes (MaxNumMergeCand) = N - six_minus_max_num_merge_cand
[0484] MaxNumMergeCand can have values from 1 to N. Here, N can be a positive integer. For example, MaxNumMergeCand can be 6.
[0485] The maximum number of candidates in the block vector candidate list (MaxNumIBCCand) = maxNumErgecand
[0486] As another example, information indicating the maximum number of candidates in the merge candidate list for inter prediction modes (e.g., six_minus_max_num_merge_cand) can be entropy encoded / decoded, and the maximum number of candidates in the merge candidate list for inter prediction modes (MaxNumMergeCand) can be derived as follows. Based on the derived maximum number (MaxNumMergeCand), the maximum number of candidates in the block vector candidate list (MaxNumIBCCand) can be defined.
[0487] The maximum number of candidates (MaxNumMergeCand) in the merge candidate list for the inter prediction mode = N - six_minus_max_num_merge_cand
[0488] MaxNumMergeCand can have values from 1 to N. Here, N can be a positive integer. For example, MaxNumMergeCand can be 6.
[0489] The maximum number of candidates (MaxNumIBCCand) in the block vector candidate list = Max(M, maxNumErgeCand)
[0490] Here, M can be a positive integer. For example, M can be 2.
[0491] As another example, information indicating the maximum number of candidates (e.g., six_minus_max_num_merge_cand) in the merge candidate list for the inter prediction mode can be entropy - coded / decoded, and the maximum number of candidates (MaxNumMergeCand) in the merge candidate list for the inter prediction mode can be derived as follows. Based on the derived maximum number (MaxNumMergeCand) and the coding mode of the current block, the maximum number of candidates (MaxNumMergeCand) in the block vector candidate list can be defined.
[0492] The maximum number of candidates (MaxNumMergeCand) in the merge candidate list for the inter prediction mode = N - six_minus_max_num_merge_cand
[0493] MaxNumMergeCand can have values from 1 to N. Here, N can be a positive integer. For example, MaxNumMergeCand can be 6.
[0494] When the current block is in the intra - block copy skip mode or the intra - block copy merge mode,
[0495] The maximum number of candidates (MaxNumIBCCand) in the block vector candidate list = maxNumErgecand
[0496] When the current block is in the intra - block copy AMVP mode,
[0497] The maximum number of candidates (MaxNumIBCCand) in the block vector candidate list = Max(M, maxNumErgeCand)
[0498] Here, M can be a positive integer. For example, M can be 2.
[0499] For example, when M = 2 and MaxNumMergeCand = 1, the maximum number of candidates in the block vector candidate list for the intra block copy skip mode or the intra block copy merge mode can be determined as 1, and the maximum number of candidates in the block vector candidate list for the intra block copy AMVP mode can be determined as 2.
[0500] As another example, information indicating the maximum number of candidates in the merge candidate list for the inter prediction mode (e.g., six_minus_max_num_merge_cand) can be entropy encoded / decoded, and the maximum number of candidates (MaxNumMergeCand) in the merge candidate list for the inter prediction mode can be derived as follows. Based on the derived maximum number (MaxNumMergeCand) and the coding mode of the current block, the maximum number of candidates (MaxNumMergeCand) in the block vector candidate list can be defined.
[0501] The maximum number of candidates (MaxNumMergeCand) in the merge candidate list for the inter prediction mode = N - six_minus_max_num_merge_cand
[0502] MaxNumMergeCand can have values from 1 to N. Here, N can be a positive integer. For example, MaxNumMergeCand can be 6.
[0503] When the current block is in the intra block copy skip mode or the intra block copy merge mode,
[0504] The maximum number of candidates (MaxNumIBCCand) in the block vector candidate list = maxNumErgecand
[0505] When the current block is in the intra block copy AMVP mode,
[0506] The maximum number of candidates (MaxNumIBCCand) in the block vector candidate list = M
[0507] Here, M can be a positive integer. For example, when the current block is in the intra block copy AMVP mode, the maximum number of candidates in the block vector candidate list can be defined as 2.
[0508] For example, when MaxNumMergeCand = 6, the maximum number of candidates in the block vector candidate list for the intra block copy skip mode or the intra block copy merge mode can be determined as 6, and the maximum number of candidates in the block vector candidate list for the intra block copy AMVP mode can be determined as 2.
[0509] Entropy coding / decoding can be performed on information indicating the maximum number of candidates in the block vector candidate list. The information indicating the maximum number of candidates in the block vector candidate list can represent the maximum block vector candidate number information of the block vector candidate list.
[0510] As another example, entropy coding / decoding can be performed on information indicating the maximum number of candidates in the block vector candidate list (e.g., six_minus_max_num_ibc_cand), and the maximum number of candidates (MaxNumIBCCand) in the block vector candidate list can be derived as follows.
[0511] The maximum number of candidates (MaxNumIBCCand) in the block vector candidate list = N - six_minus_max_num_ibc_cand
[0512] MaxNumIBCCand can have values ranging from 0 to N. Here, N can be a positive integer. For example, MaxNumIBCCand can be 6.
[0513] In addition, the information indicating the maximum number of candidates in the block vector candidate list (e.g., six_minus_max_num_ibc_cand) can have values ranging from 0 to N. Here, N can be a positive integer. For example, N can be 5.
[0514] Here, for ease of description, the names max_num_ibcCand and six_minus_max_num_ibc_cand are arbitrarily given. Information with other names can be used.
[0515] As another example, entropy coding / decoding can be performed on information indicating the maximum number of candidates in the block vector candidate list (e.g., max_num_merge_cand_minus_max_num_ibc_cand), and the maximum number of candidates (MaxNumIBCCand) in the block vector candidate list can be derived as follows.
[0516] The maximum number of candidates (MaxNumIBCCand) in the block vector candidate list = maxNumMergeCand - max_num_merge_cand_minus_max_num_ibc_cand
[0517] MaxNumIBCCand can have values ranging from 2 to maxNumErgecAnd.
[0518] Information indicating the maximum number of candidates in the block vector candidate list (at least one of six_minus_max_num_ibc_cand and max_num_merge_cand_minus_max_num_ibc_cand) can be entropy-coded / decoded only in a higher-level parameter set (SPS, PPS, APS, etc.) or header (picture header, sub-picture header, slice header, parallel block header, etc.) in the bitstream when it indicates the use of the intra block copy mode. In other words, the intra block copy mode enable flag can be entropy-coded / decoded.
[0519] For example, it can be entropy-coded / decoded only when the sps_ibc_enabled_flag entropy-coded / decoded in the SPS is the second value 1. Additionally, when the sps_ibc_enabled_flag is the first value 0, at least one piece of information indicating the maximum number of candidates in the block vector candidate list can be inferred as 0. The sps_ibc_enabled_flag can be an example of the intra block copy mode enable flag.
[0520] As another example, information indicating the maximum number of candidates in the block vector candidate list (e.g., pic_six_minus_max_num_ibc_merge_cand) can be encoded / decoded, and based on the information indicating the maximum number of candidates in the block vector candidate list, the maximum number of candidates (MaxNumIBCCand) in the block vector candidate list can be derived as follows.
[0521] The maximum number of candidates (MaxNumIBCCand) in the block vector candidate list = 6 - pic_six_minus_max_num_ibc_merge_cand
[0522] Here, MaxNumIBCCand can have values from 1 to N. Optionally, MaxNumIBCCand can have values from 0 to N. Here, N can be a positive integer. For example, N can be 6. Additionally, when MaxNumIBCCand = 0, this can indicate that the intra block copy mode is not permitted in the picture / sub-picture / slice / parallel block.
[0523] At least one of N and M can be derived according to at least one coding parameter of the current block / CTB / CTU.
[0524] Alternatively, for example, the encoding / decoding of information indicating the maximum admissible number of the indicated block vector candidate list (e.g., sps_six_minus_max_num_ibc_merge_cand, pps_six_minus_max_num_ibc_merge_cand, pic_six_minus_max_num_ibc_merge_cand, etc.) can be skipped based on the values encoded / decoded in the upper-level parameter set or header (such as video parameter set, sequence parameter set, and picture parameter set). Additionally, based on the values encoded / decoded in the upper-level parameter set or header, the values of the corresponding information can be inferred. The information indicating the maximum admissible number of the indicated block vector candidate list can represent the information indicating the maximum number of candidates in the indicated block vector candidate list.
[0525] Figure 29 is a diagram showing the derivation process of the information indicating the maximum admissible number of the indicated block vector candidate list according to an embodiment of the present invention. Refer to Figure 29 , according to the value of the information encoded / decoded in the picture parameter set referenced by the picture header (e.g., pps_six_minus_max_num_ibc_merge_cand_plus1), the information indicating the maximum admissible number of block vector candidates in the indicated block vector candidate list (e.g., pic_six_minus_max_num_ibc_merge_cand) can be encoded / decoded or inferred in the picture header. Additionally, when the information (e.g., pic_six_minus_max_num_ibc_merge_cand) does not exist, the information can be inferred based on the information encoded / decoded in the upper-level parameter set or header (e.g., pps_six_minus_max_num_ibc_merge_cand_plus1).
[0526] For example, when the information encoded / decoded in the picture parameter set (e.g., pps_six_minus_max_num_ibc_merge_cand_plus1) has a value of 0, this can indicate that the information indicating the maximum admissible number of block vector candidates in the indicated block vector candidate list (e.g., pic_six_minus_max_num_ibc_merge_cand) exists in the picture header referencing the picture parameter set.
[0527] In addition, for example, when the information encoded / decoded in the picture parameter set (e.g., pps_six_minus_max_num_ibc_merge_cand_plus1) has a value greater than 0, this may indicate that the information (e.g., pic_six_minus_max_num_ibc_merge_cand) indicating the maximum allowable number of block vector candidates in the block vector candidate list does not exist in the picture header that references the picture parameter set. Here, the information (e.g., pic_six_minus_max_num_ibc_merge_cand) can be inferred as the information (e.g., pps_six_minus_max_num_ibc_merge_cand_plus1) encoded / decoded in the picture parameter set minus 1.
[0528] Refer to Figure 29 , information (e.g., constant_slice_header_params_enabled_flag) indicating whether there is predetermined information encoded / decoded in the picture header can be encoded / decoded in the picture parameter set.
[0529] For example, when other information encoded / decoded in the picture parameter set (e.g., constant_slice_header_params_enabled_flag) has a first value, the information encoded / decoded in the picture parameter set (e.g., pps_six_minus_max_num_ibc_merge_cand_plus1) can be entropy encoded / decoded. On the other hand, when other information encoded / decoded in the picture parameter set (e.g., constant_slice_header_params_enabled_flag) has a second value, the information encoded / decoded in the picture parameter set (e.g., pps_six_minus_max_num_ibc_merge_cand_plus1) may not be entropy encoded / decoded but be inferred as 0. Here, the first value can be 1 and the second value can be 0.
[0530] In addition, for example, when the conditions described below are met, the information encoded / decoded in the picture parameter set (e.g., pps_six_minus_max_num_ibc_merge_cand_plus1) can be entropy encoded / decoded.
[0531] Condition: The information encoded / decoded in the picture parameter set (e.g., constant_slice_header_params_enabled_flag) has a first value, and the information encoded / decoded in the sequence parameter set (e.g., sps_ibc_enabled_flag) has a first value.
[0532] In addition, for example, when the conditions described below are satisfied, the information encoded / decoded in the picture parameter set (e.g., pps_max_num_merge_cand_minus1_max_num_triangle_cand_plus1) can be entropy encoded / decoded.
[0533] Condition: The information encoded / decoded in the picture parameter set (e.g., constant_slice_header_params_enabled_flag) has a first value, and the information encoded / decoded in the sequence parameter set (e.g., sps_triangle_enabled_flag) has a first value.
[0534] In addition, for example, when the conditions described below are satisfied, the information encoded / decoded in the picture parameter set (e.g., pps_collocated_from_l0_idc) can be entropy encoded / decoded.
[0535] Condition: The information encoded / decoded in the picture parameter set (e.g., constant_slice_header_params_enabled_flag) has a first value, and the information encoded / decoded in the sequence parameter set (e.g., sps_temporal_mvp_enabled_flag) has a first value.
[0536] In addition, the first value can be 1 and the second value can be 0.
[0537] The encoder / decoder can determine the maximum number of candidates in the block vector candidate list as a fixed value N. N can have a positive integer value. N can be derived based on at least one coding parameter of the current block / CTB / CTU.
[0538] For example, the maximum number of candidates in the block vector candidate list can be 2.
[0539] For example, the maximum number of candidates in the block vector candidate list can be 5.
[0540] For example, the maximum number of candidates in the block vector candidate list can be 6.
[0541] For the maximum number of candidates in the block vector candidate list, a fixed value N predefined in the encoder / decoder can be used. N can be a positive integer, and the encoder / decoder can use different values of N according to the coding mode of the current block. Here, the coding mode of the current block can represent the intra block copy mode. Additionally, the encoder / decoder can use different values of N according to the intra block copy skip mode, intra block copy merge mode, and intra block copy AMVP mode of the current block. N can be derived based on at least one coding parameter of the current block / CTB / CTU.
[0542] For example, when the current block is in the intra block copy skip mode or intra block copy merge mode, the predefined value of N can be 6.
[0543] For example, when the current block is in the intra block copy AMVP mode, the predefined value of N can be 2.
[0544] Additionally, at least one of the following candidates can be included in the block vector candidate list.
[0545] As in the Figure 11 example, the encoder / decoder can determine the block vector candidate of the current block X by deriving the block vector in at least one of the block A1 adjacent to the left of the current block X and the block B1 adjacent to the top of the current block X. Here, at least one of the thus-derived block vectors can be included in the block vector candidate list. Here, the thus-derived block vector can be the block vector candidate of the neighboring block adjacent to the current block.
[0546] For the blocks included in at least one of the positions of A1 and B1, the encoder / decoder can determine whether a block vector exists in each block according to a predetermined priority order (in other words, determine whether the corresponding block is encoded / decoded using the intra block copy mode or determine whether the corresponding block is in the intra block copy mode). Additionally, when a block vector exists, the encoder / decoder can use the block vector of the corresponding block as the block vector candidate. Here, the predetermined priority order for configuring the block vector candidate list can be the order of A1 and B1.
[0547] When configuring the block vector candidate list according to the predetermined priority order, the encoder / decoder can perform a redundancy test between the block vector candidates existing in the block vector candidate list and the block vector candidates newly added to the block vector candidate list. For example, when the block vector candidate newly added to the block vector candidate list overlaps with the block vector candidates existing in the block vector candidate list, the encoder / decoder can not add the overlapping block vector candidate to the block vector candidate list.
[0548] For example, when the block vector candidate list is configured in the order of A1 and B1, the encoder / decoder can perform a redundancy test between block B1 and block A1. Only when block B1 has a block vector different from the block vector of block A1 can the encoder / decoder add the block vector of block B1 to the block vector candidate list. The redundancy test can be performed only when there is a block vector in the corresponding block.
[0549] In addition, when there is at least one block vector in at least one of the blocks included in at least one of positions A1 and B1, the encoder / decoder can determine whether the block vector of the block is available in the current block. Only when the block vector is available can the encoder / decoder determine the block vector of the neighboring block as a block vector candidate. When the block vector of the corresponding block is not available, the encoder / decoder may not use the block vector as a block vector candidate. Here, the encoder / decoder can determine whether the block vector is available based on whether the reference sample (block) at the position indicated by the block vector is available.
[0550] For example, when the region / position indicated by the corresponding block vector includes at least one of the samples included in the current block, the encoder / decoder may determine the corresponding block vector as unavailable.
[0551] For example, when the region / position indicated by the corresponding block vector includes at least one of the regions / positions / samples located outside the boundaries of the picture, sub-picture, slice, parallel block group, parallel block, and partitioned block, the encoder / decoder may determine the corresponding block vector as unavailable.
[0552] When the number of candidates in the block vector candidate list is less than the maximum number of candidates in the block vector candidate list, the encoder / decoder adds at least one block vector candidate from the buffer to the block vector candidate list, where the buffer stores at least one of the block vectors of the blocks encoded / decoded before the current block. The encoder / decoder can store at least one block vector of at least one of the blocks encoded / decoded before the current block in the buffer. At least one of the block vectors stored in the buffer can be determined as a block vector candidate for the current block. Here, at least one of the block vector candidates thus determined can be included in the block vector candidate list.
[0553] Here, the block vectors can be stored in a buffer of a specific size in the coding / decoding order. When the corresponding buffer is full, the encoder / decoder can delete the first stored block vector and then store the new block vector (i.e., the block vector of the most recently coded / decoded block) in the buffer. The priority order of including the block vectors stored in the corresponding buffer in the block vector candidate list can be different according to the order of storing the block vectors in the buffer (e.g., the chronological order from the oldest to the most recent or from the most recent to the oldest). For example, the encoder / decoder can include the block vectors in the block vector candidate list according to the ascending chronological order of storing the block vectors in the buffer. Optionally, the encoder / decoder can include the block vectors in the block vector candidate list according to the descending chronological order of storing the block vectors in the buffer. Such block vector candidates are called history-based block vector candidates. In other words, the block vectors stored in the buffer can represent history-based block vector candidates.
[0554] When configuring the block vector candidate list by using at least one of the history-based block vector candidates, the encoder / decoder can add the corresponding history-based block vector candidate to the block vector candidate list only when the corresponding history-based block vector candidate is available in the current block. Here, it can be determined whether the corresponding history-based block vector is available according to whether the reference sample (block) at the position indicated by the block vector is available.
[0555] For example, when the region / position indicated by the corresponding history-based block vector includes at least one of the samples included in the current block, the corresponding history-based block vector can be determined as unavailable.
[0556] For example, when the region / position indicated by the corresponding history-based block vector includes at least one of the regions / positions / samples located outside the boundaries of the picture, sub-picture, stripe, parallel block group, parallel block, and partitioned block, the encoder / decoder can determine the corresponding history-based block vector as unavailable.
[0557] When the number of candidates in the block vector candidate list is less than the maximum number of candidates in the block vector candidate list and at least one block vector exists in the buffer storing the block vectors of the blocks coded / decoded before the current block, the encoder / decoder can add the history-based block vector candidates to the block vector candidate list until the number of candidates in the block vector candidate list reaches the maximum number of candidates in the block vector candidate list.
[0558] When configuring the block vector candidate list by using at least one history-based block vector candidate, a redundancy test can be performed between the corresponding history-based block vector candidate and the block vector candidates in the block vector candidate list. When there is no identical block vector, the encoder / decoder can add the history-based block vector candidate to the block vector candidate list.
[0559] As another example, when configuring the block vector candidate list by using at least one of the history-based block vector candidates, a redundancy test can be performed between the corresponding history-based block vector candidate and the block vector candidates. When there is no identical block vector, the encoder / decoder can add the history-based block vector candidate to the block vector candidate list.
[0560] For example, the encoder / decoder can perform a redundancy test between the history-based block vector candidate and the block vectors of block A1 and B1, which are neighboring blocks adjacent to the current block.
[0561] As another example, the encoder / decoder can perform a redundancy test using the block vectors of block A1 and B1 only for the history-based block vector candidate and the first history-based block vector candidate.
[0562] As another example, the encoder / decoder can perform a redundancy test using the block vectors of block A1 and B1 only for the history-based block vector candidate and the second history-based block vector candidate.
[0563] As another example, for all history-based block vector candidates, the encoder / decoder can perform a redundancy test using the block vectors of block A1 and B1, which are neighboring blocks adjacent to the current block.
[0564] Here, the first candidate can represent the block vector candidate that was most recently stored in the history-based block vector candidate list composed of history-based block vector candidates.
[0565] Here, when performing the redundancy test and there is no identical block vector, the encoder / decoder can add the history-based block vector candidate to the block vector candidate list.
[0566] As another example, when configuring the block vector candidate list by using at least one of the history-based block vector candidates, the encoder / decoder can add the history-based block vector candidate to the block vector candidate list without performing a redundancy test between the history-based block vector candidate and the block vector candidates in the block vector candidate list or between the block vector candidates.
[0567] When encoding / decoding in units of pictures, slices, sub-pictures, tiles, parallel tile groups, parallel tiles, CTUs, CTU rows, and CTU columns, a buffer including history-based block vector candidates is maintained. Thus, the buffer can be used within units of pictures, slices, sub-pictures, tiles, parallel tile groups, parallel tiles, CTUs, CTU rows, and CTU columns.
[0568] In addition, the buffer can include at least one piece of coding information about blocks encoded / decoded before the current block in units of pictures, slices, sub-pictures, tiles, parallel tile groups, parallel tiles, CTUs, CTU rows, and CTU columns.
[0569] In addition, when the buffer is configured in units of pictures, slices, sub-pictures, tiles, parallel tile groups, parallel tiles, CTUs, CTU rows, and CTU columns, the buffer can be initialized at the start position / region / block / cell of the picture, slice, sub-picture, tile, parallel tile group, parallel tile, CTU, CTU row, and CTU column. Here, when the buffer is initialized, each block vector existing in the buffer can be deleted. In addition, when the buffer is initialized, each block vector existing in the buffer can be determined as a predetermined value. Here, the predetermined value can represent the values of x and y in the block vector (x, y). For example, x and y can be integer values.
[0570] The encoder / decoder can configure a combined prediction block vector candidate by using at least two prediction block vector candidates existing in the prediction block vector candidate list. The combined prediction block vector candidate can be added to the prediction block vector candidate list. Here, the combined block vector candidate can respectively have statistical values for the x component and the y component of at least two block vectors among the block vector candidates existing in the block vector candidate list. Here, when configuring the combined prediction block vector candidate, the encoder / decoder can not use the history-based prediction vector candidate. Here, when configuring the combined prediction block vector candidate, the encoder / decoder can not use at least one of the prediction block vector candidates of neighboring blocks adjacent to the current block. Here, only when the combined prediction block vector candidate composed of the prediction block vector candidates is available in the current block, the encoder / decoder can determine the combined prediction block vector candidate. Here, it can be determined whether the prediction block vector is available according to whether the reference sample (block) at the position indicated by the prediction block vector is available.
[0571] For example, when the region / position indicated by the corresponding combined prediction block vector candidate includes at least one sample among the samples included in the current block, the encoder / decoder can determine the corresponding combined prediction block vector candidate as unavailable.
[0572] For example, when the region / position indicated by the corresponding combined prediction block vector candidate includes at least one of the regions / positions / samples located outside the boundaries of the picture, sub-picture, stripe, parallel block group, parallel block, and block, the encoder / decoder may determine the combined prediction block vector candidate as unavailable.
[0573] When the number of candidates in the block vector candidate list is less than the maximum number of candidates in the block vector candidate list, the encoder / decoder may add the fixed basic block vector (0,0) to the block vector candidate list until the number of candidates in the block vector candidate list reaches the maximum vector of candidates in the block vector candidate list. When the current block is in the intra block copy skip mode and the intra block copy merge mode, the operation of adding the fixed basic block vector to the block vector candidate list can be performed.
[0574] As another example, the fixed basic block vector candidates may be configured in the following order until the number of candidates in the block vector candidate list reaches the maximum number of candidates in the block vector candidate list.
[0575] 1. (-(W<<1),0)
[0576] 2. (0,-(H<<1))
[0577] 3. (-(W<<1)-1,0)
[0578] 4. (0,-(H<<1)-1)
[0579] 5. (-(W<<1)-2,0)
[0580] 6. (0,-(H<<1)-2)
[0581] 7. (-(W<<1)-3,0)
[0582] 8. (0,-(H<<1)-3)
[0583] 9. (-(W<<1)-4,0)
[0584] 10. (0,-(H<<1)-4)
[0585] As another example, when the current block is in the intra block copy AMVP mode and the number of candidates in the block vector candidate list is less than the maximum number of candidates in the block vector candidate list (the maximum number (N) of predefined AMVP candidates), the encoder / decoder may add the fixed basic block vector (0,0) to the block vector candidate list until the number of candidates in the block vector candidate list reaches the maximum number (N) of predefined AMVP candidates. Here, N may be a positive integer. For example, it may be 2.
[0586] For example, when the current block is in the Intra Block Copy AMVP mode, the maximum number of candidates in the block vector candidate list is defined to be the same as the maximum number of candidates (MaxNumMergeCand) in the merge candidate list for the Inter prediction mode, and when the maximum vector (MaxNumMergeCand) of candidates in the merge candidate list for the Inter prediction mode is 1 (i.e., the number of candidates in the block vector candidate list is less than the predefined maximum number of AMVP candidates (2)), the encoder / decoder may add the fixed basic block vector (0,0) to the block vector candidate list to satisfy the maximum number of AMVP candidates (2).
[0587] The encoder / decoder may configure the block vector candidate list according to a predetermined order by using at least one of the block vector candidates of neighboring blocks adjacent to the current block, history-based block vector candidates, combined block vector candidates, and fixed basic block vector candidates. For example, the order of configuring the block vector candidate list may be set in the order of the block vector candidates of neighboring blocks adjacent to the current block, history-based block vector candidates, combined block vector candidates, and fixed basic block vector candidates.
[0588] When configuring the block vector candidate list, the maximum number of block vector candidates of neighboring blocks adjacent to the current block that can be included in the block vector candidate list may be the maximum number of block vector candidates (N) or may be (N - m). Here, N may be a positive integer, and m may be a positive integer. In addition, N may have a value larger than m.
[0589] When configuring the block vector candidate list, the maximum number of history-based block vector candidates that can be included in the block vector candidate list may be the maximum number of block vector candidates (N) or may be (N - m). Here, N may be a positive integer, and m may be a positive integer. In addition, N may have a value larger than m.
[0590] When configuring the block vector candidate list, the maximum number of fixed basic block vector candidates that can be included in the block vector candidate list may be the maximum number of block vector candidates (N) or may be (N - m). Here, N may be a positive integer, and m may be a positive integer. In addition, N may have a value larger than m.
[0591] The block vector candidates may be derived according to at least one coding parameter of the current block / CTB / CTU.
[0592] The block vector candidates may be added to the block vector candidate list according to at least one coding parameter of the current block / CTB / CTU.
[0593] At least one block vector candidate information (e.g., identifier, index, flag, merge_idx, etc.) for identifying corresponding candidates in the block vector candidate list configured as above can be entropy-coded / decoded and derived according to at least one coding parameter.
[0594] For example, when the current block corresponds to the intra block copy skip mode or the intra block copy merge mode, the encoder / decoder can identify the corresponding block vector candidate based on the merge index (e.g., merge_idx) information that is the block vector candidate information in the current block. Herein, the merge index can represent the merge index of the block vector. Additionally, the merge index can be information that is encoded / decoded / inferred.
[0595] As in Figure 30 In the example of, when the current block corresponds to the intra block copy AMVP mode, the encoder / decoder can identify the corresponding block vector candidate based on the L0 motion prediction flag (e.g., mvp_l0_flag) information that is the block vector candidate information. Here, the L0 motion prediction flag can represent the L0 block vector prediction flag. Additionally, the L0 motion prediction flag can be information that is encoded / decoded / inferred.
[0596] When the maximum number of candidates in the block vector candidate list is 1, the L0 motion prediction flag can be not entropy-coded / decoded but inferred as 0.
[0597] For example, when MaxNumMergeCand indicates the maximum number of candidates in the block vector candidate list and MaxNumMergeCand = 1, the L0 motion prediction flag can be not entropy-coded / decoded but inferred as 0. In other words, only when MaxNumMergeCand is greater than 1, the encoder / decoder can entropy-code / decode the L0 motion prediction flag. Here, for ease of description, the name MaxNumIBCCand is arbitrarily given. Other names can be used, such as MaxNumIbcMergeCand and MaxNumIBCCand. In other words, MaxNumIbcMergeCand can be used instead of MaxNumMergeCand. For example, when MaxNumIbcMergeCand is greater than 1, the information (e.g., mvp_10_flag) indicating the index of the L0 motion vector predictor can be entropy-coded / decoded. Otherwise (when MaxNumIbcMergeCand is equal to or less than 1), mvp_l0_flag can be not entropy-coded / decoded but inferred as 0. This information can be a flag.
[0598] Here, the L0 motion vector prediction flag can represent the information indicating the index of the L0 motion vector predictor.
[0599] As in Figure 31 the example of Figure 31 , when the maximum number (MaxNumIBCCand) of candidates in the block vector candidate list is greater than 1 and the current block corresponds to the intra block copy skip mode or the intra block copy merge mode, the encoder / decoder may always perform entropy coding / decoding on the merge index information regardless of the maximum number of candidates in the block vector candidate list.
[0600] As another example, when the current block corresponds to the intra block copy skip mode or the intra block copy merge mode and the maximum number of candidates (e.g., MaxNumIbcMergeCand) in the block vector candidate list is greater than 1, entropy coding / decoding may be performed on the merge index information (e.g., merge_idx).
[0601] For example, when the current block is in the intra block copy skip mode or the intra block copy merge mode, the encoder / decoder uses the block vector candidate identified by the block vector candidate information in the block vector candidate list as the block vector of the current block.
[0602] As another example, when the current block is in the intra block copy AMVP mode, the encoder / decoder may add the entropy-coded / decoded block vector difference to the predicted block vector identified by the block vector candidate information in the block vector candidate list, and may use the sum as the block vector of the current block.
[0603] As in Figure 30 the example of Figure 30 , according to the value of the entropy-coded / decoded amvr_precision_flag, rounding as described in the following formula may be performed on the identified predicted block vectors (mvX[0] and mvX[1]).
[0604] Here, according to the value of amvr_precision_flag, the resolution of the block vector difference and the resolution of the predicted block vector can be determined.
[0605] Here, when amvr_precision_flag is the first value 0, the block vector may have a size of N integer sample units.
[0606] In addition, when amvr_precision_flag is the second value 1, the block vector may have a size of M integer sample units.
[0607] Here, N and M may be positive integers. For example, N may be 1 and M may be 4. In addition, N may be less than M, and M may be less than N.
[0608] offset = (rightShift == 0)? 0 : (1 << (rightShift - 1))
[0609] mvX[0] = ((mvX[0] + offset - (mvX[0] >= 0)) >> rightShift) << leftShift
[0610] mvX[1] = ((mvX[0] + offset - (mvX[1] >= 0)) >> rightShift) << leftShift
[0611] When amvr_precision_flag is the first value 0 (the block vector has a size of 1 integer sample unit), rightShift = 4 and leftShift = 4.
[0612] When amvr_precision_flag is the second value 1 (the block vector has a size of 4 integer sample units), rightShift = 6 and leftShift = 6
[0613] At least one of amvr_precision_flag, the resolution of the block vector difference, and the resolution of the predicted block vector can be derived based on at least one coding parameter of the current block / CTB / CTU.
[0614] As another example, when the current block is in the intra block copy AMVP mode, the encoder / decoder can add the block vector difference to the predicted block vector and use the sum as the block vector of the current block.
[0615] As in Figure 32 In the example of, according to at least one of the values of amvr_flag and amvr_precision_flag in entropy coding / decoding, the encoder / decoder can perform rounding on the identified predicted block vectors (mvX[0] and mvX[1]) as described by the following formula.
[0616] Here, according to at least one of the values of amvr_flag and amvr_precision_flag, the resolution of the block vector difference and the resolution of the predicted block vector can be determined.
[0617] Here, when amvr_flag is the first value 0, the block vector can have a size of N integer sample units.
[0618] In addition, when amvr_flag is the second value 1, the block vector can have a size of M or P integer sample units.
[0619] When amvr_flag is the second value 1 and amvr_precision_flag is the first value 0, the block vector can have a size of M integer sample units.
[0620] When amvr_flag is the second value 1 and amvr_precision_flag is the second value 1, the block vector can have a size in P integer sample units.
[0621] Here, N, M, and P can be positive integers. For example, N can be 1, M can be 4, and P can be 16. Additionally, N can be less than M and P. Moreover, P can be greater than N and M.
[0622] offset = (rightShift == 0)? 0 : (1 << (rightShift - 1))
[0623] mvX[0] = ((mvX[0] + offset - (mvX[0] >= 0)) >> rightShift) << leftShift
[0624] mvX[1] = ((mvX[0] + offset - (mvX[1] >= 0)) >> rightShift) << leftShift
[0625] When amvr_flag is the first value 0 (the block vector has a size in 1 integer sample unit), rightShift = 4 and leftShift = 4.
[0626] When amvr_flag is the first value 0 and amvr_precision_flag is the first value 0 (the block vector has a size in 4 integer sample units), rightShift = 6 and leftShift = 6.
[0627] When amvr_flag is the second value 1 and amvr_precision_flag is the second value 1 (the block vector has a size in 16 integer sample units), rightShift = 8 and leftShift = 8.
[0628] Here, the block vector resolution (e.g., 1, 4, 16 integer sample units) used in the intra-block copy AMVP mode can be the same as the result obtained by multiplying the motion vector resolution (e.g., 1 / 4, 1, 4 integer sample units) used in the inter-frame AMVP mode or the affine AMVP mode by K or by performing a J left shift operation on the motion vector resolution. Here, K and J can be positive integers. For example, K can be 4 and J can be 2.
[0629] At least one of amvr_flag, amvr_precision_flag, the resolution of the block vector difference, and the resolution of the predicted block vector can be derived based on at least one coding parameter of the current block / CTB / CTU.
[0630] Information indicating the maximum number of candidates in a block vector candidate list, information indicating the maximum number of candidates in a merge candidate list for an inter prediction mode, block vector candidate information, a merge index, an L0 motion prediction flag, and at least one of AMVP resolution related information (amvr_precision_flag and / or amvr_flag) can be entropy encoded / decoded in at least one of a parameter set, a header, a slice, a coding tree unit (CTU), a coding unit (CU), a prediction unit (PU), a transform unit (TU), a coding block (CB), a prediction block (PB), and a transform block (TB).
[0631] Here, at least one of a parameter set, a header, a slice, a CTU, a CU, a PU, a TU, a CB, a PB, and a TB can be at least one of the following: a video parameter set, a decoding parameter set, a sequence parameter set, an adaptive parameter set, a picture parameter set, a picture header, a sub - picture header, a slice header, a parallel block group header, a parallel block header, a slice, a coding tree unit (CTU), a coding unit (CU), a prediction unit (PU), a transform unit (TU), a prediction block (PB), and a transform block (TB).
[0632] Here, an encoder / decoder can perform prediction based on an intra - block copy mode by using at least one of the following in at least one of a parameter set, a header, a slice, a CTU, a CU, a PU, a TU, a CB, a PB, and a TB: information indicating the maximum number of candidates in a block vector candidate list, information indicating the maximum number of candidates in a merge candidate list for an inter prediction mode, block vector candidate information, a merge index, an L0 motion prediction flag, and AMVP resolution related information (amvr_precision_flag and / or amvr_flag).
[0633] Here, at least one of information indicating the maximum number of candidates in a block vector candidate list, information indicating the maximum number of candidates in a merge candidate list for an inter prediction mode, block vector candidate information, a merge index, an L0 motion prediction flag, and AMVP resolution related information (amvr_precision_flag and / or amvr_flag) can be derived based on at least one coding parameter of a current block / CTB / CTU.
[0634] When there is no information indicating the maximum number of candidates in the block vector candidate list, information indicating the maximum number of candidates in the merge candidate list for the inter prediction mode, block vector candidate information, merge index, L0 motion prediction flag, and at least one of the AMVP resolution related information (amvr_precision_flag and / or amvr_flag) in the bitstream, the information indicating the maximum number of candidates in the block vector candidate list, information indicating the maximum number of candidates in the merge candidate list for the inter prediction mode, merge index, L0 motion prediction flag, and AMVP resolution related information (amvr_precision_flag and / or amvr_flag) can be inferred as a first value (e.g., 0).
[0635] In the intra block copy mode, the encoder / decoder can limit the position of the reference block indicated by the block vector or the possible range of the block vector.
[0636] Here, when the range of the block or the position of the reference block indicated by the block vector is not limited, in order to generate a prediction block in the intra block copy mode, the encoder / decoder may have to store the reconstructed images of each region encoded / decoded before the current block in the same picture (the current picture). In this case, implementing the encoder / decoder may require a large amount of memory to store the reconstructed images. Therefore, in order to ensure easy implementation, in the intra block copy mode, the encoder / decoder can limit the position of the reference block indicated by the block vector or the possible range of the block vector.
[0637] As in the Figure 14 example, when assuming that the coordinates of the upper left sample position of the current block in the intra block copy mode in the picture are (xCb, yCb), the horizontal length of the current block is cbWidth, the vertical length of the current block is cbHeight, and the block vector is (Vx, Vy), the coordinates (xTL, yTL) of the upper left sample position of the reference block obtained by using the block vector can be determined as (xCb + Vx, yCb + Vy), and the coordinates (xBR, yBR) of the lower right sample position of the reference block can be determined as (xTL + cbWidth - 1, yTL + cbHeight - 1).
[0638] Here, the range of the value of the block vector or the position of the reference block indicated by the block vector can be limited by at least one of the following methods. The range of the value of the block vector or the position of the reference block indicated by the block vector can be limited based on the coding parameters of at least one of the current block and neighboring blocks adjacent to the current block. Additionally, the range of the value of the block vector or the position of the reference block indicated by the block vector can be limited based on the coding parameters of at least one of the current CTU and neighboring CTUs adjacent to the current CTU.
[0639] The region including the coordinates (xTL, yTL) of the upper left sample position of the reference block and the region including the coordinates (xBR, yBR) of the lower right sample position may have to be available. Here, available may mean that the corresponding region exists. Optionally, available may specifically mean that there is a reconstructed image / sample for the corresponding region.
[0640] In the foregoing embodiments and / or other embodiments described herein, the upper left coordinates of the reference block may represent the coordinates of the upper left sample position of the reference block, and the lower right coordinates of the reference block may represent the coordinates of the lower right sample position of the reference block.
[0641] The encoder / decoder may limit the lower left coordinates of the reference block to be to the left, above, or upper left of the upper left coordinates of the current block, such that there is no overlapping region between the current block and the reference block. In this regard, at least one of the following conditions may have to be met.
[0642] Vx + cbWidth ≤ 0
[0643] Vy + cbHeight ≤ 0
[0644] The reference block may be included in the same CTB as the current block, or the reference block may be included in the left (N - 1) CTBs. When the size of the CTB is 128×128, N may be 2. When the size of the CTB is less than 128×128 or equal to or greater than 64×64, the vertical length of the corresponding CTB × (N × (horizontal length of the CTB)) may be equal to 128×128. N may be determined based on the coding parameters of the current CTU and at least one of the neighboring CTUs adjacent to the current CTU.
[0645] When the size of the CTB is 128×128, the reference block may be included in the same CTB as the current block, or the reference block may be included in the left CTB. When the reference block is included in the same CTB as the current block, the reference block may be included in the region encoded / decoded before the current block. When the current CTB and the left CTB of the current CTB are quartered in units of 64×64, the reference block may exist in at least one of the remaining three 64×64 blocks encoded / decoded before the 64×64 block to which the current block belongs.
[0646] As in Figure 15In the example, the 64×64 blocks to which the reference blocks can belong are marked in gray according to the position of the 64×64 block where the current block (Curr) is located in the CTB. The area marked with "x" may indicate an area where reference blocks cannot be included. Additionally, within the 64×64 block to which the current block belongs, reference blocks may exist in the area encoded / decoded before the current block. Therefore, the number of reconstructed samples to be stored for reference block generation can be limited to the number of samples included in four 64×64 blocks (i.e., 128×128 blocks).
[0647] When the CTB size is less than 128×128 or equal to or less than 64×64, the reference blocks can be included in the (N - 1) CTBs to the left of the CTB including the current block. Here, N can satisfy (vertical length of CTB × (N × horizontal length of CTB)) = 128×128. For example, when the CTB size is 64×64, N can be 4. Additionally, reference blocks may exist in the area encoded / decoded before the current block. Therefore, the number of reconstructed samples to be stored for generating reference blocks (including the CTB to which the current block belongs) can be limited to the number of 128×128 samples.
[0648] The encoder / decoder can limit the range of reference blocks by storing the reference range available in the intra block copy mode into a separate buffer. Here, the range of reference blocks can indicate the position of the reference blocks indicated by the block vector. Here, the reference range can be an area capable of containing the reference blocks indicated by the block vector. The range of reference blocks can be limited based on the coding parameters of the current block and at least one of the neighboring blocks adjacent to the current block. Additionally, the range of values of the block vector or the position of the reference blocks indicated by the block vector can be limited based on the coding parameters of the current CTU and at least one of the neighboring CTUs adjacent to the current CTU.
[0649] In this case, the size of the reference area buffer for intra block copy can be M1×M2 and is stored at M3 bits per sample. Here, M1 and M2 can be positive integers that are multiples of 2 (e.g., 8, 16, 32, 64, 128, etc.), and M3 can be a random positive integer (e.g., 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, etc.). Optionally, M1 can be determined by dividing a predetermined positive integer that is a multiple of 2 by the length of one side of the CTU, and M2 can be determined as the length of one side of the CTU. For example, M1 can be 2 N . N can be a positive integer. For example, N can be 14, 15, or 16.
[0650] The value stored in the corresponding buffer may be at least one of the reconstructed picture samples without applying loop filtering. When the samples are not represented by M3 bits per sample, the encoder / decoder may transform the samples to M3 bits per sample.
[0651] At least one of M1, M2, and M3 may be determined based on the coding parameters of the current block and at least one of the neighboring blocks adjacent to the current block. Additionally, at least one of M1, M2, and M3 may be determined based on the coding parameters of the current CTU / CTB and at least one of the neighboring CTU / CTBs adjacent to the current CTU / CTB.
[0652] A reference region buffer may be newly set in each CTB or CTU row of a block, parallel block, strip, sub-picture, picture, or parallel block group. The newly setting may indicate resetting or initializing the corresponding buffer.
[0653] The corresponding buffer may be configured by at least one of the following methods.
[0654] 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, the size of the reference region buffer may be smaller than the CTB size.
[0655] As Figure 16 shown in (b) of Figure 16The reference region buffer is configured as shown in (a) of. In the reference region buffer, the reconstructed samples of the region encoded / decoded before the current block within the current CTB can be included at the same position as the relative position within the CTB, and the position of the current block and the positions corresponding to other regions within the current CTB except for the region encoded / decoded before the current block can include the reconstructed samples in the CTB located to the left of the current CTB. Here, the positions corresponding to the reconstructed samples can be included at the same position as the relative position of the corresponding reconstructed samples in the corresponding CTB. In other words, when the coordinates of the corresponding sample are (x, y), the positions included in the buffer can be represented as (x % the horizontal or vertical length of the CTB, y % the horizontal or vertical length of the CTB), (x % M1, y % M2), or (x % M1, y % the vertical length of the CTB). Here, the result of the modulo operation "%" can always be a positive value. In other words, when x has a negative value, x % L can be -(-x % L). For example, when the horizontal or vertical length of M1 or the CTB is 128, -3 % 128 can be 125. When the block vector is (Vx, Vy), the position of the predicted sample can be ((x + Vx) % 128, (y + Vy) % 128). Here, in the reference region buffer, the sample values of the current block region can be the reconstructed sample values in the left CTB corresponding to the current block region.
[0656] The encoder / decoder can limit the block vector signaled or derived to indicate the region included in the reference region buffer.
[0657] When the block vector signaled or derived is (Vx, Vy), the encoder / decoder can limit the range of the block vector to MinVx ≤ Vx ≤ MaxVx and MinVy ≤ Vy ≤ MaxVy. Additionally, MinVx, MaxVx, MinVy, and MaxVy can be set in one of the following ways.
[0658] When the upper left coordinates of the reference region buffer are set to (0, 0), MinVx = 0, MaxVx = (the horizontal length of the reference region buffer - 1), MinVy = 0, and MaxVy = (the vertical length of the reference region buffer - 1).
[0659] When Figure 17 the gray part of (a) of is set to (0, 0) in the reference region buffer, MinVx = -((the horizontal length of the reference region buffer / 2) - 1), MaxVx = (the horizontal length of the reference region buffer / 2), MinVy = -((the horizontal length of the reference region buffer / 2) - 1), and MaxVy = (the vertical length of the reference region buffer / 2).
[0660] When Figure 17When the gray part of (b) is set to (0, 0) in the reference region buffer, MinVx = -(horizontal length of the reference region buffer / 2), MaxVx = ((horizontal length of the reference region buffer / 2) - 1), MinVy = -(horizontal length of the reference region buffer / 2), and MaxVy = ((vertical length of the reference region buffer / 2) - 1).
[0661] At least one of MinVx, MaxVx, MinVy, and MaxVy can be determined based on the coding parameters of the current block and at least one of the neighboring blocks adjacent to the current block. Additionally, at least one of MinVx, MaxVx, MinVy, and MaxVy can be determined based on the coding parameters of the current CTU and at least one of the neighboring CTUs adjacent to the current CTU.
[0662] By restricting the values of the block vectors in the reference region buffer, the encoder / decoder can determine whether to signal and use an invalid block vector in the current block. When the signaled or derived block vector is included in a range other than the restricted range, the encoder / decoder can apply at least one of the following methods to include the block vector in the restricted range or generate a predicted block.
[0663] Here, an invalid block vector can indicate that the block vector exceeds the range of the reference region buffer. Additionally, an invalid block vector can indicate the (0, 0) block vector.
[0664] The closest block vector to the corresponding block vector that exceeds the restricted range can replace the corresponding block vector. In other words, when the signaled or derived block vector is (V1x, V1y) and V1x < MinVx, V1x can be set to MinVx. In the case where V1x > MaxVx, V1x can be set to MaxVx. In the case where V1y < MinVy, V1y can be set to MinVy. In the case where V1y > MaxVy, V1y can be set to MaxVy.
[0665] For the region indicated by the corresponding block vector that exceeds the restricted range, the encoder / decoder can perform filling based on the values of the reconstructed samples closest to the region.
[0666] The corresponding block vector can be set to have a fixed random value. For example, the corresponding block vector can be (0, 0), a vector value indicating the position of the current block, (0, P1), (P2, 0), or (P3, P4). Here, P1, P2, P3, and P4 can be random positive integers.
[0667] When the corresponding block vector is not replaced by a random value and the block vector is not included within a restricted range, the encoder / decoder may set all sample values of a predicted block obtained by using the block vector to a random fixed value. Here, the range of the random fixed value is from -1×2^(bitdepth) to 2^(bitdepth)-1. The bitdepth (bit depth) may be a random integer including 0. For example, the bitdepth may be 5, 6, 7, 8, 9, 10, 11, 12, etc. Additionally, the sample values of the predicted block may be -1, 0, -1×2^(bitdepth), 2^(bitdepth-1), and 2^(bitdepth)-1.
[0668] As another example, when all sample values of a predicted block obtained by using the corresponding block vector are set to a random fixed value, the range of the random fixed value may be from -1×(2<<bitdepth) to (2<<bitdepth)-1. Here, the bitdepth may be an integer including 0. Additionally, for example, all sample values of the predicted block may be -1, 0, (-1×(2<<bitdepth)), (2<<bitdepth-N-1)), and (2<<bitdepth-N))-1.
[0669] Here, N may be a positive integer including 0. Additionally, N may be a value already set in the encoder / decoder, or a value signaled from the encoder to the decoder.
[0670] The bitdepth may represent the bit depth of the input samples. Additionally, the bitdepth may be a value already set in the encoder / decoder, or a value signaled from the encoder to the decoder.
[0671] At least one of N and bitdepth may have different values in the luminance component block and the chrominance component (Cb and / or Cr) blocks.
[0672] At least one of N and bitdepth may have different values according to at least one of the intra block copy skip mode, intra block copy merge mode, intra block copy AMVP mode, and intra block copy AMVR mode, which is the coding mode of the current block.
[0673] At least one of N and bitdepth may be determined according to at least one coding parameter of the current block / CTB / CTU.
[0674] The reference region buffer can store the reconstructed picture sample values of the current block at the position of the current block after the current block is encoded / decoded. This process is called the reference region buffer update process. After performing this process, the encoder / decoder can encode / decode the next block. Therefore, the sample values included in the reference region buffer are gradually updated, and when each block in the current CTB is encoded / decoded, the buffer can consist only of the reconstructed picture samples of the current CTB.
[0675] The size of the reference region buffer can be M1 = (N × horizontal length of the CTB) and M2 = (vertical length of the CTB), or M1 = (vertical length of the CTB) and M2 = (N × horizontal length of the CTB). Here, N can be a positive integer that satisfies M1 × M2 = 128 × 128. Optionally, N can be derived as a value that satisfies (N × horizontal length of the CTB) × (vertical length of the CTB) = 128 × 128, and the horizontal length M1 of the reference region buffer can be equal to or less than (N × horizontal length of the CTB). The vertical length M2 of the reference region buffer can be equal to the vertical length of the CTB. Optionally, M1 can be (128 / horizontal length of the CTB) × K, and when the horizontal length of the CTB is 128, K can be the horizontal length of the reference region buffer.
[0676] At least one of M1, M2, N, and K can be determined based on the coding parameters of the current block and at least one of the neighboring blocks adjacent to the current block. Additionally, at least one of M1, M2, N, and K can be determined based on the coding parameters of the current CTU / CTB and at least one of the neighboring CTU / CTBs adjacent to the current CTU / CTB.
[0677] As in Figure 18 the example, the reference region buffer can be configured to include the (N - 1) CTBs on the left that have been fully encoded / decoded before the current CTB. Additionally, the region encoded / decoded in the current CTB before the current block can be included in the reference region buffer.
[0678] With Figure 18 similar Figure 19An example of a reference region buffer configured to include the left (N-1) CTBs that have been fully encoded / decoded before the current CTB is shown. When CTB#1 is the first CTB of the current CTU or CTB row, the buffer can be empty or set to an initial value before CTB#1 is encoded / decoded. Here, the initial value is a random integer that is equal to or greater than -1×2^(bitdepth) and equal to or less than 2^(bitdepth)-1. The initial value can be a predetermined value within the possible range of reconstructed samples. For example, the initial value can be -1, 0, -1×2^(bitdepth), 2^(bitdepth-1), or 2^(bitdepth)-1. When the corresponding buffer is empty, this may indicate that the block vector is restricted from indicating an empty region in the buffer. Setting the initial value can indicate that the block vector can indicate the region set by the initial value, and in this case, the initial value can be set to the predicted sample value.
[0679] As another example, the range of the initial value of the buffer can be from -1×(2<<bitdepth) to (2<<bitdepth)-1. Here, bitdepth can be an integer including 0. For example, bitdepth can be 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, etc. Additionally, for example, the initial value of the buffer can be -1, 0, (-1×(2<<bitdepth)), (2<<(bitdepth-N-1)), and (2<<(bitdepth-N))-1.
[0680] Here, N can be a positive integer including 0. Additionally, N can be a value that has been set in the encoder / decoder or a value signaled from the encoder to the decoder.
[0681] bitdepth can represent the bit depth of the input samples. Additionally, bitdepth can be a value that has been set in the encoder / decoder or a value signaled from the encoder to the decoder.
[0682] At least one of N and bitdepth can have different values in the luminance component block and the chrominance component (Cb and / or Cr) blocks.
[0683] At least one of N and bitdepth can have different values according to at least one of the intra block copy skip mode, intra block copy merge mode, intra block copy AMVP mode, and intra block copy AMVR mode, which are the encoding modes of the current block.
[0684] At least one of N and bitdepth can be determined according to at least one encoding parameter of the current block / CTB / CTU.
[0685] At the moment when the encoding / decoding of CTB#1 is completed, all the reconstructed samples of CTB#1 can be stored in the reference region buffer. At the moment when the encoding / decoding of CTB#2 is completed, the reconstructed samples of CTB#2 can be stored in the reference region buffer. Figure 19 An embodiment showing the state of the reference region buffer when the encoding / decoding of a specific CTB is completed and after the reconstructed samples of the CTB are added to the reference region buffer is shown. As Figure 19 shown in (a) of, when the encoding / decoding of CTB#2 is completed, the encoder / decoder can move the storage position of the samples of CTB#1 one CTB size to the right in the reference region buffer and store the reconstructed samples of CTB#2 at the position where CTB#1 was stored. As Figure 19 shown in (b) of, the encoder / decoder can store the reconstructed samples of CTB#2 in the region to the right of CTB#1 without changing the storage position of the samples of CTB#1. Here, when the encoding / decoding of CTB#4 is completed, the reference image buffer may be full. Therefore, when the encoding / decoding of CTB#5 is completed, the encoder / decoder can store the reconstructed samples of CTB#5 at the position that was used to store the reconstructed samples of CTB#1. Then, the reconstructed samples of CTB#6 can be stored at the storage position of the reconstructed samples of CTB#2. According to Figure 19 shown in (c) of, before the encoding / decoding of CTB#4 is completed and each reference image buffer is full, the reconstructed samples of the encoded / decoded CTB can be stored in the buffer, as Figure 19 shown in (b) of. When the encoding / decoding of CTB#5 is completed, the encoder / decoder can move the storage position of the reconstructed samples of CTB#4 one CTB size to the left and store the reconstructed samples of CTB#5 at the position that was used to store CTB#4. Here, the encoder / decoder can also move the reconstructed samples of CTB#2 and CTB#3 one CTB size to the left. Therefore, since the relative positions of the CTBs in the picture become the same as the relative positions of the CTBs in the reference region buffer, the predicted blocks can be derived using the transmitted block vectors without a separate transformation process. According to Figure 19 shown in (d) of, when the encoding / decoding of CTB#2 is completed, the storage position of the samples of CTB#1 is moved one CTB size to the left in the reference region buffer. The encoder / decoder can store the reconstructed samples of CTB#2 at the position that was used to store CTB#1. When the encoding / decoding of CTB#4 is completed, the reference image buffer is full. When the encoding / decoding of CTB#5 is completed, as Figure 19As shown in (c) thereof, the storage position of the reconstructed samples of CTB #4 can be shifted left by a single CTB size. The encoder / decoder can store the reconstructed samples of CTB #5 at the position that was used for the reconstructed samples of CTB #4. Here, the encoder / decoder can also shift the reconstructed samples of CTB #2 and CTB #3 left by a single CTB size.
[0686] When starting to encode / decoder the K5th CTB, i.e., when starting to encode / decoder the first block of the K5th CTB, the reconstructed samples of the (K5-1)th, (K5-2)th, ..., (K5-N)th CTBs can be stored in the reference region buffer. For example, when the CTB size is 64×64, N can be 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. The above K5 can represent a random positive integer. The first block of the K5th CTB can be encoded / decoded by referring to the corresponding reference region buffer. When the encoding / decoding of the corresponding block is completed, the reference region buffer state and the block vector can have one of the following ranges.
[0687] The reconstructed samples of the (K5-(N-1))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 for the Ath block (A is a random integer greater than 1) of the K5th CTB can be limited to the (N-1) CTBs on the left side of the current CTB. This 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 on the left side.
[0688] The reconstructed samples of the (K5-(N-1))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 for the Ath block (A is a random integer greater than 1) of the K5th CTB can be limited to the region of the blocks encoded / decoded before the current block in the current CTB, and is limited to the (N-1) CTBs on the left side of the current CTB. This 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 on the left side and the blocks encoded / decoded before the Ath block in the current CTB.
[0689] Among the reconstructed samples of the (K5 - (N - 1))-th CTB, in terms of the relative positions in the CTB, only the samples corresponding to the positions identical to those of the first block of the K5-th CTB may be deleted, and the reconstructed samples of the first block of the K5-th CTB may be stored in those positions. In this case, the reference region of the current block may be restricted to the blocks encoded / decoded before the current block within the current CTB, and the (N - 1) CTBs to the left of the current CTB. This method is advantageous in terms of coding efficiency because each region of the reference region buffer consists of reconstructed samples.
[0690] When starting to encode / decode the K5-th CTB, i.e., when starting to encode / decode the first block of the K5-th CTB, the reconstructed samples of the (K5 - 1)-th, (K5 - 2)-th,..., (K5 - (N - 1))-th CTBs may be stored in the reference region buffer. For example, when the CTB size is 64×64, N may be 4. In this case, the reconstructed samples of the (K5 - 1)-th, (K5 - 2)-th, and (K5 - 3)-th CTBs may be stored in the reference region buffer. One of the following methods may be applied to the encoding / decoding of the blocks in the K5-th CTB.
[0691] The reference region of the A-th block (A is a random integer equal to or greater than 0) of the K5-th CTB may be restricted to the (N - 1) CTBs to the left of the current CTB. This may 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 to the left.
[0692] The reference region of the A-th block (A is a random integer equal to or greater than 0) of the K5-th CTB may be restricted to the region of the blocks encoded / decoded before the current block within the current CTB, and the (N - 1) CTBs to the left of the current CTB. This may 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 to the left and the blocks encoded / decoded before the A-th block of the current CTB.
[0693] In the above content of the reference region buffer, the starting point of the coding / decoding of the first block of the K5th CTB or the corresponding CTB region for storing the reconstructed samples of the coding / decoding block of the K5th CTB before the coding / decoding can be initialized to a random fixed value or be empty. Here, the initial value is a random integer that is equal to or greater than -1×2^(bitdepth) and equal to or less than 2^(bitdepth)-1. The initial value can be a predetermined value within the possible range of the reconstructed samples. For example, the initial value can be -1, 0, -1×2^(bitdepth), 2^(bitdepth-1), or 2^(bitdepth)-1. When the corresponding buffer is empty, this can indicate that the block vector is restricted from indicating an empty region in the buffer. Setting the initial value can indicate that the block vector can indicate the region set by the initial value, and in this case, the initial value can be set to the predicted sample value. After coding / decoding a specific block within the corresponding CTB region, the reconstructed sample value can be stored at the corresponding block position in the reference region buffer that is empty or set to the initial value. In the corresponding CTB region in the reference region buffer, the region that has not been coded / decoded can be empty or set to the initial value.
[0694] As another example, the range of the initial value of the buffer can be from -1×(2<<bitdepth) to (2<<bitdepth)-1. Here, bitdepth can be an integer including 0. For example, bitdepth can be 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, etc. In addition, for example, the initial value of the buffer can be -1, 0, (-1×(2<<bitdepth)), (2<<(bitdepth-N-1)), and (2<<(bitdepth-N))-1.
[0695] Here, N can be a positive integer including 0. Additionally, N can be a value that has been set in the encoder / decoder or a value signaled from the encoder to the decoder.
[0696] bitdepth can represent the bit depth of the input samples. Additionally, bitdepth can be a value that has been set in the encoder / decoder or a value signaled from the encoder to the decoder.
[0697] At least one of N and bitdepth can have different values in the luminance component block and the chrominance component (Cb and / or Cr) block.
[0698] At least one of N and bitdepth may have different values according to at least one of an intra block copy skip mode, an intra block copy merge mode, an intra block copy AMVP mode, and an intra block copy AMVR mode which is an encoding mode of a current block.
[0699] At least one of N and bitdepth may be determined according to at least one encoding parameter of a current block / CTB / CTU.
[0700] K5 may be determined according to at least one encoding parameter of a current block / CTB / CTU.
[0701] In addition, a reference area buffer may be newly set in each CTB or CTU row of a block, a parallel block, a stripe, a subpicture, a picture, or a parallel block group. The new setting may mean clearing or initializing the corresponding buffer.
[0702] When a horizontal length of a CTB is C1, a vertical length of the CTB is C2, and a current CTB and (N-1) CTBs on the left can be included in the reference area buffer, if an in-picture coordinate of a block included in the CTB is (x,y), a storage position of the block when stored in the reference area buffer may be set as follows. N may be determined according to at least one encoding parameter of a current block / CTB / CTU.
[0703] In Figure 19 In the case of (a), when an in-picture coordinate of a block included in the K5th CTB is (x,y), the block may be stored at a position (x%C1,y%C2). When a block included in the K5th CTB is stored, if an in-picture coordinate of a block included in a left CTB is (x1,y1), a position in the reference area buffer may be as follows. A block included in the (K5-1)th CTB, a block included in the (K5-2)th CTB, and a block included in the (K5-3)th CTB may be stored at (x1%C1+C1,y1%C2), (x1%C1+(C1×2),y1%C2), and (x1%C1+(C1×3),y1%C2), respectively. A block included in the (K5-A)th CTB may be stored at (x1%C1+(C1×A),y1%C2). Here, A may be a positive integer satisfying 0≤A≤(N-1).
[0704] In Figure 19In the case of (b), when the in-picture coordinates of the block included in the K5th CTB are (x, y), the block can be stored at the position (x % C1, y % C2). When the block included in the K5th CTB is stored, if the in-picture coordinates of the block included in the left CTB are (x1, y1), the positions in the reference region buffer can be as follows. The blocks included in the (K5 - 1)th CTB, the (K5 - 2)th CTB, and the (K5 - 3)th CTB can be stored at (x1 % C1+(C1×3), y1 % C2), (x1 % C1+(C1×2), y1 % C2), and (x1 % C1+(C1×1), y1 % C2) respectively. The block included in the (K5 - A)th CTB can be stored at (x1 % C1+(C1×(N - A)), y1 % C2). Here, A can be 0 or a positive integer satisfying 0 ≤ A ≤ (N - 1). The block can be stored at the positions (x % M1, y % M2), (x % M1, y % CTB vertical length), or (x % M1, y).
[0705] In a similar manner to Figure 19 (c) or Figure 19 in the case of (d), when the in-picture coordinates of the block included in the K5th CTB are (x, y), the block can be stored at the position (x % C1+(C1×(N - 1)), y % C2). When the block included in the K5th CTB is stored, if the in-picture coordinates of the block included in the left CTB are (x1, y1), the positions in the reference region buffer can be as follows. The blocks included in the (K5 - 1)th CTB, the (K5 - 2)th CTB, and the (K5 - 3)th CTB can be stored at (x1 % C1+(C1×(N - 2)), y1 % C2), (x1 % C1+(C1×(N - 3)), y1 % C2), and (x1 % C1+(C1×(N - 4)), y1 % C2) respectively. The block included in the (K5 - A)th CTB can be stored at (x1 % C1+(C1×(N - (A + 1))), y1 % C2). Here, A can be 0 or a positive integer satisfying 0 ≤ A ≤ (N - 1).
[0706] The block vector can be represented by one of the following methods. Additionally, the block vector can be signaled or derived to be represented by one of the following methods.
[0707] When the in-picture coordinates of the upper-left position of the current block are (x, y) and the in-picture coordinates of the upper-left position of the predicted block are (x + VPx, y + VPy), the block vector can be represented as (VPx, VPy) which is the difference between these two coordinates. Additionally, the information of the block vector can be derived by signaling.
[0708] When the in-frame reference region buffer coordinates of the upper-left position of the current block are (x, y) and the in-frame reference region buffer coordinates of the upper-left position of the prediction block are (x + VBx, y + VBy), the block vector can be represented as (VBx, VBy) which is the difference between these two coordinates. Additionally, information for deriving the block vector can be signaled.
[0709] Here, when there is an empty region in the reference region buffer, the encoder / decoder can limit the range of the block vector so that the prediction block does not include that region. Specifically, the encoder / decoder can limit the block vector (VBx, VBy) 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 prediction block is included in the empty region of the reference region buffer. When the upper-left coordinate of the prediction block is (x + VBx, y + VBy), the encoder / decoder can limit the block vector to satisfy 0 ≤ x + VBx and 0 ≤ y + VBy. When the lower-right coordinate is (x + VBx + cbWidth - 1, y + VBy + cbHeight - 1), the encoder / decoder can limit the block vector to satisfy x + VBx + cbWidth - 1 ≤ ((C1x(N - 1)) - 1) and y + VBy + cbHeight - 1 ≤ (C2 - 1). When it is even possible to refer to the region encoded / decoded before the current block in the current CTB, the encoder / decoder can limit the block vector to satisfy x + VBx + cbWidth - 1 < x or y + VBy + cbHeight - 1 < y.
[0710] Optionally, when the reference region is set to the initial value, the range of the block vector can be limited to the range where the prediction block is included in the reference region buffer. In other words, when the upper-left coordinate of the prediction block is (x + VBx, y + VBy), the encoder / decoder can limit the block vector to satisfy 0 ≤ x + VBx and 0 ≤ y + VBy. When the lower-right coordinate is (x + VBx + cbWidth - 1, y + Vby + cbHeight - 1), the encoder / decoder can limit the block vector to satisfy x + VBx + cbWidth - 1 ≤ ((C1×N) - 1) and y + VBy + cbHeight - 1 ≤ (C2 - 1).
[0711] Hereinafter, a method for deriving the block vector of a chrominance component block will be described according to the present invention.
[0712] For the SINGLE_TREE type in which the block partitioning of the luminance component is performed in the same manner as the block partitioning of the chrominance component in the same CTU, when the current block is a chrominance component block and is encoded / decoded in the in-frame block copy mode, the encoder / decoder can derive the block vector of the chrominance component block as follows.
[0713] The luminance component block corresponding to the current chrominance component block can be determined as follows.
[0714] When the top-left sample position of the current chrominance component block is (xc, yc), the horizontal length is Wc, and the vertical length is Hc, the top-left sample position, horizontal length, and vertical length of the luminance component block corresponding to the current chrominance component block can be (xc / K1, yc / K2), K1×Wc, and K2×Hc, respectively. Here, K1 and K2 can be values that vary according to the chrominance component format.
[0715] For example, when the chrominance component format of the current picture is 4:2:0, both K1 and K2 can be 2.
[0716] As another example, when the chrominance component format of the current picture is 4:2:2, K1 can be 2 and K2 can be 1.
[0717] As another example, when the chrominance component format of the current picture is 4:4:4, both K1 and K2 can be 1.
[0718] Since the chrominance component block and the luminance component block have the same block partition structure, the luminance component block corresponding to the current chrominance component block can consist of one luminance component block.
[0719] When the block vector of the luminance component block corresponding to the chrominance component block is (MVL[0], MVL[1]), the block vector of the corresponding chrominance component block can be (MVL[0] / K1, MVL[1] / K2).
[0720] For example, when the chrominance component format of the current picture is 4:2:0, both K1 and K2 can be 2.
[0721] As another example, when the chrominance component format of the current picture is 4:2:2, K1 can be 2 and K2 can be 1.
[0722] As another example, when the chrominance component format of the current picture is 4:4:4, both K1 and K2 can be 1.
[0723] Although the above description assumes that the basic unit of MVL[0] and MVL[1] is 1 sample, the basic unit can be 1 / 16 sample, 1 / N sample, or N samples. Here, N can be a positive integer.
[0724] In the case of a tree type of a dual-tree structure (DUAL_TREE_LUMA or DUAL_TREE_CHROMA) in which block partitioning for a luminance component and block partitioning for a chrominance component are performed independently of each other in the same CTU, when the current block is a chrominance component block and is encoded / decoded in an intra-block copy mode, a block vector of the chrominance component block can be derived as follows.
[0725] The luminance component region corresponding to the current chrominance component block can be determined as follows.
[0726] When the top-left sample position of the current chrominance component block is (xc, yc), the horizontal length is Wc, and the vertical length is Hc, the top-left sample position, horizontal length, and vertical length of the luminance component region corresponding to the current chrominance component block can be (xc / K1, yc / K2), K1×Wc, and K2×Hc, respectively. Here, K1 and K2 can be values that vary according to the chrominance component format.
[0727] For example, when the chrominance component format of the current picture is 4:2:0, both K1 and K2 can be 2.
[0728] As another example, when the chrominance component format of the current picture is 4:2:2, K1 can be 2, and K2 can be 1.
[0729] As another example, when the chrominance component format of the current picture is 4:4:4, both K1 and K2 can be 1.
[0730] Here, the region of the luminance component corresponding to the current chrominance component block may include only a part of the partitioned luminance component blocks. In addition, the luminance component region corresponding to the corresponding chrominance component block may be partitioned into at least one or more luminance component blocks.
[0731] The current chrominance component block can be partitioned into N×M sub-block units, and the sub-blocks of the luminance component region corresponding to the sub-blocks can be obtained by partitioning the luminance component region into (N×K1)×(M×K2) sub-block units. Here, N and M can be positive integers equal to or greater than 1.
[0732] The correspondence between the chrominance component block and the luminance component region can be as Figure 20 shown in the example.
[0733] The current chrominance component block can be partitioned into N×M sub-block units, and the sub-blocks of the luminance component region corresponding to the sub-blocks can be obtained by partitioning the luminance component block into (N×K1)×(M×K2) sub-block units. Here, N and M can be positive integers equal to or greater than 1. Optionally, when the horizontal length and vertical length of the current chrominance component block are Wc and Hc respectively, the encoder / decoder can be partitioned into N×M sub-block units with the horizontal length and vertical length partitioned into P1 and P2 respectively. Here, N can be Wc / P1, M can be Hc / P2, and P1 and P2 can be integers equal to or greater than 1.
[0734] There can be luminance sub-blocks corresponding to the sub-blocks of the current chrominance component block. Here, the block vector of the sub-block of the current chrominance component block can be derived from the block vectors of the corresponding luminance sub-blocks.
[0735] When the block vector of the luminance sub-block corresponding to the sub-block of the chrominance component block is (MVL[0], MVL[1]), the block vector of the sub-block of the corresponding chrominance component block can be (MVL[0] / K1, MVL[1] / K2).
[0736] For example, when the chrominance component format of the current picture is 4:2:0, both K1 and K2 can be 2.
[0737] As another example, when the chrominance component format of the current picture is 4:2:2, K1 can be 2 and K2 can be 1.
[0738] As another example, when the chrominance component format of the current picture is 4:4:4, both K1 and K2 can be 1.
[0739] Although the above description assumes that the basic unit of MVL[0] and MVL[1] is 1 sample, the basic unit can be 1 / 16 sample, 1 / N sample or N samples. Here, N can be a positive integer.
[0740] In addition, not all samples located within the luminance sub-blocks corresponding to the sub-blocks of the current chrominance component block can be encoded / decoded in the same prediction mode. This is because the block partition structures of the luminance component and the chrominance component are independent of each other. In other words, the luminance component block corresponding to the sub-block of the chrominance component block may not correspond to the luminance component prediction block, and there may be two or more partitioned luminance component prediction blocks within the luminance sub-block.
[0741] Here, the luminance component prediction block refers to the block to which the same prediction or transform / inverse transform is applied when encoding / decoding the luminance component. The luminance component prediction block can be determined by performing luminance component block partitioning.
[0742] As mentioned herein, the luminance component region corresponding to a chrominance component block can represent not only the prediction block determined by partitioning the luminance component block (as shown in Figure 20 ), but also the luminance component region corresponding to the chrominance component block in terms of position and size.
[0743] Therefore, the block vector of the luminance sub-block corresponding to the sub-block of the current chrominance component block can be at least one of the following block vectors.
[0744] The vector of the luminance component prediction block when the following luminance component prediction block is encoded / decoded in the intra-block copy mode, where the luminance component prediction block includes the top-left sample of the luminance sub-block corresponding to the sub-block of the current chrominance component block.
[0745] The block vector of the luminance component prediction block when the following luminance component prediction block is encoded / decoded in the intra-block copy mode, where the luminance component prediction block includes the sample at the center position of the luminance sub-block corresponding to the sub-block of the current chrominance component block.
[0746] The block vector of the luminance component prediction block when the following luminance component prediction block is encoded / decoded in the intra-block copy mode, where the luminance component prediction block includes one of the sample positions shown in the luminance sub-block corresponding to the sub-block of the current chrominance component block ( Figure 21 ). Figure 21 The block vector of the luminance component prediction block when the following luminance component prediction block is encoded / decoded in the intra-block copy mode, where the luminance component prediction block includes at least one of the samples in the luminance sub-block corresponding to the sub-block of the current chrominance component block.
[0747] The block vector of the luminance component prediction block when the following luminance component prediction block is encoded / decoded in the intra-block copy mode, where the luminance component prediction block occupies the largest region in the luminance sub-block corresponding to the sub-block of the current chrominance component.
[0748] There may be no block vector of the luminance sub-block corresponding to the sub-block of the current chrominance component block. This can be one of the following cases.
[0749] In the case where the following luminance component prediction block is not encoded / decoded in the intra-block copy mode or is encoded / decoded in the intra prediction mode, where the luminance component prediction block includes the top-left sample of the luminance sub-block corresponding to the sub-block of the current chrominance component block.
[0750]
[0751] In the case where the following luminance component prediction block is not encoded / decoded in the intra block copy mode or is encoded / decoded in the intra prediction mode, where the luminance component prediction block includes the central position sample of the luminance sub-block corresponding to the sub-block of the current chrominance component block.
[0752] In the case where the luminance component prediction block is not encoded / decoded in the intra block copy mode or is encoded / decoded in the intra prediction mode, where the luminance component prediction block includes the luminance sub-block corresponding to the sub-block of the current chrominance component block ( Figure 21 ) among Figure 21 one of the sample positions shown in
[0753] In the case where the luminance component prediction block is not encoded / decoded in the intra block copy mode or is encoded / decoded in the intra prediction mode, where the luminance component prediction block includes at least one of the samples in the luminance sub-block corresponding to the sub-block of the current chrominance component block.
[0754] In the following case where the luminance component prediction block is not encoded / decoded in the intra block copy mode or is encoded / decoded in the intra prediction mode, where the luminance component prediction block occupies the largest area in the luminance sub-block corresponding to the sub-block of the current chrominance component.
[0755] When there is no block vector of the luminance sub-block corresponding to the sub-block (referred to as the current sub-block) of the current chrominance component block, the encoder / decoder can derive the block vector corresponding to the sub-block of the chrominance component block by one of the following methods.
[0756] The encoder / decoder can set the block vector of the current sub-block to (0,0) or (D1,D2). Here, D1 and D2 can be integers such as 0, 1, 2, 3, etc.
[0757] The encoder / decoder can set the block vector of the current sub-block to (Wc + D1,D2) or (D1,Hc + D2). Here, Wc can be the horizontal length of the current chrominance component block, and Hc can be the vertical length of the current chrominance component block. D1 and D2 can be integers such as 0, 1, 2, 3, etc.
[0758] The encoder / decoder can set the block vector of the current sub-block to one of (-(Wc << n)+a,-(Hc << n)+b), (-(Wc << n)+c,0), and (0,-(Hc << n)+d). Here, n can be a positive integer, and a, b, c, and d can have integer values.
[0759] The encoder / decoder may use the block vectors of neighboring sub-blocks 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, and lower right sub-block) as the block vector of the current sub-block.
[0760] The encoder / decoder may derive the block vector of the current sub-block by using the statistical value of the block vectors of the sub-blocks of the current chrominance component block, where the corresponding luminance sub-blocks of the sub-blocks of the current chrominance component block have block vectors.
[0761] For example, the statistical value may be at least one of the average value, median value, maximum value, and minimum value of the block vectors of the corresponding sub-blocks.
[0762] For example, the statistical value may be the block vector with the highest occurrence frequency.
[0763] When the corresponding luminance sub-block is not encoded / decoded in the intra-block copy mode or there is at least one sub-block of the chrominance component block for which the corresponding luminance sub-block does not have a block vector, the chrominance component block may not be encoded / decoded in the intra-block copy mode.
[0764] The encoder / decoder may set the prediction mode of the luminance sub-block corresponding to the sub-block of the current chrominance component block as follows. Here, the prediction mode may be at least one of the intra prediction mode, inter prediction mode, and intra-block copy mode. More specifically, the prediction mode may be at least one of the following inter prediction modes: skip mode, merge mode, AMVP mode, affine skip mode, and affine inter mode. Additionally, the prediction mode may be at least one of the following intra-block copy modes: intra-block copy skip mode, intra-block copy merge mode, intra-block copy AMVP mode, and intra-block copy AMVR mode.
[0765] The prediction mode of the following luminance component prediction block: The luminance component prediction block includes the upper left sample of the luminance sub-block corresponding to the sub-block of the current chrominance component block
[0766] The prediction mode of the following luminance component prediction block: The luminance component prediction block includes the sample at the center position of the luminance sub-block corresponding to the sub-block of the curr...
Claims
1. A video decoding method, the method comprising: Obtaining an intra block copy mode enable flag indicating whether to enable the intra block copy mode for a current sequence; When the intra block copy mode enable flag indicates that the intra block copy mode is enabled for the current sequence, obtaining information about a maximum number of block vector candidates of a block vector candidate list; When a prediction mode of a current block is the intra block copy mode, constructing a block vector candidate list of the current block; Determining a block vector of the current block based on the block vector candidate list of the current block; Determining a predicted block of the current block based on the block vector; And Reconstructing the current block based on the predicted block, wherein when a number of block vector candidates included in the block vector candidate list is less than the maximum number of block vector candidates, at least one historical block vector candidate of a historical block vector candidate list is added to the block vector candidate list, wherein the historical block vector candidate list is updated to include the block vector of the current block.
2. The video decoding method according to claim 1, Among them, wherein the intra block copy mode enable flag and the information about the maximum number of block vector candidates are obtained from a sequence parameter set referred to by the current sequence.
3. The video decoding method according to claim 1, Among them, wherein the information about the maximum number of block vector candidates indicates a difference between a predetermined positive integer and the maximum number of block vector candidates of the block vector candidate list.
4. The video decoding method according to claim 1, further comprising: Applying a deblocking filter to block boundaries of the reconstructed current block.
5. The video decoding method according to claim 4, Among them, Determining whether to apply the deblocking filter to the reconstructed current block based on at least one of a first difference between a vertical component of the block vector of the current block and a vertical component of a block vector of an adjacent neighboring block of the current block, or a second difference between a horizontal component of the block vector of the current block and a horizontal component of the block vector of the adjacent neighboring block of the current block being greater than a threshold.
6. The video decoding method according to claim 5, Among them, When at least one of the first difference or the second difference is greater than the threshold, applying the deblocking filter to the reconstructed current block.
7. The video decoding method according to claim 1, Among them, When a historical block vector candidate duplicates with a block vector candidate included in the block vector candidate list, not adding the historical block vector candidate to the block vector candidate list.
8. The video decoding method according to claim 1, wherein, When a size of the current block is less than a threshold, not adding a spatial block vector candidate derived from an adjacent neighboring block of the current block to the block vector candidate list of the current block.
9. The video decoding method according to claim 8, Among them, When the size of the current block is less than the threshold, not updating the historical block vector candidate list with the block vector of the current block.
10. A video encoding method, the method comprising: When a prediction mode of a current block is the intra block copy mode, constructing a block vector candidate list of the current block; Determining a block vector of the current block based on the block vector candidate list of the current block; Determining a predicted block of the current block based on the block vector; Obtaining a residual block of the current block based on the predicted block; Encode an intra block copy mode enable flag for the current sequence, where the intra block copy mode enable flag indicates whether the intra block copy mode is enabled; Wherein, when the intra block copy mode enable flag is encoded as a value indicating that the intra block copy mode is enabled for the current sequence, further encode information about the maximum number of block vector candidates in the block vector candidate list, Wherein, when the number of block vector candidates included in the block vector candidate list is less than the maximum number of block vector candidates, at least one history-based block vector candidate from the history-based block vector candidate list is added to the block vector candidate list, Wherein, the history-based block vector candidate list is updated to include the block vector of the current block.
11. The video coding method according to claim 10, Among them, The intra block copy mode enable flag and the information about the maximum number of block vector candidates are included in the sequence parameter set referenced by the current sequence.
12. The video coding method according to claim 10, Among them, The information about the maximum number of block vector candidates indicates the difference between a predetermined positive integer and the maximum number of block vector candidates in the block vector candidate list.
13. The video coding method according to claim 10, further comprising: Reconstruct the current block based on the predicted block; And Apply a deblocking filter to the block boundaries of the reconstructed current block.
14. The video coding method according to claim 13, Among them, Determine whether to apply a deblocking filter to the reconstructed current block based on at least one of a first difference between a vertical component of the block vector of the current block and a vertical component of the block vector of an adjacent neighboring block of the current block, or a second difference between a horizontal component of the block vector of the current block and a horizontal component of the block vector of the adjacent neighboring block of the current block being greater than a threshold.
15. The video coding method according to claim 14, Among them, When at least one of the first difference or the second difference is greater than the threshold, apply a deblocking filter to the reconstructed current block.
16. The video coding method according to claim 10, Among them, When a history-based block vector candidate duplicates a block vector candidate included in the block vector candidate list, do not add the history-based block vector candidate to the block vector candidate list.
17. The video encoding method according to claim 10, wherein, When the size of the current block is less than a threshold, do not add a spatial block vector candidate derived from an adjacent neighboring block of the current block to the block vector candidate list of the current block.
18. A device for transmitting compressed video data, the device comprising: A processor for obtaining the compressed video data; And A transmitter for transmitting the compressed video data, Wherein, the operation of obtaining the compressed video data includes: When the prediction mode of the current block is the intra block copy mode, construct a block vector candidate list for the current block; Determine the block vector of the current block based on the block vector candidate list of the current block; Determine the predicted block of the current block based on the block vector; Obtain the residual block of the current block based on the predicted block; Encode an intra block copy mode enable flag for a current sequence, where the intra block copy mode enable flag indicates whether the intra block copy mode is enabled; Wherein, when the intra block copy mode enable flag is encoded as a value indicating that the intra block copy mode is enabled for the current sequence, further encode information about a maximum number of block vector candidates in a block vector candidate list; Wherein, when the number of block vector candidates included in the block vector candidate list is less than the maximum number of block vector candidates, at least one history-based block vector candidate from a history-based block vector candidate list is added to the block vector candidate list; Wherein, the history-based block vector candidate list is updated to include the block vector of a current block.