Image encoding / decoding method and apparatus, and recording medium storing bit stream
By using candidate lists to derive motion information in image encoding/decoding and generating prediction blocks, the high cost problem of high-resolution and high-quality image data is solved, and more efficient compression and storage is achieved.
Patent Information
- Application Number
- CN201980061387.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2018-09-18
- Filing Date
- 2019-09-18
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2039-09-18
AI Technical Summary
The cost of sending and storing high-resolution and high-quality image data is increased, requiring efficient image encoding/decoding technology to improve compression efficiency.
By derive the motion information of the current block using the candidate list, a prediction block is generated, and motion information is added or updated in the candidate list to improve the efficiency of inter prediction.
Improves the compression efficiency of image encoding/decoding, is suitable for block shapes of various aspect ratios, and reduces the amount of data.
Smart Images

Figure CN112740671B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a method and apparatus for encoding / decoding an image and a recording medium for storing a bitstream. More particularly, the present invention relates to a method and apparatus for encoding / decoding an image based on a candidate list and a recording medium for storing a bitstream. Background Art
[0002] Recently, in various application fields, the demand for high-resolution and high-quality images (such as high-definition (HD) images and ultra-high-definition (UHD) images) has increased. However, compared with conventional image data, higher-resolution and higher-quality image data has an increased data volume. Therefore, when image data is transmitted by using a medium such as conventional wired and wireless broadband networks, or when image data is stored by using conventional storage media, the cost of transmission and storage increases. In order to solve these problems that arise as the resolution and quality of image data increase, a highly efficient image encoding / decoding technology is required for higher-resolution and higher-quality images.
[0003] Image compression technology includes various technologies, including: inter-frame prediction technology, which predicts pixel values included in a current picture from a previous picture or a subsequent picture of the current picture; intra-frame prediction technology, which predicts pixel values included in a current picture by using pixel information in the current picture; transform and quantization technology for compressing energy of a residual signal; entropy coding technology, which assigns short codes to values with high frequency of occurrence and long codes to values with low frequency of occurrence, etc. Image data can be effectively compressed by using such image compression technology and can be transmitted or stored. Summary of the Invention
[0004] Technical issues
[0005] An object of the present invention is to provide an image encoding / decoding method and apparatus capable of improving compression efficiency, and a recording medium storing a bit stream generated by the method or apparatus.
[0006] Another object of the present invention is to provide an image encoding / decoding method and apparatus capable of improving compression efficiency by using a candidate list, and a recording medium storing a bit stream generated by the method or apparatus.
[0007] Technical Solution
[0008] According to the present invention, an image decoding method includes: deriving motion information of a current block by using a candidate list, generating a prediction block of the current block by using the motion information of the current block, and adding the motion information of the current block to the candidate list, wherein the candidate list is used for inter-frame prediction of a block to be decoded after the current block.
[0009] The candidate list includes: motion information of blocks decoded before the current block.
[0010] When a block decoded before the current block and the current block belong to different coding tree unit (CTU) rows, the motion information of the current block is not added to the candidate list.
[0011] The motion information of the current block is added to the candidate list only when the affine mode or the sub-block based temporal motion vector derivation mode is not applied to the current block.
[0012] Among them, the step of adding the motion information of the current block to the candidate list includes: when the number of multiple motion information included in the candidate list is a preset value, deleting the motion information that is first included in the candidate list among the multiple motion information included in the candidate list, and adding the motion information of the current block after the motion information that is last included in the candidate list.
[0013] Among them, the step of adding the motion information of the current block to the candidate list includes: when the motion information identical to the motion information of the current block is already included in the candidate list, deleting the identical motion information from the candidate list; and adding the motion information of the current block after the motion information last included in the candidate list.
[0014] The maximum number of pieces of motion information that can be included in the candidate list is preset.
[0015] The image decoding method further includes: deriving a merge candidate list for inter-frame prediction of the current block by using the candidate list.
[0016] The step of deriving the merge candidate list includes comparing the motion information included in the candidate list with the motion information included in the merge candidate list, and based on the comparison, adding the motion information included in the candidate list to the merge candidate list.
[0017] The comparison between the motion information included in the candidate list and the motion information included in the merge candidate list is performed only on a preset number of candidates located at the end of the candidate list.
[0018] When the motion information included in the candidate list is different from the motion information included in the merge candidate list, the motion information included in the candidate list is added to the merge candidate list.
[0019] After the spatial merge candidate or the temporal merge candidate is added to the merge candidate list, the motion information included in the candidate list is added to the merge candidate list.
[0020] According to the present invention, a method for encoding an image includes: deriving a merge candidate list of a current block by using a candidate list, deriving motion information of the current block by using the merge candidate list, and adding the motion information of the current block to the candidate list, wherein the candidate list is used for inter-frame prediction of a block to be encoded after the current block.
[0021] The candidate list includes: motion information of blocks encoded before the current block.
[0022] When a block coded before the current block and the current block belong to different coding tree unit (CTU) rows, the motion information of the current block is not added to the candidate list.
[0023] The motion information of the current block is added to the candidate list only when the affine mode or the sub-block based temporal motion vector derivation mode is not applied to the current block.
[0024] Among them, the step of adding the motion information of the current block to the candidate list includes: when the number of multiple motion information included in the candidate list is a preset value, deleting the motion information first included in the candidate list among the multiple motion information included in the candidate list, and adding the motion information of the current block after the motion information last included in the candidate list.
[0025] Among them, the step of adding the motion information of the current block to the candidate list includes: when the motion information identical to the motion information of the current block is already included in the candidate list, deleting the identical motion information from the candidate list, and adding the motion information of the current block after the motion information last included in the candidate list.
[0026] The step of deriving the merge candidate list includes comparing the motion information included in the candidate list with the motion information included in the merge candidate list, and based on the comparison, adding the motion information included in the candidate list to the merge candidate list.
[0027] The comparison between the motion information included in the candidate list and the motion information included in the merge candidate list is performed only on a preset number of candidates located at the end of the candidate list.
[0028] When the motion information included in the candidate list is different from the motion information included in the merge candidate list, the motion information included in the candidate list is added to the merge candidate list.
[0029] After the spatial merge candidate or the temporal merge candidate is added to the merge candidate list, the motion information included in the candidate list is added to the merge candidate list.
[0030] According to the present invention, a computer-readable recording medium stores a bitstream, wherein the bitstream is received by a device for decoding an image and is used to reconstruct a current block included in a current picture, wherein the bitstream includes information related to motion information of blocks decoded before the current block, the motion information of the blocks decoded before the current block is used to derive a candidate list, the candidate list is used to derive the motion information of the current block, the motion information of the current block is used to generate a prediction block for the current block, the motion information of the current block is used to update the candidate list, and the candidate list is used for inter-frame prediction of blocks to be decoded after the current block.
[0031] Beneficial effects
[0032] According to the present invention, an image encoding / decoding method and apparatus capable of improving compression efficiency can be provided, and a recording medium storing a bit stream generated by the method or apparatus can be provided.
[0033] Furthermore, according to the present invention, it is possible to provide an image encoding / decoding method and apparatus capable of improving compression efficiency by using block shapes having various aspect ratios, and a recording medium storing a bitstream generated by the method or apparatus. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 is a block diagram showing the configuration of an encoding device to which the present invention is applied.
[0035] Figure 2 is a block diagram showing the configuration of a decoding device to which the present invention is applied.
[0036] Figure 3 is a diagram schematically showing a partition structure when encoding and decoding an image.
[0037] Figure 4 is a diagram illustrating an example of intra prediction.
[0038] Figure 5 is a diagram illustrating an example of inter-frame prediction.
[0039] Figure 6 is a diagram illustrating an example of transformation and quantization.
[0040] Figure 7 is a diagram showing reference samples that can be used for intra prediction.
[0041] Figure 8 is a flowchart illustrating an image encoding / decoding method according to one embodiment of the present invention;
[0042] Figure 9 and Figure 10 is a diagram illustrating a method of inserting neighboring blocks adjacent to a current block into a candidate list according to one embodiment of the present invention;
[0043] Figure 11 and Figure 12 is a diagram illustrating a method of inserting neighboring blocks adjacent to a current block into a candidate list according to the length of a boundary between the current block and the neighboring blocks according to one embodiment of the present invention;
[0044] Figure 13 and Figure 14 is a diagram illustrating a method of inserting neighboring blocks adjacent to a current block into a candidate list according to sizes of the neighboring blocks according to one embodiment of the present invention;
[0045] Figure 15 and Figure 16 is a diagram illustrating a method of inserting neighboring blocks adjacent to a current block into a candidate list according to depths of the neighboring blocks according to one embodiment of the present invention;
[0046] Figure 17 and Figure 18 is a diagram illustrating a method of inserting neighboring blocks adjacent to a current block into a candidate list according to a partition tree type of the neighboring blocks according to an embodiment of the present invention;
[0047] Figure 19 and Figure 20 is a diagram illustrating a method of inserting neighboring blocks adjacent to a current block into a candidate list according to a block form of the neighboring blocks according to one embodiment of the present invention;
[0048] Figure 21 is a diagram illustrating a method of inserting adjacent blocks into a candidate list in the order in which the adjacent blocks are encoded / decoded according to one embodiment of the present invention;
[0049] Figure 22 is a diagram illustrating a method of inserting a neighboring block into a candidate list according to positions of neighboring blocks spaced a specific distance from a position of a current block according to one embodiment of the present invention;
[0050] Figure 23is a diagram illustrating a method of inserting a neighboring block into a candidate list according to a position of a neighboring block spaced a specific distance from a position of at least one selected from a current picture, a sub-picture, a slice, a tile, and a partition according to one embodiment of the present invention;
[0051] Figure 24 is a flowchart illustrating a method for encoding / decoding an image according to an embodiment of the present invention, and Figure 25 is a diagram illustrating a method of adding block information of a current block to a candidate list according to an embodiment of the present invention. DETAILED DESCRIPTION
[0052] The present invention may be modified in various ways, and there are various embodiments of the present invention, of which examples of various embodiments will now be provided with reference to the accompanying drawings and described in detail. However, the present invention is not limited thereto, although the exemplary embodiments may be interpreted as including all modifications, equivalents, or alternatives within the technical concept and technical scope of the present invention. In various aspects, similar figure numerals refer to the same or similar functions. In the drawings, the shapes and sizes of elements may be exaggerated for clarity. In the following detailed description of the present invention, reference is made to the accompanying drawings that illustrate specific embodiments in which the present invention may be practiced. These embodiments are described in sufficient detail to enable those skilled in the art to implement the present disclosure. It should be understood that the various embodiments of the present disclosure, although different, are not necessarily mutually exclusive. For example, specific features, structures, and characteristics described herein in conjunction with one embodiment may be implemented in other embodiments without departing from the spirit and scope of the present disclosure. In addition, it should be understood that the position or arrangement of the various elements within each disclosed embodiment may be modified without departing from the spirit and scope of the present disclosure. Therefore, the following detailed description should not be taken in a limiting sense, and the scope of the present disclosure is limited solely by the appended claims (and, when appropriately interpreted, together with the full scope of equivalents claimed by the claims).
[0053] The terms "first," "second," and the like used in the specification may be used to describe various components, but the components should not be construed as being limited to these terms. These terms are used only to distinguish one component from other components. For example, a "first" component may be named a "second" component, and a "second" component may be similarly named a "first" component without departing from the scope of the present invention. The term "and / or" includes a combination of a plurality of items or any one of the plurality of items.
[0054] It will be understood that in this specification, when an element is simply referred to as being “connected to” or “coupled to” another element rather than being “directly connected to” or “directly coupled to” another element, the element may be “directly connected to” or “directly coupled to” another element, or connected to or coupled to another element with other elements intervening therebetween. Conversely, it will be understood that when an element is referred to as being “directly coupled to” or “directly connected to” another element, there are no intervening elements.
[0055] In addition, the components shown in the embodiments of the present invention are shown independently to represent different characteristic functions from each other. Therefore, this does not mean that each component is composed of a separate hardware or software component unit. In other words, for convenience, each component includes each component in the listed components. Therefore, at least two components of each component can be combined to form a component, or a component can be divided into multiple components to perform each function. If it does not depart from the essence of the present invention, the embodiment in which each component is combined and the embodiment in which a component is divided are also included in the scope of the present invention.
[0056] The terms used in this specification are only used to describe specific embodiments and are not intended to limit the present invention. Unless there is a significantly different meaning in the context, the expressions used in the singular include the expressions in the plural form. In this specification, it will be understood that terms such as "including", "having" etc. are intended to indicate the presence of features, numbers, steps, actions, elements, parts or combinations thereof disclosed in the specification, and are not intended to exclude the possibility that one or more other features, numbers, steps, actions, elements, parts or combinations thereof may be present or may be added. In other words, when a particular element is referred to as "comprising", it does not exclude elements other than the corresponding element, but other elements may be included in embodiments of the present invention or in the scope of the present invention.
[0057] Furthermore, some components may not be essential components for performing the basic functions of the present invention, but may be optional components that only enhance its performance. The present invention may be implemented by including only the essential components for achieving the essence of the present invention without including components that enhance its performance. Structures that include only the essential components without including optional components that enhance its performance are also within the scope of the present invention.
[0058] Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings. When describing exemplary embodiments of the present invention, well-known functions or configurations will not be described in detail because they may unnecessarily obscure the understanding of the present invention. The same constituent elements in the accompanying drawings are represented by the same reference numerals, and repeated descriptions of the same elements will be omitted.
[0059] Hereinafter, an image may refer to a frame constituting a video, or may refer to the video itself. For example, "encoding or decoding an image, or both encoding and decoding the image" may refer to "encoding or decoding a moving picture, or both encoding and decoding the image," and may refer to "encoding or decoding one of the images in the moving picture, or both encoding and decoding the image."
[0060] Hereinafter, the terms "moving picture" and "video" may be used as the same meaning and may be replaced with each other.
[0061] Hereinafter, a target image may be an encoding target image and / or a decoding target image. Furthermore, a target image may be an input image to an encoding device or an input image to a decoding device. Here, the target image may have the same meaning as the current image.
[0062] Hereinafter, the terms "image," "picture," "frame," and "screen" may be used as the same meaning and may be replaced with each other.
[0063] Hereinafter, a target block may be an encoding target block as an encoding target and / or a decoding target block as a decoding target. In addition, a target block may be a current block as a target of current encoding and / or decoding. For example, the terms "target block" and "current block" may be used as having the same meaning and may be used interchangeably.
[0064] Hereinafter, the terms "block" and "unit" may be used as the same meaning and may be replaced with each other. Alternatively, "block" may refer to a specific unit.
[0065] Hereinafter, the terms "region" and "segment" may be used interchangeably.
[0066] 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.
[0067] In an embodiment, each of the specific information, data, flags, indexes, elements, and attributes may have a value. A value of "0" for the information, data, flags, indexes, elements, and attributes may represent a logical false value or a first predefined value. In other words, the values "0," false, logical false, and the first predefined value may be interchangeable. A value of "1" for the information, data, flags, indexes, elements, and attributes may represent a logical true value or a second predefined value. In other words, the values "1," true, logical true, and the second predefined value may be interchangeable.
[0068] When the variable i or j is used to represent a column, row, or index, the value of i can be an integer equal to or greater than 0, or an integer equal to or greater than 1. That is, the column, row, index, etc. can be counted from 0 or 1.
[0069] Terminology Description
[0070] Encoder: This refers to the device that performs encoding. In other words, it refers to the encoding device.
[0071] Decoder: This refers to a device that performs decoding. In other words, it refers to a decoding device.
[0072] Block: An M×N array of samples. Here, M and N may represent positive integers, and a block may represent a two-dimensional array of samples. A block may refer to a unit. The current block may refer to an encoding target block that is targeted during encoding, or a decoding target block that is targeted during decoding. Furthermore, the current block may be at least one of a coding block, a prediction block, a residual block, and a transform block.
[0073] Sample: It is the basic unit of a block. According to the bit depth (Bd), the sample can be represented from 0 to 2 Bd In the present invention, the term "sample point" may be used to mean a pixel. That is, the terms "sample point", "pel", and "pixel" may have the same meaning as each other.
[0074] Unit: This refers to an encoding and decoding unit. When encoding and decoding an image, a unit may be a region generated by partitioning a single image. Furthermore, when a single image is partitioned into sub-partitioned units during encoding or decoding, a unit may represent a sub-partitioned unit. In other words, an image may be partitioned into multiple units. When encoding and decoding an image, predetermined processing may be performed on each unit. A single unit may be partitioned into sub-units smaller than the unit. Depending on its function, a unit may represent a block, macroblock, coding tree unit, coding tree block, coding unit, coding block, prediction unit, prediction block, residual unit, residual block, transform unit, transform block, and so on. Furthermore, to distinguish a unit from a block, a unit may include a luma component block, chroma component blocks associated with the luma component block, and syntax elements for each color component block. A unit may have various sizes and shapes. Specifically, the shape of a unit may be a two-dimensional geometric figure such as a square, rectangle, trapezoid, triangle, pentagon, and so on. Also, the unit information may include at least one of a unit type indicating a coding unit, a prediction unit, a transformation unit, etc., and a unit size, a unit depth, an order of encoding and decoding of the unit, and the like.
[0075] Coding tree unit: A single coding tree block configured with the luma component Y and two coding tree blocks associated with the chroma components Cb and Cr. In addition, the coding tree unit may represent a syntax element including a block and each block. Each coding tree unit may be partitioned by using at least one of a quadtree partitioning method, a binary tree partitioning method, and a ternary tree partitioning method to configure lower-level units such as coding units, prediction units, and transform units. The coding tree unit may be used as a term for specifying a sample block that becomes a processing unit when encoding / decoding an image as an input image. Here, the quadtree may represent a quadtree.
[0076] When the size of a coding block is within a predetermined range, it can be partitioned using only quadtree partitioning. Here, the predetermined range can be defined as at least one of the maximum and minimum sizes of the coding block that can be partitioned using only quadtree partitioning. Information indicating the maximum / minimum sizes of the coding block that allow quadtree partitioning can be signaled via the bitstream and can be signaled in at least one of a sequence, a picture parameter, a tile group, or a slice (segment). Alternatively, the maximum / minimum sizes of the coding block can be fixed sizes predetermined by the encoder / decoder. For example, when the size of the coding block corresponds to 256×256 to 64×64, it is possible to partition using only quadtree partitioning. Alternatively, when the size of the coding block is larger than the size of the largest transform block, it is possible to partition using only quadtree partitioning. 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 the coding block falls within the predetermined range, it is possible to partition using only binary or ternary tree partitioning. In this case, the above description of the quadtree partition can be applied to the binary tree partition or the ternary tree partition in the same manner.
[0077] Coding tree block: may be used as a term for designating any one of a Y coding tree block, a Cb coding tree block, and a Cr coding tree block.
[0078] Neighboring blocks: These may represent blocks adjacent to the current block. These blocks may be blocks that touch the boundary of the current block or are located within a predetermined distance from the current block. These blocks may be blocks adjacent to vertices of the current block. Here, blocks adjacent to vertices of the current block may be blocks that are vertically adjacent to a neighboring block horizontally adjacent to the current block, or blocks that are horizontally adjacent to a neighboring block vertically adjacent to the current block.
[0079] Reconstructed Neighboring Block: This refers to a neighboring block that is adjacent to the current block and has already been spatially or temporally encoded or decoded. Here, a reconstructed neighboring block may refer to a reconstructed neighboring unit. A reconstructed spatial neighboring block may be a block within the current picture that has been reconstructed through encoding or decoding, or both. A reconstructed temporal neighboring block is a block within a reference image that is located at a position corresponding to the current block in the current picture, or a neighboring block of the current block.
[0080] Unit depth: may represent the degree of partitioning of a unit. In a tree structure, the highest node (root node) may correspond to the first unit that has not been partitioned. In addition, the highest node may have the minimum depth value. In this case, the depth of the highest node may be level 0. A node with a depth of level 1 may represent a unit generated by partitioning the first unit once. A node with a depth of level 2 may represent a unit generated by partitioning the first unit twice. A node with a depth of level n may represent a unit generated by partitioning the first unit n times. A leaf node may be the lowest node and a node that cannot be further partitioned. The depth of a leaf node may be the maximum level. For example, the predefined value of the maximum level may be 3. The depth of the root node may be the lowest, and the depth of the leaf node may be the deepest. In addition, when a unit is represented as a tree structure, the level at which the unit exists may represent the unit depth.
[0081] Bitstream: can represent a bit stream containing coded image information.
[0082] Parameter set: Corresponds to header information within the configuration within the bitstream. A parameter set may include at least one of a video parameter set, a sequence parameter set, a picture parameter set, and an adaptation parameter set. Furthermore, a parameter set may include a slice header, a tile group header, and tile header information. The term "tile group" refers to a group of tiles and has the same meaning as a slice.
[0083] An adaptation parameter set is a parameter set that can be shared and referenced by different pictures, sub-pictures, slices, tile groups, tiles, or bricks. Furthermore, sub-pictures, slices, tile groups, tiles, or bricks within a picture can reference different adaptation parameter sets to utilize information from different adaptation parameter sets.
[0084] Regarding the adaptation parameter sets, a sub-picture, a slice, a tile group, a tile, or a partition in a picture can refer to different adaptation parameter sets by using the identifier of the corresponding adaptation parameter set.
[0085] Regarding the adaptation parameter sets, a slice, a tile group, a tile, or a partition in a sub-picture can refer to different adaptation parameter sets by using the identifier of the corresponding adaptation parameter set.
[0086] Regarding the adaptation parameter set, a tile or partition in a slice can refer to a different adaptation parameter set by using the identifier of the corresponding adaptation parameter set.
[0087] Regarding the adaptation parameter sets, partitions in a tile can refer to different adaptation parameter sets by using the identifiers of the corresponding adaptation parameter sets.
[0088] The parameter set or header of the sub-picture may include information about the adaptation parameter set identifier. Therefore, the adaptation parameter set corresponding to the adaptation parameter set identifier can be used in the sub-picture.
[0089] The parameter set or header of the tile may include an adaptation parameter set identifier so that the adaptation parameter set corresponding to the adaptation parameter set identifier may be used in the tile.
[0090] The header of the partition may include information about the adaptation parameter set identifier so that the adaptation parameter set corresponding to the adaptation parameter set identifier can be used in the partition.
[0091] A picture may be divided into one or more tile rows and one or more tile columns.
[0092] A sub-picture in a picture can be divided into one or more tile rows and one or more tile columns. A sub-picture can be a rectangular or square area in the picture and can include one or more CTUs. A sub-picture can include at least one tile, partition, and / or slice.
[0093] A tile may be a rectangular area or a square area in a picture and may include one or more CTUs. A tile may be divided into one or more partitions.
[0094] A partition may refer to one or more CTU rows in a tile. A tile may be divided into one or more partitions, and each partition may have at least one CTU row. A tile that is not divided into two or more partitions may also be referred to as a partition.
[0095] A slice may include one or more tiles in a picture and may include one or more partitions in a tile.
[0096] Parsing: may refer to determining the value of a syntax element by performing entropy decoding, or may refer to the entropy decoding itself.
[0097] Symbol: can represent at least one of the syntax elements, coding parameters, and transform coefficient values of the encoding / decoding target unit. In addition, the symbol can represent the entropy encoding target or the entropy decoding result.
[0098] Prediction mode: may be information indicating a mode for encoding / decoding using intra-frame prediction or a mode for encoding / decoding using inter-frame prediction.
[0099] Prediction unit: This refers to the basic unit used when performing predictions such as inter-frame prediction, intra-frame prediction, inter-frame compensation, intra-frame compensation, and motion compensation. A single prediction unit can be partitioned into multiple partitions of smaller sizes, or into multiple prediction units of lower levels. Multiple partitions can be the basic unit used when performing prediction or compensation. Partitions generated by splitting a prediction unit can also be prediction units.
[0100] Prediction unit partition: may represent a shape obtained by partitioning a prediction unit.
[0101] Reference picture list: may refer to a list of one or more reference pictures used for inter prediction or motion compensation. There are several types of reference picture lists available, including LC (List Combination), L0 (List 0), L1 (List 1), L2 (List 2), and L3 (List 3).
[0102] Inter prediction indicator: This may indicate the direction of inter prediction for the current block (unidirectional prediction, bidirectional prediction, etc.). Alternatively, the inter prediction indicator may indicate the number of reference pictures used to generate the prediction block for the current block. Alternatively, the inter prediction indicator may indicate the number of prediction blocks used when performing inter prediction or motion compensation on the current block.
[0103] 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 prediction indicator, and conversely, the inter prediction indicator can be used to derive the prediction list utilization flag. For example, when the prediction list utilization flag has a first value of zero (0), it indicates that the reference pictures in the reference picture list are not used to generate the prediction block. On the other hand, when the prediction list utilization flag has a second value of one (1), it indicates that the reference picture list is used to generate the prediction block.
[0104] Reference picture index: may refer to an index indicating a specific reference picture in a reference picture list.
[0105] Reference picture: This refers to a picture referenced by a specific block for the purpose of inter-frame prediction or motion compensation of the specific block. Alternatively, the reference picture may be a picture including a reference block referenced by the current block for inter-frame prediction or motion compensation. Hereinafter, the terms "reference picture" and "reference image" have the same meaning and are interchangeable.
[0106] Motion Vector: This can be a two-dimensional vector used for inter-frame prediction or motion compensation. A motion vector can represent the offset between the encoding / decoding target block and the reference block. For example, (mvX, mvY) can represent a motion vector. Here, mvX can represent the horizontal component, and mvY can represent the vertical component.
[0107] Search range: can be a two-dimensional area that is searched to retrieve a motion vector during inter prediction. For example, the size of the search range can be M×N. Here, M and N are both integers.
[0108] Motion vector candidate: may refer to a prediction candidate block or a motion vector of a prediction candidate block when predicting a motion vector. In addition, a motion vector candidate may be included in a motion vector candidate list.
[0109] Motion vector candidate list: may represent a list consisting of one or more motion vector candidates.
[0110] Motion vector candidate index: may represent an indicator indicating a motion vector candidate in a motion vector candidate list. Alternatively, it may be an index of a motion vector predictor.
[0111] Motion information: may indicate information including at least one of items including a motion vector, a reference picture index, an inter prediction indicator, a prediction list utilization flag, reference picture list information, a reference picture, a motion vector candidate, a motion vector candidate index, a merge candidate, and a merge index.
[0112] Merge candidate list: may represent a list consisting of one or more merge candidates.
[0113] Merge candidate: can represent spatial merge candidate, temporal merge candidate, combined merge candidate, combined bi-predictive merge candidate or zero merge candidate. Merge candidate can include motion information such as inter prediction indicator, reference picture index of each list, motion vector, prediction list utilization flag and inter prediction indicator.
[0114] Merge Index: This may represent an indicator indicating a merge candidate in a merge candidate list. Alternatively, the merge index may indicate a block in a reconstructed block that is spatially / temporally adjacent to the current block, from which the merge candidate was derived. Alternatively, the merge index may indicate at least one piece of motion information for the merge candidate.
[0115] Transform unit: This refers to a basic unit used when encoding / decoding a residual signal (such as transform, inverse transform, quantization, inverse quantization, and transform coefficient encoding / decoding). A single transform unit can be partitioned into multiple lower-level transform units of smaller sizes. Transform / inverse transform may include at least one of a primary transform / primary inverse transform and a secondary transform / secondary inverse transform.
[0116] Scaling: This refers to the process of multiplying the quantization level by a factor. Transform coefficients can be generated by scaling the quantization level. Scaling can also be called inverse quantization.
[0117] Quantization parameter: This may indicate the value used when generating the quantization level using the transform coefficient during quantization. It may also indicate the value used when generating the transform coefficient by scaling the quantization level during inverse quantization. The quantization parameter may be a value mapped to the quantization step size.
[0118] Delta quantization parameter: may represent the difference between the predicted quantization parameter and the quantization parameter of the encoding / decoding target unit.
[0119] Scan: This refers to a method of sorting coefficients within a cell, block, or matrix. For example, changing a two-dimensional matrix of coefficients to a one-dimensional matrix can be called a scan, and changing a one-dimensional matrix of coefficients to a two-dimensional matrix can be called a scan or an inverse scan.
[0120] Transform coefficient: This term may refer to a coefficient value generated after a transform is performed in an encoder. A transform coefficient may refer to a coefficient value generated after at least one of entropy decoding and inverse quantization is performed in a decoder. A transform coefficient also includes a quantization level obtained by quantizing a transform coefficient or a residual signal, or a quantized transform coefficient level.
[0121] Quantization level: This refers to the value generated by quantizing transform coefficients or residual signals in an encoder. Alternatively, the quantization level may refer to a value that is a target for inverse quantization in a decoder. Similarly, the level of quantized transform coefficients, which are the result of transformation and quantization, also falls within the meaning of the quantization level.
[0122] Non-zero transform coefficient: may refer to a transform coefficient having a value other than zero, or a transform coefficient level or quantization level having a value other than zero.
[0123] Quantization Matrix: This refers to a matrix used in a quantization process or an inverse quantization process performed to improve subjective or objective image quality. The quantization matrix may also be referred to as a scaling list.
[0124] Quantization matrix coefficients: These represent each element in the quantization matrix. Quantization matrix coefficients are also called matrix coefficients.
[0125] Default matrix: may represent a predetermined quantization matrix predefined in an encoder or decoder.
[0126] Non-default matrix: may represent a quantization matrix that is not pre-defined in the encoder or decoder but is signaled by the user.
[0127] Statistical value: The statistical value for at least one of a variable, coding parameter, constant value, etc. having a calculable 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, and interpolation value of the corresponding specific value.
[0128] Figure 1 is a block diagram showing a configuration of an encoding device according to an embodiment to which the present invention is applied.
[0129] The encoding device 100 may be an encoder, a video encoding device, or an image encoding device. A video may include at least one image. The encoding device 100 may sequentially encode at least one image.
[0130] Reference Figure 1 , the encoding device 100 may include a motion prediction unit 111, a motion compensation unit 112, an intra-frame prediction unit 120, a switch 115, a subtractor 125, a transform unit 130, a quantization unit 140, an entropy encoding unit 150, an inverse quantization unit 160, an inverse transform unit 170, an adder 175, a filter unit 180 and a reference picture buffer 190.
[0131] The encoding device 100 can perform encoding of an input image by using intra mode or inter mode, or both intra mode and inter mode. In addition, the encoding device 100 can generate a bit stream including encoding information by encoding the input image, and output the generated bit stream. The generated bit stream can be stored in a computer-readable recording medium, or can be streamed via a wired / wireless transmission medium. When intra mode is used as the prediction mode, the switch 115 can switch to intra mode. Alternatively, when inter mode is used as the prediction mode, the switch 115 can switch to inter mode. Here, intra mode may refer to intra prediction mode, and inter mode may refer to inter prediction mode. The encoding device 100 can generate a prediction block for an input block of the input image. In addition, after generating the prediction block, the encoding device 100 can encode a residual block using the residual of the input block and the prediction block. The input image can be referred to as the current image that is the current encoding target. The input block can be referred to as the current block that is the current encoding target, or as the encoding target block.
[0132] When the prediction mode is intra mode, the intra prediction unit 120 may use samples of a block that has been encoded / decoded and is adjacent to the current block as reference samples. The intra prediction unit 120 may perform spatial prediction on the current block using the reference samples, or may generate prediction samples of the input block by performing spatial prediction. Here, intra prediction may refer to prediction within a frame.
[0133] When the prediction mode is inter mode, the motion prediction unit 111 may retrieve the area that best matches the input block from the reference image when performing motion prediction, and derive a motion vector by using the retrieved area. In this case, the search area may be used as the area. The reference image may be stored in the reference picture buffer 190. Here, when encoding / decoding the reference image, the reference image may be stored in the reference picture buffer 190.
[0134] The motion compensation unit 112 may generate a prediction block by performing motion compensation on the current block using a motion vector. Here, inter prediction may refer to prediction or motion compensation between frames.
[0135] When the value of the motion vector is not an integer, the motion prediction unit 111 and the motion compensation unit 112 may generate a prediction block by applying an interpolation filter to a partial area of a reference picture. To perform inter-picture prediction or motion compensation on a coding unit, it may be determined which mode among skip mode, merge mode, advanced motion vector prediction (AMVP) mode, and current picture reference mode is used for motion prediction and motion compensation of the prediction unit included in the corresponding coding unit. Then, inter-picture prediction or motion compensation may be performed differently depending on the determined mode.
[0136] The subtractor 125 may generate a residual block by using the difference between the input block and the prediction block. The residual block may be referred to as a residual signal. The residual signal may represent the difference between the original signal and the prediction signal. In addition, the residual signal may be a signal generated by transforming or quantizing, or transforming and quantizing, the difference between the original signal and the prediction signal. The residual block may be a residual signal of a block unit.
[0137] The transform unit 130 may generate a transform coefficient by performing a transform on the residual block and output the generated transform coefficient. Here, the transform coefficient may be a coefficient value generated by performing a transform on the residual block. When the transform skip mode is applied, the transform unit 130 may skip transforming the residual block.
[0138] The quantization level may be generated by applying quantization to a transform coefficient or to a residual signal. Hereinafter, the quantization level may also be referred to as a transform coefficient in embodiments.
[0139] The quantization unit 140 may generate a quantization level by quantizing the transform coefficient or the residual signal according to the parameter and output the generated quantization level. Here, the quantization unit 140 may quantize the transform coefficient by using a quantization matrix.
[0140] The entropy coding unit 150 may generate a bitstream by performing entropy coding on the value calculated by the quantization unit 140 or the coding parameter value calculated when performing coding according to the probability distribution, and output the generated bitstream. The entropy coding unit 150 may perform entropy coding on sample information of an image and information for decoding the image. For example, the information for decoding the image may include syntax elements.
[0141] When entropy coding is applied, symbols are represented so that a smaller number of bits are allocated to symbols with a high probability of generation, and a larger number of bits are allocated to symbols with a low probability of generation, thereby reducing the size of the bit stream for the symbols to be encoded. The entropy coding unit 150 may use a coding method for entropy coding such as exponential Golomb, context-adaptive variable length coding (CAVLC), context-adaptive binary arithmetic coding (CABAC), etc. For example, the entropy coding unit 150 may perform entropy coding by using a variable length coding / code (VLC) table. In addition, the entropy coding unit 150 may derive a binarization method of the target symbol and a probability model of the target symbol / binary bit, and perform arithmetic coding by using the derived binarization method and context model.
[0142] In order to encode transform coefficient levels (quantized levels), the entropy encoding unit 150 may change coefficients in a two-dimensional block form into a one-dimensional vector form by using a transform coefficient scanning method.
[0143] The coding parameters may include information such as syntax elements (flags, indexes, etc.) that are encoded in the encoder and sent to the decoder using a signal, as well as information derived when performing encoding or decoding. The coding parameters may represent information required when encoding or decoding an image. For example, at least one value or combination of the following items may be included in the coding parameters: unit / block size, unit / block depth, unit / block partition information, unit / block shape, unit / block partition structure, whether quadtree partitioning is performed, whether binary tree partitioning is performed, binary tree partition direction (horizontal or vertical), binary tree partition form (symmetric partitioning or asymmetric partitioning), whether the current coding unit is partitioned by ternary tree partitioning, the direction of ternary tree partitioning (horizontal or vertical), the type of ternary tree partitioning (symmetric type or asymmetric type), whether the current coding unit is partitioned by multi-type tree partitioning, the direction of multi-type tree partitioning direction (horizontal or vertical), type of multi-type tree partition (symmetric or asymmetric), tree (binary tree or ternary tree) structure of multi-type tree partition, prediction mode (intra-frame prediction or inter-frame prediction), luminance intra-frame prediction mode / direction, chrominance intra-frame prediction mode / direction, intra-frame partition information, inter-frame partition information, coding block partition flag, prediction block partition flag, transform block partition flag, reference sample filtering method, reference sample filter taps, reference sample filter coefficients, prediction block filtering method, prediction block filter taps, prediction block filter coefficients, prediction block boundary filtering method, prediction block boundary filter taps, prediction block boundary filter coefficients, intra-frame prediction mode, Inter prediction mode, motion information, motion vector, motion vector difference, reference picture index, inter prediction angle, inter prediction indicator, prediction list utilization flag, reference picture list, reference picture, motion vector predictor index, motion vector predictor candidate, motion vector candidate list, whether to use merge mode, merge index, merge candidate, merge candidate list, whether to use skip mode, interpolation filter type, interpolation filter taps, interpolation filter coefficients, motion vector size, representation accuracy of motion vector, transform type, transform size, information on whether the first (first) transform is used, information on whether the second transform is used, first transform index, second transform index , information on whether a residual signal exists, coding block pattern, coding block flag (CBF), quantization parameter, quantization parameter residual, quantization matrix, whether to apply an intra-frame loop filter, intra-frame loop filter coefficients, intra-frame loop filter taps, intra-frame loop filter shape / form, whether to apply a deblocking filter, deblocking filter coefficients, deblocking filter taps, deblocking filter strength, deblocking filter shape / form, whether to apply adaptive sample offset, adaptive sample offset value, adaptive sample offset category, adaptive sample offset type, whether to apply an adaptive loop filter, adaptive loop filter coefficients, adaptive loop filter taps, adaptive loop filter shape / form,Binarization / debinarization method, context model determination method, context model updating method, whether to execute normal mode, whether to execute bypass mode, context binary bit, bypass binary bit, significant coefficient flag, last significant coefficient flag, coding flag for unit of coefficient group, position of last significant coefficient, flag on whether the value of coefficient is greater than 1, flag on whether the value of coefficient is greater than 2, flag on whether the value of coefficient is greater than 3, information on remaining coefficient values, sign information, reconstructed luminance sample, reconstructed chrominance sample, residual luminance sample, residual chrominance sample, luminance transform coefficient, chrominance transform coefficient, quantized luminance level, quantized chrominance level, transform coefficient level scanning method, motion vector search area at decoder side domain size, shape of a motion vector search area at the decoder side, number of motion vector searches at the decoder side, information on a CTU size, information on a minimum block size, information on a maximum block size, information on a maximum block depth, information on a minimum block depth, image display / output order, slice identification information, slice type, slice partition information, tile identification information, tile type, tile partition information, tile group identification information, tile group type, tile group partition information, picture type, bit depth of input samples, bit depth of reconstructed samples, bit depth of residual samples, bit depth of transform coefficients, bit depth of quantization levels, and information on a luminance signal or information on a chrominance signal.
[0144] Here, signaling a flag or an index may mean entropy encoding the corresponding flag or index by an encoder and including it in a bitstream, and may mean entropy decoding the corresponding flag or index from the bitstream by a decoder.
[0145] When the encoding apparatus 100 performs encoding by inter-frame prediction, the current image being encoded can be used as a reference image for another image to be processed subsequently. Therefore, the encoding apparatus 100 can reconstruct or decode the current image being encoded, or store the reconstructed or decoded image as a reference image in the reference picture buffer 190.
[0146] The quantization level may be inversely quantized in the inverse quantization unit 160 or inversely transformed in the inverse transform unit 170. The inversely quantized or inversely transformed coefficient or the inversely quantized and inversely transformed coefficient may be added to the prediction block by the adder 175. By adding the inversely quantized or inversely transformed coefficient or the inversely quantized and inversely transformed coefficient to the prediction block, a reconstructed block may be generated. Here, the inversely quantized or inversely transformed coefficient or the inversely quantized and inversely transformed coefficient may mean a coefficient on which at least one of inverse quantization and inverse transformation has been performed, and may mean a reconstructed residual block.
[0147] The reconstructed block may pass through the filter unit 180. The filter unit 180 may apply at least one of a deblocking filter, a sample adaptive offset (SAO), and an adaptive loop filter (ALF) to the reconstructed samples, the reconstructed block, or the reconstructed image. The filter unit 180 may be referred to as an in-loop filter.
[0148] A deblocking filter can remove block distortion generated at the boundaries between blocks. To determine whether to apply the deblocking filter, the determination of whether to apply the deblocking filter to the current block can be made based on the samples included in a number of rows or columns included in the block. When the deblocking filter is applied to the block, another filter can be applied according to the desired deblocking filter strength.
[0149] To compensate for coding errors, sample adaptive offset can be used to add an appropriate offset value to the sample value. Sample adaptive offset can correct the offset between the deblocked image and the original image on a sample-by-sample basis. A method can be used to apply the offset by considering edge information about each sample, or a method can be used in which the samples of the image are partitioned into a predetermined number of regions, the regions to which the offset is applied are determined, and the offset is applied to the determined regions.
[0150] The adaptive loop filter can perform filtering based on the comparison result of 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 ALF can be signaled by the coding unit (CU), and the form and coefficient of the ALF to be applied to each block can be varied.
[0151] The reconstructed block or reconstructed image that has passed through the filter unit 180 may be stored in the reference picture buffer 190. The reconstructed block processed by the filter unit 180 may be part of a reference image. That is, the reference image is a reconstructed image composed of the reconstructed blocks processed by the filter unit 180. The stored reference image may be used later in inter-frame prediction or motion compensation.
[0152] Figure 2 is a block diagram showing the configuration of a decoding device according to an embodiment and to which the present invention is applied.
[0153] The decoding device 200 may be a decoder, a video decoding device, or an image decoding device.
[0154] Reference Figure 2 , the decoding apparatus 200 may include an entropy decoding unit 210 , an inverse quantization unit 220 , an inverse transform unit 230 , an intra prediction unit 240 , a motion compensation unit 250 , an adder 255 , a filter unit 260 , and a reference picture buffer 270 .
[0155] The decoding device 200 may receive the bitstream output from the encoding device 100. The decoding device 200 may receive the bitstream stored in a computer-readable recording medium, or may receive the bitstream streamed via a wired / wireless transmission medium. The decoding device 200 may decode the bitstream using an intra-frame mode or an inter-frame mode. In addition, the decoding device 200 may generate a reconstructed image or a decoded image generated by decoding, and output the reconstructed image or the decoded image.
[0156] When the prediction mode used at the time of decoding is the intra mode, the switch may be switched to the intra mode. Alternatively, when the prediction mode used at the time of decoding is the inter mode, the switch may be switched to the inter mode.
[0157] The decoding device 200 can obtain a reconstructed residual block by decoding the input bit stream and generate a prediction block. When the reconstructed residual block and the prediction block are obtained, the decoding device 200 can generate a reconstructed block that becomes the decoding target by adding the reconstructed residual block to the prediction block. The decoding target block may be referred to as the current block.
[0158] The entropy decoding unit 210 may generate symbols by entropy decoding the bit stream according to the probability distribution. The generated symbols may include symbols in the form of quantized levels. Here, the entropy decoding method may be an inverse process of the above entropy encoding method.
[0159] In order to decode transform coefficient levels (quantized levels), the entropy decoding unit 210 may change coefficients in a unidirectional vector form into a two-dimensional block form by using a transform coefficient scanning method.
[0160] The quantized levels may be inversely quantized in the inverse quantization unit 220, or inversely transformed in the inverse transform unit 230. The quantized levels may be the result of inverse quantization or inverse transformation, or both, and may be generated as a reconstructed residual block. Here, the inverse quantization unit 220 may apply a quantization matrix to the quantized levels.
[0161] When the intra mode is used, the intra prediction unit 240 may generate a predicted block by performing spatial prediction on the current block, wherein the spatial prediction uses sample values of blocks that are adjacent to the decoding target block and have already been decoded.
[0162] When the inter mode is used, the motion compensation unit 250 may generate a prediction block by performing motion compensation on the current block, wherein the motion compensation uses a motion vector and a reference image stored in the reference picture buffer 270 .
[0163] The adder 225 can generate a reconstructed block by adding the reconstructed residual block to the prediction block. The filter unit 260 can apply at least one of a deblocking filter, a sample adaptive offset, and an adaptive loop filter to the reconstructed block or reconstructed image. The filter unit 260 can output the reconstructed image. The reconstructed block or reconstructed image can be stored in the reference picture buffer 270 and used when performing inter-frame prediction. The reconstructed block processed by the filter unit 260 can be part of a reference image. In other words, the reference image is a reconstructed image composed of the reconstructed blocks processed by the filter unit 260. The stored reference image can be used later in inter-frame prediction or motion compensation.
[0164] Figure 3 is a diagram schematically illustrating a partition structure of an image when encoding and decoding the image. Figure 3 An example of partitioning a single cell into multiple lower-level cells is schematically shown.
[0165] In order to efficiently partition an image, a coding unit (CU) may be used when encoding and decoding. A coding unit may be used as a basic unit when encoding / decoding an image. In addition, a coding unit may be used as a unit for distinguishing between an intra-frame prediction mode and an inter-frame prediction mode when encoding / decoding an image. A coding unit may be a basic unit for prediction, transformation, quantization, inverse transformation, inverse quantization, or encoding / decoding processing of a transform coefficient.
[0166] Reference Figure 3 , the image 300 is sequentially partitioned according to the largest coding unit (LCU), and the LCU unit is determined as a partition structure. Here, LCU can be used in the same meaning as the coding tree unit (CTU). Unit partitioning may mean partitioning the block associated with the unit. In the block partition information, unit depth information may be included. The depth information may indicate the number or degree of partitioning of the unit, or both the number and degree of partitioning of the unit. A single unit may be partitioned into multiple lower-level units hierarchically associated with depth information based on a tree structure. In other words, the unit and the lower-level units generated by partitioning the unit may correspond to a node and a child node of the node, respectively. Each of the partitioned lower-level units may have depth information. The depth information may be information indicating the size of a CU and may be stored in each CU. The unit depth indicates the number and / or degree associated with partitioning the unit. Therefore, the partition information of the lower-level unit may include information about the size of the lower-level unit.
[0167] The partition structure may indicate the distribution of coding units (CUs) within LCU 310. This distribution may be determined based on whether a single CU is partitioned into multiple CUs (including 2, 4, 8, 16, and other positive integers equal to or greater than 2). The horizontal and vertical sizes of the CU generated by partitioning may be half the horizontal and vertical sizes of the CU before partitioning, or may be smaller than the horizontal and vertical sizes before partitioning, depending on the number of partitioning operations. A CU may be recursively partitioned into multiple CUs. Recursive partitioning may reduce at least one of the height and width of the CU after partitioning compared to at least one of the height and width of the CU before partitioning. CU partitioning may be recursively performed until a predefined depth or predefined size is reached. For example, the depth of an LCU may be 0, and the depth of a smallest coding unit (SCU) may be a predefined maximum depth. As described above, an LCU may be a coding unit with the largest coding unit size, and an SCU may be a coding unit with the smallest coding unit size. Partitioning starts from the LCU 310. When the horizontal size or vertical size, or both the horizontal size and the vertical size of the CU are reduced by partitioning, the CU depth increases by 1. For example, the size of a non-partitioned CU can be 2N×2N for each depth. In addition, in the case of a partitioned CU, a CU of size 2N×2N can be partitioned into four CUs of size N×N. As the depth increases by 1, the size of N can be halved.
[0168] In addition, information on whether a CU is partitioned can be indicated by using its partition information. The partition information can be 1-bit information. All CUs except the SCU can include partition information. For example, when the partition information value is a first value, the CU may not be partitioned, and when the partition information value is a second value, the CU may be partitioned.
[0169] Reference Figure 3 , an LCU with a depth of 0 may be a 64×64 block. 0 may be the minimum depth. An SCU with a depth of 3 may be an 8×8 block. 3 may be the maximum depth. CUs with a 32×32 block and a 16×16 block may be denoted as depth 1 and depth 2, respectively.
[0170] For example, when a single coding unit is partitioned into four coding units, the horizontal and vertical sizes of the four partitioned coding units may be half the horizontal and vertical sizes of the CU before partitioning. In one embodiment, when a coding unit of size 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 can be said that the coding unit can be partitioned into a quadtree form.
[0171] For example, when one coding unit is partitioned into two sub-coding units, the horizontal size or vertical size (width or height) of each of the two sub-coding units may be half the horizontal size or vertical size of the original coding unit. For example, when a coding unit of size 32×32 is partitioned vertically into two sub-coding units, each of the two sub-coding units may have a size of 16×32. For example, when a coding unit of size 8×32 is partitioned horizontally into two sub-coding units, each of the two sub-coding units may have a size of 8×16. When one coding unit is partitioned into two sub-coding units, the coding unit may be said to be partitioned into two or partitioned according to a binary tree partition structure.
[0172] For example, when a coding unit is partitioned into three sub-coding units, the horizontal size or vertical size of the coding unit may be partitioned in a ratio of 1:2:1, thereby generating three sub-coding units having a ratio of 1:2:1 in terms of the horizontal size or vertical size. For example, when a coding unit having a size of 16×32 is partitioned horizontally into three sub-coding units, the three sub-coding units may have sizes of 16×8, 16×16, and 16×8, respectively, in order from the uppermost sub-coding unit to the lowermost sub-coding unit. For example, when a coding unit having a size of 32×32 is partitioned vertically into three sub-coding units, the three sub-coding units may have sizes of 8×32, 16×32, and 8×32, respectively, in order from the left sub-coding unit to the right sub-coding unit. When a coding unit is partitioned into three sub-coding units, the coding unit may be said to be partitioned into three or partitioned according to a ternary tree partition structure.
[0173] exist Figure 3 , a coding tree unit (CTU) 320 is an example of a CTU to which a quadtree partition structure, a binary tree partition structure, and a ternary tree partition structure are all applied.
[0174] As described above, to partition a CTU, at least one of a quadtree partition structure, a binary tree partition structure, and a ternary tree partition structure may be applied. The various tree partition structures may be sequentially applied to the CTU according to a predetermined priority order. For example, the quadtree partition structure may be preferentially applied to the CTU. Coding units that can no longer be partitioned using the quadtree partition structure may correspond to leaf nodes of the quadtree. Coding units corresponding to leaf nodes of the quadtree may serve as root nodes of the binary and / or ternary tree partition structures. In other words, coding units corresponding to leaf nodes of the quadtree may be further partitioned according to the binary or ternary tree partition structure, or may not be further partitioned. Therefore, by preventing coding blocks resulting from binary or ternary tree partitioning of coding units corresponding to leaf nodes of the quadtree from undergoing further quadtree partitioning, block partitioning operations and / or operations for signaling partition information may be efficiently performed.
[0175] The fact that the coding unit corresponding to the node of the quadtree is partitioned can be signaled using the four partition information. The four partition information having a first value (e.g., "1") can indicate that the current coding unit is partitioned according to the quadtree partition structure. The four partition information having a second value (e.g., "0") can indicate that the current coding unit is not partitioned according to the quadtree partition structure. The four partition information can be a flag with a predetermined length (e.g., one bit).
[0176] There may be no priority between binary tree partitioning and ternary tree partitioning. That is, the coding unit corresponding to the leaf node of the quadtree may be further partitioned by either binary tree partitioning or ternary tree partitioning. In addition, the coding unit generated by binary tree partitioning or ternary tree partitioning may be further partitioned by binary tree partitioning or ternary tree partitioning, or may not be further partitioned.
[0177] A tree structure in which there is no priority between binary tree partitioning and ternary tree partitioning is called a multi-type tree structure. The coding unit corresponding to the leaf node of the quadtree can be used as the root node of the multi-type tree. At least one of the multi-type tree partition indication information, partition direction information, and partition tree information can be used to signal whether to partition the coding unit corresponding to the node of the multi-type tree. In order to partition the coding unit corresponding to the node of the multi-type tree, the multi-type tree partition indication information, partition direction information, and partition tree information can be sequentially signaled.
[0178] The multi-type tree partition indication information having a first value (e.g., '1') may indicate that the current coding unit will undergo multi-type tree partitioning. The multi-type tree partition indication information having a second value (e.g., '0') may indicate that the current coding unit will not undergo multi-type tree partitioning.
[0179] When a coding unit corresponding to a node of a multi-type tree is further partitioned according to a multi-type tree partition structure, the coding unit may include partition direction information. The partition direction information may indicate in which direction the current coding unit will be partitioned for the multi-type tree partition. Partition direction information having a first value (e.g., "1") may indicate that the current coding unit will be partitioned vertically. Partition direction information having a second value (e.g., "0") may indicate that the current coding unit will be partitioned horizontally.
[0180] When the coding unit corresponding to the node of the multi-type tree is further partitioned according to the multi-type tree partition structure, the current coding unit may include partition tree information. The partition tree information may indicate the tree partition structure to be used to partition the node of the multi-type tree. The partition tree information having a first value (e.g., "1") may indicate that the current coding unit will be partitioned according to the binary tree partition structure. The partition tree information having a second value (e.g., "0") may indicate that the current coding unit will be partitioned according to the ternary tree partition structure.
[0181] The partition indication information, the partition tree information, and the partition direction information may all be flags having a predetermined length (eg, one bit).
[0182] At least any one of quadtree partition indication information, multi-type tree partition indication information, partition direction information, and partition tree information may be entropy encoded / decoded. In order to entropy encode / decode those types of information, information about neighboring coding units adjacent to the current coding unit may be used. For example, there is a high probability that the partition type (partitioned or not partitioned, partition tree, and / or partition direction) of the left neighboring coding unit and / or the upper neighboring coding unit of the current coding unit is similar to the partition type of the current coding unit. Therefore, context information for entropy encoding / decoding information about the current coding unit may be derived from the information about the neighboring coding units. The information about the neighboring coding units may include at least any one of quadtree partition information, multi-type tree partition indication information, partition direction information, and partition tree information.
[0183] As another example, between binary tree partitioning and ternary tree partitioning, binary tree partitioning may be performed preferentially. That is, the current coding unit may first undergo binary tree partitioning, and then the coding unit corresponding to the leaf node of the binary tree may be set as the root node for the ternary tree partitioning. In this case, for the coding unit corresponding to the node of the ternary tree, neither quadtree partitioning nor binary tree partitioning may be performed.
[0184] A coding unit that cannot be partitioned according to a quadtree partition structure, a binary tree partition structure, and / or a ternary tree partition structure becomes a basic unit for encoding, prediction, and / or transformation. That is, the coding unit cannot be further partitioned for prediction and / or transformation. Therefore, partition structure information and partition information for partitioning a coding unit into prediction units and / or transformation units may not exist in the bitstream.
[0185] 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 may be recursively partitioned until the size of the coding unit is reduced to be equal to or smaller than the size of the maximum transform block. For example, when the size of the coding unit is 64×64 and the size of the maximum transform block is 32×32, the coding unit may be partitioned into four 32×32 blocks for transforming. For example, when the size of the coding unit is 32×64 and the size of the maximum transform block is 32×32, the coding unit may be partitioned into two 32×32 blocks for transforming. In this case, the transform-specific partitioning of the coding unit is not separately signaled and may 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 may be vertically bisected. For example, when the vertical size (length) of the coding unit is larger than the vertical size (length) of the maximum transform block, the coding unit may be horizontally bisected.
[0186] Information about the maximum and / or minimum size of a coding unit and information about the maximum and / or minimum size of a transform block may be signaled or determined at a higher level of the coding unit. The higher level may be, for example, a sequence level, a picture level, a slice level, a tile group level, a tile level, etc. For example, the minimum size of a coding unit may be determined to be 4×4. For example, the maximum size of a transform block may be determined to be 64×64. For example, the minimum size of a transform block may be determined to be 4×4.
[0187] Information on the minimum size of the coding unit corresponding to the leaf node of the quadtree (quadtree minimum size) and / or information on the maximum depth from the root node to the leaf node of the multi-type tree (maximum tree depth of the multi-type tree) may be signaled or determined at a higher level of the coding unit. For example, the higher level may be a sequence level, a picture level, a slice level, a tile group level, a tile level, etc. Information on the minimum size of the quadtree and / or information on the maximum depth of the multi-type tree may be signaled or determined for each of the intra-picture slice and the inter-picture slice.
[0188] The difference between the size of the CTU and the maximum size of the transform block may be signaled or determined at a higher level for the coding unit. For example, the higher level may be the sequence level, picture level, slice level, tile group level, tile level, etc. Information regarding the maximum size of the coding unit corresponding to each node of the binary tree (hereinafter referred to as the maximum size of the binary tree) may be determined based on the size of the coding tree unit and the difference information. The maximum size of the coding unit corresponding to each node of the ternary tree (hereinafter referred to as the maximum size of the ternary tree) may vary depending on the slice type. For example, for intra-picture slices, the maximum size of the ternary tree may be 32×32. For example, for inter-picture slices, the maximum size of the ternary tree may be 128×128. For example, the minimum size of the coding unit corresponding to each node of the binary tree (hereinafter referred to as the minimum size of the binary tree) and / or the minimum size of the coding unit corresponding to each node of the ternary tree (hereinafter referred to as the minimum size of the ternary tree) may be set to the minimum size of the coding block.
[0189] As another example, the maximum size of the binary tree and / or the maximum size of the ternary tree may be signaled or determined at the slice level. Alternatively, the minimum size of the binary tree and / or the minimum size of the ternary tree may be signaled or determined at the slice level.
[0190] According to the size and depth information of the various blocks described above, quad partition information, multi-type tree partition indication information, partition tree information and / or partition direction information may or may not be included in the bitstream.
[0191] For example, when the size of the coding unit is not greater than the minimum size of the quadtree, the coding unit does not include the quad partition information. Therefore, the quad partition information can be inferred from the second value.
[0192] For example, when the size (horizontal size and vertical size) of the coding unit corresponding to the node of the multi-type tree is larger than the maximum size (horizontal size and vertical size) of the binary tree and / or the maximum size (horizontal size and vertical size) of the ternary tree, the coding unit may not be partitioned into two or three. Therefore, the multi-type tree partition indication information may not be signaled, but may be inferred from the second value.
[0193] Optionally, when the size (horizontal size and vertical size) of the coding unit corresponding to the node of the multi-type tree is the same as the maximum size (horizontal size and vertical size) of the binary tree and / or is twice the maximum size (horizontal size and vertical size) of the ternary tree, the coding unit may not be further partitioned into two or three partitions. Therefore, the multi-type tree partition indication information may not be signaled, but may be derived from the second value. This is because when the coding unit is partitioned according to the binary tree partition structure and / or the ternary tree partition structure, a coding unit smaller than the minimum size of the binary tree and / or the minimum size of the ternary tree is generated.
[0194] Optionally, binary tree partitioning or ternary tree partitioning may be limited based on the size of the virtual pipeline data unit (hereinafter, the pipeline buffer size). For example, when a coding unit is divided into sub-coding units that do not fit in the pipeline buffer size by binary tree partitioning or ternary tree partitioning, the corresponding binary tree partitioning or ternary tree partitioning may be limited. The pipeline buffer size may be the size of the largest transform block (e.g., 64×64). For example, when the pipeline buffer size is 64×64, the following partitioning may be limited.
[0195] - N×M (N and / or M is 128) ternary tree partitions for coding units
[0196] - 128×N (N<=64) binary tree partitions in the horizontal direction for coding units
[0197] - N×128 (N<=64) binary tree partitions in the vertical direction for the coding unit
[0198] Optionally, when the depth of the coding unit corresponding to a node of the multi-type tree is equal to the maximum depth of the multi-type tree, the coding unit may not be further partitioned into two and / or three partitions. Therefore, the multi-type tree partition indication information may not be signaled, but may be inferred from the second value.
[0199] Optionally, multi-type tree partition indication information may be signaled only when at least one of vertical binary tree partitioning, horizontal binary tree partitioning, vertical ternary tree partitioning, and horizontal ternary tree partitioning is possible for a coding unit corresponding to a node of a multi-type tree. Otherwise, the coding unit may not be partitioned into two or three partitions. Therefore, multi-type tree partition indication information may not be signaled, but may be inferred from the second value.
[0200] Optionally, partition direction information may be signaled only when both vertical binary tree partitioning and horizontal binary tree partitioning, or both vertical ternary tree partitioning and horizontal ternary tree partitioning, are possible for a coding unit corresponding to a node of a multi-type tree. Otherwise, partition direction information may not be signaled, but may be derived from a value indicating a possible partition direction.
[0201] Optionally, partition tree information may be signaled only when both vertical binary tree partitioning and vertical ternary tree partitioning, or both horizontal binary tree partitioning and horizontal ternary tree partitioning, are possible for a coding tree corresponding to a node of a multi-type tree. Otherwise, partition tree information may not be signaled, but may be derived from a value indicating a possible partition tree structure.
[0202] Figure 4 is a diagram illustrating an intra prediction process.
[0203] Figure 4 The arrows from the center to the outside in FIG. 1 represent the prediction direction of the intra prediction mode.
[0204] Intra-frame encoding and / or decoding may be performed by using reference samples of a neighboring block of the current block. The neighboring block may be a reconstructed neighboring block. For example, intra-frame encoding and / or decoding may be performed by using encoding parameters or values of reference samples included in the reconstructed neighboring block.
[0205] A prediction block may represent a block generated by performing intra prediction. A prediction block may correspond to at least one of a CU, a PU, and a TU. A unit of a prediction block may have the size of one of a CU, a PU, and a TU. A prediction block may be a square block of a size of 2×2, 4×4, 16×16, 32×32, or 64×64, or a rectangular block of a size of 2×8, 4×8, 2×16, 4×16, or 8×16, etc.
[0206] Intra-frame prediction may be performed based on an intra-frame prediction mode for the current block. The number of intra-frame prediction modes that the current block may have may be a fixed value or may be a value determined differently depending on the properties of the prediction block. For example, the properties of the prediction block may include the size and shape of the prediction block.
[0207] Regardless of the block size, the number of intra-frame prediction modes can be fixed to N. Alternatively, the number of intra-frame prediction modes can be 3, 5, 9, 17, 34, 35, 36, 65, or 67, etc. Alternatively, the number of intra-frame prediction modes can vary depending on the block size or the color component type, or both. For example, the number of intra-frame prediction modes can vary depending on whether the color component is a luminance signal or a chrominance signal. For example, as the block size increases, the number of intra-frame prediction modes can increase. Alternatively, the number of intra-frame prediction modes for a luminance component block can be greater than the number of intra-frame prediction modes for a chrominance component block.
[0208] The intra prediction mode may be a non-angle mode or an angle mode. The non-angle mode may be a DC mode or a planar mode, and the angle mode may be a prediction mode having a specific direction or angle. The intra prediction mode may be represented by at least one of a mode number, a mode value, a mode number, a mode angle, and a mode direction. The number of intra prediction modes may be M, which is greater than 1, including non-angle modes and angle modes. In order to perform intra prediction on a current block, a step of determining whether a sample included in a reconstructed neighboring block can be used as a reference sample for the current block may be performed. When there are samples that cannot be used as reference samples for the current block, a value obtained by copying or interpolating at least one sample value of the samples included in the reconstructed neighboring block, or performing both copying and interpolation, may be used to replace the unavailable sample value of the sample, so that the replaced sample value is used as the reference sample for the current block.
[0209] Figure 7 is a diagram showing reference samples that can be used for intra prediction.
[0210] like Figure 7 As shown, at least one of the reference sample line 0 to the reference sample line 3 can be used for intra prediction of the current block. Figure 7 In the example, the samples of fragments A and F can be filled with the samples of the closest fragments B and E, respectively, instead of retrieving them from the reconstructed neighboring blocks. Index information indicating the reference sample line to be used for intra prediction of the current block can be signaled. 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, index information may not be signaled. When reference sample lines other than reference sample line 0 are used, filtering for the predicted block, which will be described later, may not be performed.
[0211] When intra prediction is performed, a filter may be applied to at least one of a reference sample and a prediction sample based on an intra prediction mode and a current block size.
[0212] In the case of planar mode, when generating a prediction block for the current block, the sample value of the prediction target sample may be generated by using a weighted sum of the upper and left reference samples of the current sample, as well as the upper right and lower left reference samples of the current block, depending on the position of the prediction target sample within the prediction block. Furthermore, in the case of DC mode, when generating a prediction block for the current block, the average of the upper and left reference samples of the current block may be used. Furthermore, in the case of angular mode, the prediction block may be generated by using the upper, left, upper right, and / or lower left reference samples of the current block. To generate the prediction sample values, interpolation of real units may be performed.
[0213] In the case of intra-frame prediction between color components, a prediction block for the current block of the second color component can be generated based on the corresponding reconstructed block of the first color component. For example, the first color component can be a luma component, and the second color component can be a chroma component. For intra-frame prediction between color components, parameters of a linear model between the first and second color components can be derived based on a template. The template can include the upper and / or left neighboring samples of the current block and the upper and / or left neighboring samples of the corresponding reconstructed block of the first color component. For example, the parameters of the linear model can be derived using the sample value of the first color component with the maximum value and the corresponding sample value of the second color component among the samples in the template, as well as the sample value of the first color component with the minimum value and the corresponding sample value of the second color component among the samples in the template. Once the parameters of the linear model are derived, the corresponding reconstructed block can be applied to the linear model to generate a prediction block for the current block. Depending on the video format, subsampling can be performed on the reconstructed block of the first color component and the 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 may be subsampled to calculate one corresponding sample. In this case, parameter derivation of a linear model and intra prediction between color components may be performed based on the corresponding subsampled samples. Whether to perform intra prediction between color components and / or the range of the template may be signaled as an intra prediction mode.
[0214] The current block may be partitioned into two subblocks or four subblocks in the horizontal or vertical direction. The partitioned subblocks may be reconstructed sequentially. That is, intra prediction may be performed on the subblocks to generate sub-prediction blocks. Furthermore, inverse quantization and / or inverse transformation may be performed on the subblocks to generate sub-residual blocks. Reconstructed subblocks may be generated by adding the sub-prediction blocks to the sub-residual blocks. The reconstructed subblocks may be used as reference samples for intra prediction of the subblocks. A subblock may be a block including a predetermined number (e.g., 16) or more samples. Thus, for example, when the current block is an 8×4 block or a 4×8 block, the current block may be partitioned into two subblocks. Furthermore, when the current block is a 4×4 block, the current block may not be partitioned into subblocks. When the current block has other sizes, the current block may be partitioned into four subblocks. Information regarding whether intra prediction is performed based on subblocks and / or the partition direction (horizontal or vertical) may be signaled. Subblock-based intra prediction may be limited to only when using reference sample line 0. When subblock-based intra prediction is performed, filtering for a prediction block, which will be described later, may not be performed.
[0215] The final prediction block can be generated by performing filtering on the prediction block predicted by the intra-frame. The filtering can be performed by applying predetermined weights to the filtering target samples, the left reference samples, the upper reference samples and / or the upper left reference samples. The weights and / or reference samples (range, position, etc.) used for filtering can be determined based on at least one of the block size, the intra-frame prediction mode and the position of the filtering target sample in the prediction block. The filtering can be performed only in the case of a predetermined intra-frame prediction mode (e.g., DC, plane, vertical, horizontal, diagonal and / or adjacent diagonal mode). The adjacent diagonal mode can be a mode in which k is added to the diagonal mode or subtracted from the diagonal mode. For example, k can be a positive integer of 8 or less.
[0216] The intra-frame prediction mode of the current block can be entropy encoded / decoded by predicting the intra-frame prediction mode of a block adjacent to the current block. When the intra-frame prediction mode of the current block is the same as that of the neighboring block, information indicating that the intra-frame prediction mode of the current block and the neighboring block is the same can be signaled using predetermined flag information. In addition, indicator information of an intra-frame prediction mode that is the same as the intra-frame prediction mode of the current block among the intra-frame prediction modes of multiple neighboring blocks can be signaled. When the intra-frame prediction mode of the current block is different from that of the neighboring block, the intra-frame prediction mode information of the current block can be entropy encoded / decoded by performing entropy encoding / decoding based on the intra-frame prediction mode of the neighboring block.
[0217] Figure 5 is a diagram illustrating an embodiment of an inter-picture prediction process.
[0218] exist Figure 5 In , a rectangle can represent a picture. Figure 5In FIG, the arrow indicates the prediction direction. According to the encoding type of a picture, the picture can be classified into an intra picture (I picture), a predicted picture (P picture), and a bi-predictive picture (B picture).
[0219] I-pictures can be encoded using intra-frame prediction without requiring inter-picture prediction. P-pictures can be encoded using inter-picture prediction using reference pictures in one direction (i.e., forward or backward) relative to the current block. B-pictures can be encoded using inter-picture prediction using reference pictures 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.
[0220] Hereinafter, embodiments of inter-picture prediction will be described in detail.
[0221] Reference pictures and motion information may be used to perform inter-picture prediction or motion compensation.
[0222] Motion information of the current block may be derived during inter-picture prediction by each of the encoding apparatus 100 and the decoding apparatus 200. The motion information of the current block may be derived by using motion information of a reconstructed neighboring block, motion information of a co-located block (also referred to as a col block or co-located block), and / or motion information of a block adjacent to the co-located block. The co-located block may refer to a block in a previously reconstructed co-located picture (also referred to as a col picture or co-located picture) that is spatially co-located with the current block. The co-located picture may be one of one or more reference pictures included in a reference picture list.
[0223] The method of deriving motion information may vary depending on the prediction mode of the current block. For example, prediction modes applied to inter-frame prediction include AMVP mode, merge mode, skip mode, merge mode with motion vector difference, sub-block merge mode, triangle partition mode, inter-intra combined prediction mode, affine mode, etc. Here, the merge mode may be referred to as motion merge mode.
[0224] For example, when AMVP is used as a prediction mode, at least one of the motion vector 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 may be determined as a motion vector candidate for the current block, and a motion vector candidate list may be generated by using the motion vector candidates. The motion vector candidate for the current block may be derived by using the generated motion vector candidate list. The motion information of the current block may be determined based on the derived motion vector candidate. The motion vector of the co-located block or the motion vector of the block adjacent to the co-located block may be referred to as a temporal motion vector candidate, and the motion vector of the reconstructed neighboring block may be referred to as a spatial motion vector candidate.
[0225] The encoding device 100 may calculate a motion vector difference (MVD) between the motion vector of the current block and the motion vector candidate, and may perform entropy encoding on the motion vector difference (MVD). In addition, the encoding device 100 may perform entropy encoding on the motion vector candidate index and generate a bitstream. The motion vector candidate index may indicate the best motion vector candidate among the motion vector candidates included in the motion vector candidate list. The decoding device may perform entropy decoding on the motion vector candidate index included in the bitstream, and may select a motion vector candidate for the decoding target block from the motion vector candidates included in the motion vector candidate list by using the entropy-decoded motion vector candidate index. In addition, the decoding device 200 may add the entropy-decoded MVD to the motion vector candidate extracted by entropy decoding, thereby deriving the motion vector of the decoding target block.
[0226] In addition, the encoding apparatus 100 may perform entropy encoding on the calculated resolution information of the MVD. The decoding apparatus 200 may adjust the resolution of the entropy-decoded MVD using the MVD resolution information.
[0227] In addition, the encoding device 100 calculates a motion vector difference (MVD) between a motion vector in the current block and a motion vector candidate based on an affine model and performs entropy encoding on the MVD. The decoding device 200 derives a motion vector based on each subblock by deriving an affine controlled motion vector of a decoding target block from the sum of the entropy-decoded MVD and the affine controlled motion vector candidate.
[0228] The bitstream may include a reference picture index indicating a reference picture. The reference picture index may be entropy-encoded by the encoding apparatus 100 and then signaled as a bitstream to the decoding apparatus 200. The decoding apparatus 200 may generate a prediction block of a decoding target block based on the derived motion vector and the reference picture index information.
[0229] Another example of a method for deriving motion information of a current block may be a merge mode. Merge mode may indicate a method for merging the motion of multiple blocks. Merge mode may indicate a mode for deriving motion information of a current block from motion information of neighboring blocks. When merge mode is applied, the motion information of reconstructed neighboring blocks and / or the motion information of co-located blocks may be used to generate a merge candidate list. The motion information may include at least one of a motion vector, a reference picture index, and an inter-picture prediction indicator. The prediction indicator may indicate unidirectional prediction (L0 prediction or L1 prediction) or bidirectional prediction (L0 prediction and L1 prediction).
[0230] The merge candidate list may be a list of stored motion information. The motion information included in the merge candidate list may be at least one of the following: motion information of a neighboring block adjacent to the current block (spatial merge candidate), motion information of a co-located block of the current block in a reference picture (temporal merge candidate), new motion information generated by combining motion information present in the merge candidate list, motion information of a block encoded / decoded before the current block (history-based merge candidate), and a zero merge candidate.
[0231] The encoding device 100 may generate a bitstream by performing entropy encoding on at least one of a merge flag and a merge index, and may transmit the bitstream to the decoding device 200 using a signal. The merge flag may be information indicating whether a merge mode is performed for each block, and the merge index may be information indicating which neighboring block of the current block is a merge target block. For example, the neighboring blocks of the current block may include a left neighboring block located to the left of the current block, an upper neighboring block arranged above the current block, and a temporal neighboring block temporally adjacent to the current block.
[0232] In addition, the encoding device 100 performs entropy encoding on correction information for correcting the motion vector in the motion information of the merge candidate and transmits the correction information to the decoding device 200 using a signal. The decoding device 200 may correct the motion vector of the merge candidate selected by the merge index based on the correction information. Here, the correction information may include at least one of information on whether correction is performed, correction direction information, and correction size information. As described above, the prediction mode in which the motion vector of the merge candidate is corrected based on the signaled correction information may be referred to as a merge mode with a motion vector difference.
[0233] The skip mode may be a mode in which the motion information of the neighboring blocks is applied to the current block as is. When the skip mode is applied, the encoding device 100 may perform entropy encoding on information indicating which block's motion information is to be used as the motion information of the current block to generate a bitstream, and may signal the bitstream to the decoding device 200. The encoding device 100 may not signal a syntax element regarding at least any one of the motion vector difference information, the coded block flag, and the transform coefficient level to the decoding device 200.
[0234] The subblock merge mode may indicate a mode for deriving motion information in units of subblocks of a coding block (CU). When the subblock merge mode is applied, the subblock merge candidate list may be generated using motion information of subblocks co-located with the current subblock in the reference image (subblock-based temporal merge candidates) and / or affine control point motion vector merge candidates.
[0235] The triangular partition mode may denote a mode of deriving motion information by partitioning the current block into diagonal directions, deriving each prediction sample using each of the derived motion information, and deriving the prediction sample of the current block by weighting each of the derived prediction samples.
[0236] The inter-intra combined prediction mode may mean a mode of deriving prediction samples of a current block by weighting prediction samples generated by inter prediction and prediction samples generated by intra prediction.
[0237] The decoding apparatus 200 may correct the derived motion information by itself. The decoding apparatus 200 may search for a predetermined area based on a reference block indicated by the derived motion information, and derive motion information having a minimum SAD as the corrected motion information.
[0238] The decoding apparatus 200 may compensate for prediction samples derived through inter-frame prediction using optical flow.
[0239] Figure 6 is a diagram illustrating transform and quantization processing.
[0240] like Figure 6 As shown in , a transform process and / or a quantization process is performed on the residual signal to generate a quantized level signal. The residual signal is the difference between the original block and the 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. The primary transform of the residual signal generates transform coefficients, and the secondary transform of the transform coefficients generates secondary transform coefficients.
[0241] At least one scheme selected from various predefined transform schemes is used to perform the first transform. For example, examples of the predefined transform schemes include discrete cosine transform (DCT), discrete sine transform (DST), and Karhunen-Loève transform (KLT). The transform coefficients generated by the first transform may undergo a second transform. The transform scheme used for the first transform and / or the second transform may be determined based on coding parameters of the current block and / or neighboring blocks of the current block. Optionally, transform information indicating the transform scheme may be signaled. DCT-based transforms may include, for example, DCT-2, DCT-8, etc. DST-based transforms may include, for example, DST-7.
[0242] A quantized level signal (quantized coefficient) may be generated by performing quantization on a residual signal or on a result of performing a first transform and / or a second transform. Depending on the intra prediction mode or block size / shape of the block, the quantized level signal may be scanned according to at least one of diagonal upper right scanning, vertical scanning, and horizontal scanning. For example, when the coefficients are scanned according to diagonal upper right scanning, the coefficients in block form are changed to a one-dimensional vector form. In addition to diagonal upper right scanning, horizontal scanning for horizontally scanning the coefficients in two-dimensional block form or vertical scanning for vertically scanning the coefficients in two-dimensional block form may be used depending on the intra prediction mode and / or the size of the transform block. The scanned quantized level coefficients may be entropy coded for insertion into the bitstream.
[0243] The decoder entropy decodes the bitstream to obtain quantized level coefficients. The quantized level coefficients can be arranged in a two-dimensional block form by inverse scanning. For inverse scanning, at least one of diagonal upper right scanning, vertical scanning, and horizontal scanning can be used.
[0244] The quantized level coefficients may then be dequantized, then inverse transformed a second time as needed, and finally inverse transformed a first time as needed to generate a reconstructed residual signal.
[0245] Inverse mapping in the dynamic range can be performed for the luminance component reconstructed by intra prediction or inter prediction before in-loop filtering. The dynamic range can be divided into 16 equal segments, and the mapping function for each segment can be sent by signal. The mapping function can be sent by signal at the slice level or the parallel block group level. The inverse mapping function for performing inverse mapping can be derived based on the mapping function. In-loop filtering, reference picture storage and motion compensation are performed in the inverse mapping area, and the prediction block generated by inter prediction is converted to the mapping area via mapping using the mapping function, and then used to generate the reconstructed block. However, since intra prediction is performed in the mapping area, the prediction block generated by intra prediction can be used to generate the reconstructed block without mapping / inverse mapping.
[0246] When the current block is a residual block of a chroma component, the residual block can be converted to an inverse mapping area by performing scaling on the chroma component of the mapping area. The availability of scaling can be signaled at the slice level or the parallel block group level. Scaling can only be applied when the mapping of the luminance component is available and the partitioning of the luminance component and the partitioning of the chroma component follow the same tree structure. Scaling can be performed based on the average value of the sample values of the luminance prediction block corresponding to the chroma block. In this case, when the current block uses inter-frame prediction, the luminance prediction block can represent the mapped luminance prediction block. The value required for scaling can be derived by referencing a lookup table using the index of the segment to which the average value of the sample values of the luminance prediction block belongs. Finally, the residual block can be converted to the inverse mapping area by scaling the residual block using the derived value. Then, chroma component block recovery, intra-frame prediction, inter-frame prediction, in-loop filtering, and reference picture storage can be performed in the inverse mapping area.
[0247] Information indicating whether mapping / inverse mapping of luma components and chroma components is available may be signaled through a sequence parameter set.
[0248] The prediction block of the current block can be generated based on a block vector indicating the displacement between the current block and the reference block in the current picture. In this way, the prediction mode for generating the prediction block with reference to the current picture is called intra block copy (IBC) mode. The IBC mode can be applied to M×N (M<=64, N<=64) coding units. The IBC mode may include skip mode, merge mode, AMVP mode, etc. In the case of skip mode or merge mode, a merge candidate list is constructed and a merge index is signaled so that a 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 may 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 AMVP mode, a difference block vector may be signaled. In addition, the prediction block vector may 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 may be signaled. The prediction block in IBC mode is included in the current CTU or the left CTU and is limited to blocks in the already reconstructed area. For example, the value of the block vector can be limited so that the prediction block of the current block is located in the area of three 64×64 blocks preceding the 64×64 block to which the current block belongs in the encoding / decoding order. By limiting the value of the block vector in this way, memory consumption and device complexity of the implementation according to the IBC mode can be reduced.
[0249] A candidate list consisting of prediction block vectors may be referred to as a block vector candidate list, and a merge candidate list consisting of block vectors may be referred to as a block vector merge candidate list.
[0250] Hereinafter, a method of determining a reference block of a current block in the above-mentioned block structure will be described.
[0251] An image may be encoded / decoded according to at least one or a combination of the embodiments described below. By effectively determining a reference block for a current block in an image encoding / decoding process using the embodiments described below, the encoding efficiency of an image encoder and the decoding efficiency of an image decoder may be improved.
[0252] Also, a block to be described later may represent a unit, and a candidate list to be described later may represent a candidate set including at least one candidate.
[0253] Here, in one or more steps of image encoding / decoding processing steps including inter-frame prediction, intra-frame prediction, transformation, inverse transformation, quantization, inverse quantization, entropy encoding, entropy decoding and in-loop filtering, a reference block of the current block can be determined.
[0254] Figure 8 is a flowchart illustrating a method of encoding / decoding an image according to an embodiment of the present invention.
[0255] Reference Figure 8 , the encoding / decoding method according to the present invention may include: in step S810, including the neighboring blocks of the current block included in the current block in a candidate list for encoding / decoding the current block; and in step S820, determining a reference block for encoding / decoding the current block from among the neighboring blocks included in the candidate list. Figure 8 The current block in may refer to an encoding / decoding target subblock that is one of subblocks obtained from partitions of the block.
[0256] The reference block of the current block can be selected from a candidate list including neighboring blocks or block information of neighboring blocks. Here, in one or more steps of the image encoding / decoding process including inter-frame prediction, intra-frame prediction, transformation, inverse transformation, quantization, inverse quantization, entropy encoding, entropy decoding, and in-loop filtering, the current block can be encoded / decoded using the determined reference block. Here, at least one of the neighboring block and the block information of the neighboring block can be referred to as a candidate.
[0257] The reference block may represent at least one piece of block information of the reference block. That is, at least one of image encoding / decoding processes may be performed on the current block using the determined block information of the reference block. Here, the block information of the reference block may be determined as the block information of the current block. The reference block may represent at least one piece of block information of the reference block.
[0258] Here, a neighboring block of the current block refers to one of the spatially neighboring blocks including an upper neighboring block adjacent to the upper boundary of the current block, an upper left neighboring block adjacent to the upper left corner of the current block, an upper right neighboring block adjacent to the upper right corner of the current block, a left neighboring block adjacent to the left boundary of the current block, and a lower left neighboring block adjacent to the lower left corner of the current block. Furthermore, a neighboring block may be at least one of the spatially neighboring blocks adjacent to the boundary of the current block. A neighboring block refers to a block located outside the boundary of the CTU to which the current block belongs, and specifically refers to one of the spatially neighboring blocks adjacent to the boundary of the current block. A neighboring block refers to at least one of the spatially neighboring blocks that includes one or more samples located outside the current block and adjacent to a specific sample position within the current block. A neighboring block refers to a block located outside the boundary of the CTU to which the current block belongs, and refers to one of the spatially neighboring blocks that includes one or more samples located outside the current block and adjacent to a specific sample position within the current block. In other words, a neighboring block may refer to a neighboring block that is spatially / temporally adjacent to the current block and may also refer to a reconstructed neighboring block.
[0259] The neighboring block may indicate at least one piece of block information of the neighboring block. That is, including the neighboring block in the candidate list may indicate that the block information of the neighboring block is included in the candidate list. Therefore, the neighboring block mentioned below may be used as a term referring to at least one piece of block information of the neighboring block.
[0260] Furthermore, in the following description, the neighboring blocks included in the candidate list may be referred to as candidates, and block information of the neighboring blocks included in the candidate list may also be referred to as candidates.
[0261] That is, a block may be represented as a candidate of a block itself, or may be represented as a candidate of a piece of information about a block. In the embodiments described below, for convenience, block information and corresponding blocks are collectively referred to as a block.
[0262] When used in the prediction described later, the candidates in the candidate list or the information included in the candidates can be added to the intra-frame prediction mode candidate list, motion vector candidate list, merge candidate list, block vector candidate list, block vector merge candidate list, sub-block motion vector candidate list, sub-block merge candidate list, etc.
[0263] The block information may mean at least one of information about a neighboring block, information about a reference block, and information about a current block.
[0264] The block information may include at least one of the coding parameters of the block. For example, the block information represents information used in at least one process selected from inter-frame prediction, intra-frame prediction, transformation, inverse transformation, quantization, inverse quantization, entropy coding, entropy decoding, and in-loop filtering. Specifically, the block information refers to any one or a combination of the following parameters: block size, block depth, block partition information, block form (square or non-square), whether quadtree partitioning is performed, whether binary tree partitioning is performed, binary tree partition direction (horizontal or vertical), binary tree partition type (symmetric or asymmetric), prediction mode (intra-frame or inter-frame), luma intra-frame prediction mode / direction, chroma intra-frame prediction mode / direction, intra-frame prediction partition information, inter-frame prediction partition information, coding block partition flag, prediction block partition flag, transform block partition flag, reference sample filter tap. Reference sample filter coefficient, prediction block filter tap, prediction block filter coefficient, prediction block boundary filter tap, prediction block boundary filter coefficient, motion vector (motion vector for at least one of L0, L1, L2, L3, etc.), motion vector difference (motion vector difference for at least one of L0, L1, L2, L3, etc.), direction of inter prediction (unidirectional or bidirectional), reference picture index (reference picture index for at least one of L0, L1, L2, L3, etc.), inter prediction indicator, prediction list utilization information (whether used), reference picture list, motion vector prediction index, motion vector prediction candidate, motion vector candidate list, merge mode information (whether used), merge index, merge candidate, merge candidate list, skip mode information (whether used), interpolation filter type, interpolation filter tap, interpolation filter coefficient, motion vector size, motion vector precision (integer sample, 1 / 2 sample, 1 / 4 sample, 1 / 8 sample, 1 / 16 samples, 1 / 32 samples, etc.), block vector, block vector difference, block vector index, block vector prediction candidate, block vector candidate list, block vector merge candidate list, weighting factor value for each block when generating a bi-prediction block, transform type, transform size, primary transform utilization information (whether used), secondary transform utilization information (whether used), primary transform index, secondary transform index, residual signal presence information (whether present), coding block pattern, coding block flag, coding parameters, residual quantization parameter, quantization matrix, in-loop filter application information (whether applied), in-loop filter coefficient, in-loop filter tap, in-loop filter shape / form, deblocking filter application information (whether applied), deblocking filter coefficient, deblocking filter tap, deblocking filter strength, deblocking filter shape / form, adaptive sample offset (SAO) application information (whether applied), adaptive sample offset value, adaptive sample offset category, adaptive sample offset type,Adaptive loop filter (ALF) application information (whether applied), adaptive loop filter coefficients, adaptive loop filter taps, adaptive loop filter shape / form, binarization / debinarization method, context model decision method, context model update method, normal mode utilization information (whether used), bypass mode utilization flag, context binary bit, bypass binary bit, valid coefficient flag, last valid coefficient flag, encoding flag according to each coefficient group, position of the last valid flag, flag indicating whether the coefficient value is greater than 1, flag indicating whether the coefficient value is greater than 2, flag indicating whether the coefficient value is greater than 3, remaining coefficient value information, sign information, reconstruction Luma samples, reconstructed chroma samples, residual luma samples, residual chroma samples, luma transform coefficients, chroma transform coefficients, luma quantization level, chroma quantization level, transform coefficient level scanning method, size of the motion vector search area at the decoder side, shape of the motion vector search area at the decoder side, motion vector search frequency at the decoder side, CTU size, minimum block size, maximum block size, maximum block depth, minimum block depth, slice identification information, slice partition information, tile identification information, tile type, tile partition information, bit depth of input samples, bit depth of reconstructed samples, bit depth of residual samples, bit depth of transform coefficients, and bit depth of quantization level.
[0265] First, step S820 of inserting the neighboring blocks into the candidate list will be described in detail.
[0266] At least one neighboring block (up to V neighboring blocks) that is spatially / temporally adjacent to the current block may be inserted into the candidate list for the current block. At least one piece (up to V pieces) of block information of the neighboring blocks that are spatially / temporally adjacent to the current block may be inserted into the candidate list for the current block.
[0267] Here, V may be 0 or any positive integer. V may be determined based on at least one of the encoding parameters of the current block and the encoding parameters of the candidate. In addition, V may be a value preset in the encoder / decoder or a value signaled from the encoder to the decoder.
[0268] When a neighboring block is included in the same picture (or image) as the current block, a sub-picture in the same picture, a slice in the same picture, a tile in the same picture, a partition in the same picture, or a CTU in the same picture, the neighboring block is referred to as a spatially neighboring block that is spatially adjacent to the current block. When a neighboring block is included in a different picture, a sub-picture in a different picture, a slice in a different picture, a tile in a different picture, a partition in a different picture, or a CTU in a different picture, the neighboring block is referred to as a temporally neighboring block that is temporally adjacent to the current block.
[0269] In the following example, a method of selecting a neighboring block included in a candidate list may be determined based on encoding parameters of a current block. In addition, the selection method may be determined by a method existing between an encoder and a decoder, or may be determined according to a value signaled from an encoder to a decoder.
[0270] In addition, in the following example, the maximum number V of neighboring blocks included in the candidate list may be determined based on at least one of the encoding parameters of the current block and the encoding parameters of the neighboring blocks. In addition, V may be a value preset between the encoder and the decoder, or may be a value signaled from the encoder to the decoder.
[0271] In the following, reference will be made to Figures 9 to 23 An embodiment of inserting the above-mentioned spatially neighboring blocks or temporally neighboring blocks into the candidate list is described in detail. The encoder or decoder can add the spatially neighboring blocks or temporally neighboring blocks of the current block to the candidate list for the current block or insert the spatially neighboring blocks or temporally neighboring blocks of the current block into the candidate list for the current block by using at least one or at least one combination of the methods described below.
[0272] Figure 9 and Figure 10 is a diagram illustrating a method of inserting neighboring blocks adjacent to a current block into a candidate list according to one embodiment of the present invention.
[0273] Up to V neighboring blocks adjacent to the current block may be included in the candidate list for the current block. Here, V may be a positive integer including 0. Here, the fact that the neighboring block is adjacent to the current block may mean that at least one of a boundary and a vertex of the current block contacts at least one of a boundary and a vertex of the neighboring block.
[0274] Here, a block located within the vertical size of the current block based on the upper position of the current block may be a neighboring block adjacent to the current block. In addition, a block located within the horizontal size of the current block based on the left position of the current block may be a neighboring block adjacent to the current block.
[0275] The neighboring blocks may be included in the candidate list in the order from the neighboring blocks that contact the boundary of the current block to the neighboring blocks that contact the vertices of the current block. In addition, the neighboring blocks may be included in the candidate list in the order from the neighboring blocks that contact the vertices of the current block to the neighboring blocks that contact the boundary of the current block.
[0276] The neighboring blocks may be included in the candidate list in the order from the neighboring block adjacent to the left side of the current block to the neighboring block adjacent to the top of the current block. In addition, the neighboring blocks may be included in the candidate list in the order from the neighboring block adjacent to the top of the current block to the neighboring block adjacent to the left side of the current block.
[0277] Even when at least one block exists between the current block and the neighboring block, the neighboring block may be said to be adjacent to the current block. Figure 10 In , blocks E, F, H, I, K, L, N, and R are said to be adjacent to the current block.
[0278] Figure 9 and Figure 10 The gray blocks in may refer to neighboring blocks adjacent to the current block X and, therefore, may be included in the candidate list. Here, blocks B, C, and D may refer to blocks obtained by partitioning a parent node using a vertical ternary tree. Blocks E, F, and G may refer to blocks obtained by partitioning a parent node using a horizontal ternary tree. Blocks P and Q may refer to blocks obtained by partitioning a parent node using a horizontal binary tree. Blocks R and S may refer to blocks obtained by partitioning a parent node using a vertical binary tree. Blocks H, I, J, and K, as well as blocks L, M, N, and O may refer to blocks obtained by partitioning a parent node using a quadtree. Examples of such block partitioning may be used in common in the following figures.
[0279] Here, in Figure 9 In the example in , the candidate list for the current block X may include at least one of the blocks {A, B, C, D, E} adjacent to the current block X. Figure 10 In the example in , the candidate list for the current block X may include at least one of the blocks {A, B, C, D, G, J, M, O, P, Q, S} adjacent to the current block X.
[0280] Figure 11 and Figure 12 is a diagram illustrating a method of inserting neighboring blocks adjacent to a current block into a candidate list according to the length of a boundary between the current block and the neighboring blocks according to one embodiment of the present invention.
[0281] Depending on whether at least one of the neighboring blocks adjacent to the current block is in contact with the current block, up to V neighboring blocks may be included in the candidate list for the current block. In addition, among the neighboring blocks adjacent to the current block, up to V neighboring blocks each having a length (horizontal size or vertical size) equal to or greater than N in contact with the current block may be included in the candidate list for the current block.
[0282] When there is no neighboring block whose contact length with the current block is equal to or greater than N among the neighboring blocks adjacent to the current block, (NK) is used instead of N to construct the candidate list for the current block. Here, K may refer to a positive integer greater than 0. That is, among the neighboring blocks adjacent to the current block, up to V neighboring blocks, each of which has a contact length equal to or greater than NK and less than N, may be included in the candidate list for the current block.
[0283] For example, N may be expressed as a positive integer of 2 raised to the power of n (=2^n) (such as 2, 4, 8, 16, etc.). Alternatively, N may be determined based on at least one of the encoding parameters of the current block and the encoding parameters of the candidate. In addition, N may be a value preset in the encoder / decoder or a value signaled from the encoder to the decoder.
[0284] For example, neighboring blocks that contact the current block may be preferentially inserted into the candidate list in order of decreasing boundary length. For example, neighboring blocks that contact the current block may be preferentially inserted into the candidate list in order of increasing boundary length.
[0285] A maximum of V neighboring blocks may be inserted into the candidate list for the current block among neighboring blocks that contact the current block with a boundary length ranging from N to M. Here, each of M and N may be represented by a positive integer of 2 to the power of n (=2^n) (such as 2, 4, 8, 16, etc.).
[0286] exist Figure 11 In the figure, because each of the gray blocks is in contact with the current block X and has a boundary length of N or greater between the current block and the corresponding neighboring block, the gray blocks represent neighboring blocks that can be inserted into the candidate list. For example, block X is a 32×32 block, block A represents a 16×16 block, blocks B and D are 4×16 blocks, block C is an 8×16 block, blocks E and F are 16×4 blocks, block F is a 16×8 block, blocks H, I, J, K, L, M, N, and O are 8×8 blocks, blocks P and Q are 16×8 blocks, and blocks R and S are 8×16 blocks. These block size examples are commonly used in subsequent figures of the accompanying drawings.
[0287] For example, in Figure 11 In the example of , a neighboring block having a boundary length of 8 or more that contacts the current block may be included in the candidate list. In this case, the candidate list for the current block X is configured to include at least one of blocks C, G, M, O, P, and Q.
[0288] exist Figure 12 In FIG, since each of the gray blocks is in contact with the current block X and has a boundary length of N or greater between the current block and the corresponding adjacent block, the gray blocks represent adjacent blocks that can be inserted into the candidate list. For example, adjacent blocks that are in contact with the current block and have a boundary length of 16 or greater can be included in the candidate list. In this case, the candidate list is configured to include block G.
[0289] Figure 13 and Figure 14 is a diagram illustrating a method of inserting neighboring blocks adjacent to a current block into a candidate list according to sizes of the neighboring blocks according to one embodiment of the present invention.
[0290] According to the size of each neighboring block, a maximum of V neighboring blocks among all neighboring blocks of the current block may be inserted into the candidate list for the current block. Hereinafter, the size of a block may represent at least one of a horizontal size, a vertical size, and an area.
[0291] For example, a maximum of V neighboring blocks of a size of M×N or larger may be inserted into the candidate list for the current block. As another example, a maximum of V neighboring blocks of a size of M×N or smaller may be inserted into the candidate list for the current block.
[0292] As another example, a maximum of V neighboring blocks having sizes ranging from M×N to P×Q may be inserted into the candidate list for the current block. Here, P may represent the horizontal size of the block, Q may represent the vertical size of the block, and each of P and Q may be a positive integer.
[0293] As yet another example, when at least one of the horizontal size and the vertical size of a specific neighboring block is greater than M or N, the neighboring block may be inserted into the candidate list.
[0294] As yet another example, a maximum of V neighboring blocks among all neighboring blocks of the current block having an area equal to or greater than the product of M and N may be inserted into the candidate list for the current block. As yet another example, a maximum of V neighboring blocks among all neighboring blocks of the current block having an area equal to or less than the product of M and N may be inserted into the candidate list for the current block. As yet another example, a maximum of V neighboring blocks among all neighboring blocks of the current block having an area ranging from the product of M and N to the product of P and Q may be inserted into the candidate list for the current block.
[0295] Here, M may represent a horizontal size of a block, N may represent a vertical size of a block, and each of M and N may be a positive integer. In addition, M and N may be the same value or different values.
[0296] At least one of M, N, P, and Q may be determined based on at least one of the encoding parameters of the current block and the candidate encoding parameters. In addition, at least one of M, N, P, and Q may be a value preset in the encoder / decoder or a value signaled from the encoder to the decoder.
[0297] For example, neighboring blocks adjacent to the current block may be preferentially inserted into the candidate list in order of decreasing block size. Alternatively, neighboring blocks adjacent to the current block may be preferentially inserted into the candidate list in order of increasing block size.
[0298] As another example, when the size of a specific neighboring block is equal to or larger than the current block, the neighboring block may be inserted into the candidate list. Alternatively, when the size of a specific neighboring block is equal to or smaller than the current block, the neighboring block may be inserted into the candidate list.
[0299] exist Figure 13 In the example, since the gray block has a size equal to or larger than the size of M×N, the gray block represents a neighboring block that can be inserted into the candidate list. For example, when a specific neighboring block has a size of 16×8 or a size of 8×16 and the neighboring block can be inserted into the candidate list, the candidate list for the current block X is configured to include at least one of blocks A, C, P, Q, and S.
[0300] exist Figure 14 In the example, the gray block represents a neighboring block that can be inserted into the candidate list because the gray block has an area equal to or greater than the product of M and N (M×N). For example, when a specific neighboring block has an area of 128 (=16×8) or (=8×16), the neighboring block can be inserted into the candidate list, and the candidate list for the current block X is configured to include at least one of blocks A, C, F, P, Q, R, and S.
[0301] Figure 15 and Figure 16 is a diagram illustrating a method of inserting neighboring blocks adjacent to a current block into a candidate list according to depths of the neighboring blocks according to one embodiment of the present invention.
[0302] According to the depth of each neighboring block, a maximum of V neighboring blocks among all neighboring blocks of the current block may be inserted into the candidate list for the current block.
[0303] For example, a maximum of V neighboring blocks having a depth equal to or greater than K among the neighboring blocks may be inserted into the candidate list for the current block. Alternatively, a maximum of V neighboring blocks having a depth equal to or less than K among the neighboring blocks may be inserted into the candidate list for the current block.
[0304] Furthermore, optionally, a maximum of V neighboring blocks of all neighboring blocks of the current block whose depths are in the range of K to L may be inserted into the candidate list for the current block. Here, L may be 0 or any positive integer.
[0305] Here, K may be 0 or any positive integer. K may be determined based on at least one of the encoding parameters of the current block and the encoding parameters of the candidate. In addition, K may be a value preset in the encoder / decoder or a value signaled from the encoder to the decoder.
[0306] For example, neighboring blocks adjacent to the current block may be preferentially inserted into the candidate list in the order of decreasing partition depth. Alternatively, neighboring blocks adjacent to the current block may be preferentially inserted into the candidate list in the order of increasing partition depth.
[0307] As another example, when a specific neighboring block has a depth equal to or greater than the depth of the current block, the neighboring block may be inserted into the candidate list. As another example, when a specific neighboring block has a depth equal to or less than the depth of the current block, the neighboring block may be inserted into the candidate list.
[0308] exist Figure 15 In the example, because the gray block has a depth equal to or greater than K, the gray block is a neighboring block that can be inserted into the candidate list. For example, the current block X has a depth of 1, block A has a depth of 2, and blocks B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, and S have a depth of 3. These block depth examples are generally applicable to the subsequent figures of the accompanying drawings. For example, when a specific neighboring block has a depth equal to or greater than 3 and the neighboring block can be inserted into the candidate list, the candidate list for the current block X is configured to include at least one of blocks B, C, D, E, F, G, J, K, M, O, P, Q, and S.
[0309] exist Figure 16 , since the gray block has a depth equal to or less than K, the gray block is a neighboring block that can be inserted into the candidate list. For example, when a specific neighboring block has a depth equal to or less than 2 and the neighboring block can be inserted into the candidate list, the candidate list for the current block X is configured to include block A.
[0310] Figure 17 and Figure 18 is a diagram illustrating a method of inserting neighboring blocks adjacent to a current block into a candidate list according to a partition type of the neighboring blocks according to an embodiment of the present invention.
[0311] According to the partition type of each neighboring block, a maximum of V neighboring blocks among all neighboring blocks of the current block may be inserted into a candidate list for the current block.
[0312] For example, at least one of the quadtree blocks generated from the quadtree partitioning in the neighboring blocks of the current block may be inserted into the candidate list for the current block. Alternatively, at least one of the binary tree blocks generated from the binary tree partitioning in the neighboring blocks of the current block may be inserted into the candidate list for the current block. Alternatively, at least one of the ternary tree blocks generated from the ternary tree partitioning in the neighboring blocks of the current block may be inserted into the candidate list for the current block.
[0313] Whether any of the partition types of the neighboring blocks is included in the candidate list may be determined based on at least one of the encoding parameters of the current block or the neighboring block and the encoding parameters of the corresponding candidate. In addition, this may be determined according to a method existing in the encoder and the decoder, or may be determined by a value signaled from the encoder to the decoder.
[0314] Here, a binary tree partition may refer to an asymmetric binary tree partition in which nodes have different sizes, and a symmetric binary tree partition in which nodes have the same size. Furthermore, a ternary tree partition may refer to an asymmetric ternary tree partition in which the upper and lower blocks on either side of a middle block have different sizes, or the left and right blocks on either side of a middle block have different sizes, and a symmetric ternary tree partition in which the upper and lower blocks have the same size, or the left and right blocks have the same size.
[0315] Among the neighboring blocks adjacent to the current block, the neighboring blocks of the quadtree partition, the neighboring blocks of the binary tree partition, and the neighboring blocks of the ternary tree partition may be sequentially inserted into the candidate list in this order. Alternatively, among the neighboring blocks of the current block, the neighboring blocks generated by the ternary tree partition, the neighboring blocks generated by the binary tree partition, and the neighboring blocks generated by the quadtree partition may be sequentially inserted into the candidate list in this order.
[0316] Furthermore, optionally, when the partition type of a specific neighboring block is the same as the partition type of the current block, the neighboring block may be inserted into the candidate list. Furthermore, optionally, when the partition type of a specific neighboring block is different from the partition type of the current block, the neighboring block may be inserted into the candidate list.
[0317] Figure 17 This figure illustrates a state where a gray block can be added to a candidate list because it is a neighboring block with a binary tree partition type. For example, blocks X, A, H, I, J, K, L, M, N, and O are quadtree blocks, blocks B, C, D, E, F, and G are ternary tree blocks, and blocks P, Q, R, and S are binary tree blocks. These examples of block partition types are commonly used in subsequent figures of the accompanying drawings. For example, when a particular neighboring block is a ternary tree partition block, that neighboring block can be added to the candidate list. Therefore, the candidate list for the current block X is configured to include at least one of blocks B, C, D, E, F, and G.
[0318] Figure 18 This figure shows that the gray block can be added to the candidate list because it is a neighboring block with the same partition type as the current block. For example, when the current block X is a quadtree block, the quadtree neighboring block can be added to the candidate list. Therefore, the candidate list for the current block X is configured to include at least one of blocks A, J, K, M, and O.
[0319] Figure 19 and Figure 20 is a diagram illustrating a method of inserting neighboring blocks adjacent to a current block into a candidate list according to a block form of the neighboring blocks according to one embodiment of the present invention.
[0320] According to the block form of each neighboring block, a maximum of V neighboring blocks among all neighboring blocks of the current block may be inserted into the candidate list for the current block.
[0321] For example, at least one neighboring block having a square form among the neighboring blocks of the current block may be inserted into the candidate list for the current block. Alternatively, at least one neighboring block having a non-square form (rectangular form) among the neighboring blocks of the current block may be inserted into the candidate list for the current block.
[0322] Among the neighboring blocks of the current block, square neighboring blocks are preferentially inserted into the candidate list, and then non-square neighboring blocks are inserted into the candidate list. Among the neighboring blocks of the current block, non-square neighboring blocks are preferentially inserted into the candidate list, and then square neighboring blocks are inserted into the candidate list.
[0323] In addition, optionally, when the block form of the specific neighboring block is the same as that of the current block, the neighboring block may be inserted into the candidate list. Further optionally, when the block form of the specific neighboring block is different from that of the current block, the neighboring block may be inserted into the candidate list.
[0324] Figure 19 This shows that the gray block can be inserted into the candidate list because it is a neighboring block with a non-square block shape. For example, when a specific neighboring block has a non-square block shape, the neighboring block can be inserted into the candidate list. Therefore, the candidate list for the current block X is configured to include at least one of blocks B, C, D, G, Q, and S.
[0325] Figure 20 This figure shows that the gray block is a neighboring block with the same block form as the current block, so the gray block can be added to the candidate list. For example, when the current block X is a square block, the neighboring block with a square block form can be added to the candidate list. Therefore, the candidate list for the current block X is configured to include at least one of blocks A, J, K, M, and O.
[0326] When at least one of a boundary and a vertex of the current block contacts at least one of a boundary and a vertex of a neighboring block, the neighboring block is included in the candidate list using at least one of a relative length of a boundary of the neighboring block contacting the boundary or the vertex, a relative size of the neighboring block, and a relative depth of the neighboring block.
[0327] For example, up to V neighboring blocks may be included in the candidate list for the current block according to relative lengths of boundaries of neighboring blocks contacting the boundary, relative sizes of neighboring blocks, or relative depths of neighboring blocks.
[0328] For example, when there are a first neighboring block having a boundary length of M and a second neighboring block having a boundary length of N, M and N are compared, and a specific neighboring block may be inserted into the candidate list according to the comparison result.
[0329] For example, when there is a first neighboring block with a boundary length of 4 and a second neighboring block with a boundary length of 8, the second neighboring block with a relatively long boundary length (i.e., 8) may be inserted into the candidate list. For example, when there is a first neighboring block with a boundary length of 16 and a second neighboring block with a boundary length of 4, the second neighboring block with a relatively short boundary length (i.e., 4) may be inserted into the candidate list.
[0330] Alternatively, when there is a first neighboring block of size N×M and a second neighboring block of size P×Q, the sizes of the two neighboring blocks are compared, and only a specific neighboring block may be inserted into the candidate list based on the comparison result. In this case, N, M, P, and Q may each be the same positive integer or different positive integers.
[0331] Alternatively, when there are a first neighboring block having a size of 8×8 and a second neighboring block having a size of 16×16, the second neighboring block having a relatively large size (ie, 16×16) may be inserted into the candidate list.
[0332] Further optionally, when there is a first neighboring block with a block depth of M and a second neighboring block with a block depth of N, M and N are compared, and a specific neighboring block therein may be inserted into the candidate list according to the comparison result.
[0333] For example, when there are a first neighboring block having a block depth of 0 and a second neighboring block having a block depth of 2, the first neighboring block having a relatively shallow depth of 0 may be inserted into the candidate list.
[0334] Figure 21 is a diagram illustrating a method of inserting neighboring blocks into a candidate list in an encoding / decoding order according to one embodiment of the present invention.
[0335] Up to V neighboring blocks earlier than the current block may be inserted into the candidate list for the current block according to the order in which the neighboring blocks are encoded / decoded. Here, the encoding / decoding order is at least one of a horizontal priority order, a vertical priority order, a zigzag order, a zigzag order, an upper right diagonal order, a lower left diagonal order, a raster order, a depth priority order, and a size priority order.
[0336] exist Figure 21 In the figure, gray blocks are neighboring blocks that can be inserted into the candidate list in the order of encoding / decoding. For example, when neighboring blocks are encoded / decoded in the order of A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, and S, up to Z neighboring blocks starting with block A can be inserted into the candidate list in that order. Figure 21 The case where Z is 4 is shown. In this case, the candidate list for the current block X is configured to include blocks A, B, C, and D.
[0337] Figure 22is a diagram illustrating a method of inserting a neighboring block into a candidate list according to positions of neighboring blocks spaced a certain distance apart from the position of a current block according to one embodiment of the present invention.
[0338] Among neighboring blocks located at a specific distance from the current block, up to V neighboring blocks may be inserted into the candidate list for the current block. That is, when there are multiple blocks between the current block and a specific neighboring block, up to V neighboring blocks that meet specific conditions may be inserted into the candidate list for the current block.
[0339] Here, the value of V may be determined based on at least one of the encoding parameter of the current block and the encoding parameter of the corresponding candidate. In addition, V may be a value preset in the encoder and the decoder, or may be a value signaled from the encoder to the decoder.
[0340] One or more blocks located at a horizontal distance of -K×M, a horizontal distance of +K×M, a vertical distance of -L×N, and a vertical distance of +L×N from a specific position of the current block may be determined as neighboring blocks, and the neighboring blocks may be inserted into a candidate list. Blocks located at positions spaced apart from at least one specific position of the current block by a horizontal distance of -K×M or +K×M and a vertical distance of -L×N or +L×N may be determined as neighboring blocks, and the neighboring blocks may be inserted into a candidate list.
[0341] In addition, at least one of the blocks included in the specific region based on the current block among the neighboring blocks existing in the above-mentioned position may be included in the candidate list for the current block. Here, the specific region may be a region preset in the encoder / decoder or may be signaled from the encoder to the decoder.
[0342] That is, M and N may refer to relative distances with respect to specific locations in the current block. The specific position in the current block can be at least one of the following positions: (0,0) position, (width-1,0) position, (width,0) position, (0, height-1) position, (0, height) position, (-1,-1) position, (-1,0) position, (0,-1) position, (width-1,-1) position, (width,-1) position, (-1, height-1) position, (-1, height) position, (width / 2-1,0) position, (width / 2,0) position, (width / 2+1,0) position, (0, height / 2-1) position, (0, height / 2) position, (0, height / 2+1) position, (width / 2-1,-1) position, (width / 2,-1) position, (width / 2+1,-1) position, (-1, height / 2-1) position, (-1, height / 2) position, and (-1, height / 2+1) position.
[0343] N may represent a vertical distance based on a sample point, and each of M and N may be a positive integer. In addition, M and N may be the same value or different values. At least one of M and N may be determined based on at least one of a coding parameter of a current block and a coding parameter of a candidate. In addition, at least one of M and N may be a value preset in an encoder / decoder or a value signaled from an encoder to a decoder.
[0344] Here, the maximum value of the absolute value of M may be MaxM, and the maximum value of the absolute value of N may be MaxN. The absolute value of M and the absolute value of N may be determined to be less than or equal to K or L times the size of the CTU.
[0345] Here, at least one of MaxM and MaxN may be a positive integer. At least one of MaxM and MaxN may be determined based on at least one of the encoding parameters of the current block and the encoding parameters of the candidate. In addition, at least one of MaxM and MaxN may be a value preset in the encoder / decoder or a value signaled from the encoder to the decoder.
[0346] Here, at least one of K and L may be 0 or any positive integer. At least one of K and L may be determined based on the encoding parameter of the current block and at least one of the candidate encoding parameters. In addition, at least one of K and L may be a value preset in the encoder / decoder or a value signaled from the encoder to the decoder.
[0347] When blocks spaced at least one of a horizontal distance of -K×M or +K×M and a vertical distance of -L×N or +L×N exist at a boundary of at least one of a picture, a sub-picture, a slice, a tile, a partition, a CTU, a CTU row, and a CTU column, or exist outside a boundary of at least one of a picture, a sub-picture, a slice, a tile, a partition, a CTU, a CTU row, and a CTU column, the neighboring blocks at the position are not included in the candidate list.
[0348] Furthermore, when at least one of the neighboring blocks immediately adjacent to the current block does not exist, at least one of the neighboring blocks existing at a certain distance based on the position of the current block is included in the candidate list.
[0349] When neighboring blocks located at a specific distance from the current block are inserted into the candidate list, the neighboring blocks may be inserted into the candidate list according to a specific scanning order. Here, the specific scanning order is at least one of a horizontal priority order, a vertical priority order, a zigzag order, a zigzag order, an upper right diagonal order, a lower left diagonal order, a raster order, a depth priority order, and a size priority order. Furthermore, the neighboring blocks may be inserted into the candidate list in order of increasing distance from the current block.
[0350] exist Figure 22 In , the gray block represents a neighboring block that can be inserted into the candidate list because it is located at a specific distance from the current block. Figure 22 The portion indicated by the diagonal line in may represent at least one of a picture, a sub-picture, a slice, a tile, a partition, a CTU boundary, a CTU row, and a CTU column.
[0351] like Figure 22 As shown in the example of , when the current block X is a 16×16 block and M and N are both 16, neighboring blocks that do not extend beyond the boundaries of a picture, a sub-picture, a slice, a tile, a partition, a CTU, a CTU row, and a CTU column are inserted into the candidate list. That is, the candidate list for the current block X is configured to include at least one of blocks A0, A1, A3, A6, A7, A8, B0, B1, C0, C1, D0, D1, D2, D3, D4, D5, D6, E0, E1, E2, F0, F1, F2, G0, G1, G2, G3, G4, and G5. Therefore, neighboring blocks that exist at relative positions to the position of the current block can be inserted into the candidate list for the current block.
[0352] For example, in order to reduce the size of the line buffer, when blocks separated by at least one of a horizontal distance of -K×M or +K×M and a vertical distance of -L×N or +L×N among neighboring blocks at the position exist at a boundary of at least one of a picture, a sub-picture, a slice, a tile, a partition, a CTU boundary, a CTU row, and a CTU column, or exist outside a boundary of at least one of a picture, a sub-picture, a slice, a tile, a partition, a CTU boundary, a CTU row, and a CTU column, the blocks outside the boundary of the picture, the sub-picture, the slice, the tile, the partition, the CTU boundary, the CTU row, and the CTU column are not included in the candidate list, and blocks at the boundary of the picture, the sub-picture, the slice, the tile, the partition, the CTU boundary, the CTU row, and the CTU column are included in the candidate list.
[0353] Furthermore, within a neighboring block that exists at a specific distance based on the position of the current block, information about a block existing at the specific position may be determined as information about a representative block of the neighboring blocks, and the representative block may be included in the candidate list. For example, the specific position may be at least one of an upper left position, a lower left position, an upper right position, a lower right position, a center position, an upper left position adjacent to the center position, a lower left position adjacent to the center position, an upper right position adjacent to the center position, and a lower right position adjacent to the center position within the neighboring block.
[0354] The fact that a specific block exists at a boundary of at least one of a picture, a sub-picture, a slice, a tile, a partition, a CTU boundary, a CTU row, and a CTU column means that the specific block does not belong to at least one of the picture, sub-picture, slice, tile, partition, CTU boundary, CTU row, and CTU column to which the current block belongs, but belongs to at least one of another picture, another sub-picture, another slice, another tile, another partition, another CTU boundary, another CTU row, and another CTU column and exists at a boundary of at least one of the picture, the sub-picture, the slice, the tile, the partition, the CTU boundary, the CTU row, and the CTU column. In other words, this means that the specific block exists in at least one of the picture, sub-picture, slice, tile, partition, CTU boundary, CTU row, and CTU column above and / or to the left of the current block.
[0355] The fact that a specific block extends beyond the boundary of at least one of a picture, a sub-picture, a slice, a tile, a partition, a CTU boundary, a CTU row, and a CTU column may indicate that the specific block belongs to at least one of a picture, a sub-picture, a slice, a tile, a partition, a CTU boundary, a CTU row, and a CTU column that are different from the picture, sub-picture, a slice, a tile, a partition, a CTU boundary, a CTU row, and a CTU column to which the current block belongs, and may specifically indicate that the specific block exists in at least one of a picture, a sub-picture, a slice, a tile, a partition, a CTU boundary, a CTU row, and a CTU column. In other words, this indicates that the specific block exists in at least one of a picture, a sub-picture, a slice, a tile, a partition, a CTU boundary, a CTU row, and a CTU column that is above or to the left of the current block.
[0356] Figure 23 is a diagram illustrating a method of inserting a neighboring block into a candidate list according to a position of the neighboring block located a specific distance from a position of at least one selected from a current picture, a sub-picture, a slice, a tile, and a partition according to one embodiment of the present invention.
[0357] Among neighboring blocks located at a specific distance from the current picture, sub-picture, slice, tile, partition, CTU boundary, CTU row, and CTU column, up to V neighboring blocks may be inserted into the candidate list for the current block. That is, when multiple blocks exist between the current block and a specific neighboring block, up to V neighboring blocks may be inserted into the candidate list for the current block.
[0358] A block located at a position spaced at least one of a horizontal distance K×M and a vertical distance L×N from a specific position of a current picture, a sub-picture, a slice, a tile, a partition, a CTU boundary, a CTU row, or a CTU column is determined as a neighboring block of the current block, and the neighboring block may be inserted into the candidate list. A block located at a position spaced at least one of a horizontal distance K×M and a vertical distance L×N from a specific position of at least one of the current picture, a sub-picture, a slice, a tile, a partition, a CTU boundary, a CTU row, and a CTU column may be determined as a neighboring block, and the neighboring block may be inserted into the candidate list.
[0359] In addition, among the neighboring blocks located at the above-mentioned positions, blocks included in a specific area relative to the current block may be inserted into the candidate list for the current block. In this case, the specific area may be an area preset in the encoder / decoder, or may be an area signaled from the encoder to the decoder.
[0360] M and N may be absolute distances from a specific location of at least one of a current picture, a current sub-picture, a current slice, a current tile, a current partition, a current CTU boundary, a current CTU row, and a current CTU column. The specific location of at least one of the current picture, the current sub-picture, the current slice, the current tile, the current partition, the current CTU boundary, the current CTU row, and the current CTU column may be defined as the (0,0) location.
[0361] Here, M may represent a horizontal distance based on a sample point, and N may represent a vertical distance based on a sample point, and each of M and N may be a positive integer such as 2, 4, 8, 16, 32 (i.e., 2 to the power of n). In addition, M and N may be the same value or different values. At least one of M and N may be determined based on at least one of a coding parameter of the current block and a candidate coding parameter. In addition, at least one of M and N may be a value preset in an encoder / decoder or a value signaled from an encoder to a decoder.
[0362] Here, at least one of K and L may be 0 or any positive integer. At least one of K and L may be determined based on the encoding parameter of the current block and at least one of the candidate encoding parameters. In addition, at least one of K and L may be a value preset in the encoder / decoder or a value signaled from the encoder to the decoder.
[0363] When there is no at least one of the neighboring blocks that is in direct contact with the current block, the neighboring blocks located at a specific distance from the position of the current picture, sub-picture, slice, tile, partition, CTU boundary, CTU row, and CTU column may be inserted into the candidate list.
[0364] When neighboring blocks located at a specific distance from the current picture, sub-picture, slice, tile, partition, CTU boundary, CTU row, or CTU column are inserted into the candidate list, the neighboring blocks are inserted in a specific scanning order. Here, the specific scanning order may be at least one of a horizontal priority order, a vertical priority order, a zigzag order, a zigzag order, an upper right diagonal order, a lower left diagonal order, a raster order, a depth priority order, and a size priority order. In addition, the candidate blocks may be inserted into the candidate list in order of increasing distance from the neighboring blocks to the current block.
[0365] exist Figure 23 In , since the gray block is located at a certain distance from the position of the current picture, the gray block represents a neighboring block that can be inserted into the candidate list.
[0366] exist Figure 22 In the example of , the specific position of the current picture is the (0,0) position, the current block X is a 16×16 block, K and L are positive integers including 0, and M and N are both 16. In this case, a neighboring block located at a position (K×M, L×N) relative to the position (0,0) of the current picture can be inserted into the candidate list. Therefore, the candidate list for the current block X is configured to include at least one of blocks 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, and 23. In the position (K×M, L×N), K of the x coordinate and L of the y coordinate may be the same value or may be different values. Therefore, a neighboring block existing at an absolute position based on the position of at least one of the current picture, sub-picture, slice, tile, partition, CTU boundary, CTU row, and CTU column can be inserted into the candidate list for the current block.
[0367] According to the relationship between the encoding parameters of the current block and the encoding parameters of the neighboring blocks, a maximum of V neighboring blocks among all the neighboring blocks of the current block may be inserted into the candidate list for the current block.
[0368] When at least one of the encoding parameters of the current block is identical to at least one of the encoding parameters of a neighboring block adjacent to the current block, a maximum of V blocks of the neighboring blocks may be inserted into the candidate list for the current block.
[0369] For example, between the current block and a specific neighboring block, when the prediction mode is the same, when the intra-frame luma prediction mode / direction is the same, when the intra-frame chroma prediction mode / direction is the same, when the motion vector is the same, when the motion vector difference is the same, when the reference picture list is the same, when the reference picture index is the same, when the reference picture is the same, when the inter-frame prediction direction (inter-frame prediction indicator, prediction list utilization flag) is the same, when the merge mode utilization information is the same, when the skip mode utilization information is the same, when the motion vector prediction index is the same, when the merge index is the same, when the motion vector representation accuracy is the same, when the transform size is the same, when the first transform utilization information is the same, when the second transform utilization information is the same, when the first transform index is the same, when the second transform index is the same, when the residual signal presence information is the same, or when the quantization parameter is the same, the neighboring block can be inserted into the candidate list.
[0370] When at least one of the encoding parameters of the current block is similar to at least one of the encoding parameters of the neighboring blocks adjacent to the current block, up to V blocks of the neighboring blocks may be inserted into the candidate list for the current block.
[0371] For example, when the difference between the intra-frame luma prediction mode / direction of the current block and the intra-frame luma prediction mode / direction of the neighboring block is equal to or less than T, when the difference between the motion vector of the current block and the motion vector of the neighboring block is equal to or less than T, when the difference between the motion vector difference of the current block and the motion vector difference of the neighboring block is equal to or less than T, or when the difference between the reference picture index of the current block and the reference picture index of the neighboring block is equal to or less than T, the neighboring block may be inserted into the candidate list. Here, T may be a real number.
[0372] For example, when the reference picture lists between the current block and the neighboring block are different but the reference pictures are the same, or when the reference picture indexes between the current block and the neighboring block are different but the reference pictures are the same, the neighboring block may be inserted into the candidate list.
[0373] For example, the encoder or the decoder may entropy encode / decode encoding parameter identifiers of neighboring blocks to be included in the candidate list, and may include the neighboring blocks in the candidate list based on similarity between the encoding parameters.
[0374] For example, the encoder may entropy encode the encoding parameter identifiers of the neighboring blocks to be included in the candidate list, and may include the neighboring blocks having the same value as the encoding parameter, the neighboring blocks having a value greater than the encoding parameter, or the neighboring blocks having a value smaller than the encoding parameter in the candidate list.
[0375] The decoder may entropy decode the encoding parameter identifiers of the neighboring blocks to be included in the candidate list, and may include the neighboring blocks having the same value as the encoding parameter, the neighboring blocks having a value greater than the encoding parameter, or the neighboring blocks having a value smaller than the encoding parameter in the candidate list.
[0376] As another example, a block in the reference picture that has the same spatial (co-located) position as the current block may be included in the candidate list for the current block as a neighboring block. Here, a block temporally adjacent to the current block may refer to a block in the reference picture that has the same spatial position as the current block, or a block in the reference picture that has a corresponding spatial position as the current block.
[0377] For example, in an image other than the image to which the current block belongs, at least one neighboring block among neighboring blocks belonging to a reference picture for the current image may be included in the candidate list. The at least one neighboring block among the neighboring blocks belonging to the reference picture may be referred to as a temporally adjacent neighboring block.
[0378] Here, the neighboring block may refer to a block in the reference picture that has the same spatial (co-located) position as the current block, or a block in the reference picture that is adjacent to a block having the same spatial position as the current block.
[0379] Hereinafter, step S820 of selecting and determining a reference block for encoding / decoding the current block from among the neighboring blocks included in the candidate list will be described in detail.
[0380] Before selecting and determining a reference block to be used for encoding / decoding the current block from the neighboring blocks in the candidate list, the candidate list may be modified using at least one or a combination of the methods described below. When a combination of the methods described below is used, the methods are performed in a specific order to modify the candidate list.
[0381] Each neighboring block included in the candidate list is referred to as a candidate, and information about each neighboring block included in the candidate list is also referred to as a candidate. Each block included in the candidate list is referred to as a candidate, and information about each block included in the candidate list is also referred to as a candidate.
[0382] The candidates in the candidate list are sorted in a specific order. The sorting may be performed based on at least one of the encoding parameters of the current block and the encoding parameters of the candidates.
[0383] The sorting may be performed such that the values of the coding parameters of the current block and the values of the candidate coding parameters are arranged in ascending order. The sorting may be performed such that the values of the coding parameters of the current block and the values of the candidate coding parameters are arranged in descending order.
[0384] The encoder sorts the candidates in the candidate list in the order of high probability that the candidates in the candidate list are determined to be reference blocks, and assigns candidate indexes of short codeword lengths to the candidates with high probability, thereby improving encoding efficiency.
[0385] In this case, the encoder or decoder may limit the size of the candidate list to a maximum value U. Here, U may be 0 or any positive integer. U may be determined based on at least one of the encoding parameters of the current block and the encoding parameters of the candidate. In addition, U may be a value preset in the encoder / decoder or a value signaled from the encoder to the decoder.
[0386] For example, when there are more than U candidates in the candidate list, the excess candidates may be eliminated from the candidate list. The candidates to be eliminated may be determined according to a specific sort order of the candidates in the candidate list.
[0387] The encoder or decoder may eliminate up to U candidates from the candidate list. Here, U may be 0 or any positive integer. U may be determined based on at least one of the encoding parameters of the current block and the encoding parameters of the candidate. Furthermore, U may be a value preset in the encoder / decoder or a value signaled from the encoder to the decoder.
[0388] When at least two candidates are duplicated in the candidate list, at least one of the duplicate candidates may be removed from the candidate list. In this case, the duplicate candidate with a higher ranking in the candidate list may remain in the candidate list, and the other candidates with a lower ranking may be removed from the candidate list. Here, when at least one of the coding parameters of the candidates overlaps, these may be referred to as duplicate candidates.
[0389] For example, a method opposite to the method of using at least one embodiment or at least one combination of the embodiments in step S810 may be used to determine whether a candidate in the candidate list is removed.
[0390] The encoder or decoder may add up to U candidates to the candidate list. Here, U may be 0 or any positive integer. U may be determined based on at least one of the encoding parameters of the current block and the encoding parameters of the candidate. Furthermore, U may be a value preset in the encoder / decoder or a value signaled from the encoder to the decoder.
[0391] Candidates are added to the candidate list until the number of candidates in the candidate list reaches the maximum number. In this case, duplicate candidates can be added to the candidate list.
[0392] When the encoder or decoder adds a candidate to the candidate list, at least one or a combination of the embodiments of step S810 may be used.
[0393] Furthermore, when a candidate targeted for addition to the candidate list overlaps with a candidate within the candidate list, the candidate targeted for addition is not added to the candidate list.
[0394] The encoder or decoder may determine up to W neighboring blocks (candidates) included in the candidate list as reference blocks for the current block. The encoder or decoder may determine up to W pieces of block information (candidates) of the neighboring blocks included in the candidate list as information about the reference block of the current block.
[0395] Here, W may be 0 or any positive integer. W may be determined based on at least one of the encoding parameters of the current block and the encoding parameters of the candidate. In addition, W may be a value preset in the encoder / decoder or a value signaled from the encoder to the decoder.
[0396] For example, when the current block is predicted using the above-mentioned triangular partitioning mode, the encoder or decoder determines W candidates among the candidates included in the candidate list as information of the reference block for the current block, so as to perform encoding / decoding on the current block. For example, W may be 2. When the size of the current block is equal to or greater than M×N, the current block is encoded / decoded using the triangular partitioning mode. The triangular partitioning mode may be an example of a merge mode. That is, in the above-mentioned example, the candidate list for performing encoding / decoding may refer to a merged candidate list. Whether the current block is encoded / decoded using the triangular partitioning mode may be signaled at the coding unit level. Here, M and N may be positive integers. In addition, M and N may be the same value or different values. For example, M and N may be 8.
[0397] When encoding / decoding the current block using the triangular partitioning mode, the current block is divided into two triangular regions. In this case, the partitioning direction information used to divide the current block into the two triangular regions may be encoded / decoded. To encode / decode each of the two triangular regions, a neighboring block for encoding / decoding the corresponding triangular region may be selected from a candidate list.
[0398] The index of the corresponding triangular area can be encoded / decoded to derive the motion information of each triangular area. For example, when the current block is divided into a first area and a second area, the first index for encoding / decoding the first area and the second index for encoding / decoding the second area can be encoded / decoded. When two pieces of information about the reference block of the current block are determined, the information indicated by the first index can be information about the first reference block of the current block, and the information indicated by the second index can be information about the second reference block of the current block.
[0399] The encoder or decoder can select a first neighboring block and a second neighboring block from a candidate list for the current block using the first index and the second index. In this case, the first region and the second region can share a candidate list derived based on the current block that has not yet been divided. The encoder or decoder can use information of the selected first neighboring block to encode / decode the first region, and use information of the selected second neighboring block to encode / decode the second region.
[0400] In the above-described triangular partitioning mode, the current block is divided in a diagonal direction, and prediction is performed on each region. However, the triangular partitioning mode may also represent the operation described below.
[0401] When encoding / decoding a current block in triangular partitioning mode, a first neighboring block and a second neighboring block may be selected from a single candidate list based on a first index and a second index for the current block. The encoder or decoder may derive a first prediction block for the current block using information of the first neighboring block and derive a second prediction block for the current block using information of the second neighboring block.
[0402] The encoder or decoder can generate a final prediction block for the current block by calculating a weighted sum of the first prediction block and the second prediction block. In this case, the weighted sum of the prediction blocks can be performed by weighting the first area of the first prediction block and weighting the second area of the second prediction block.
[0403] The first neighboring block may represent a first reference block of the current block, and the second neighboring block may represent a second reference block of the current block. Information of the first neighboring block may represent information of the first reference block of the current block, and information of the second neighboring block may represent information of the second reference block of the current block.
[0404] The encoder or decoder may encode / decode the current block using at least one of the determined reference blocks. The encoder or decoder may encode / decode the current block using at least one piece of block information of the determined reference blocks.
[0405] At least one piece of block information of the determined reference blocks may be determined as information of the current block.At least one piece of block information of at least one reference block among the determined reference blocks may be determined as block information of the current block.
[0406] Hereinafter, a method by which an encoder or decoder determines a specific neighboring block in a candidate list as a reference block will be described. The encoder or decoder may determine a candidate in a candidate list as a reference block using at least one or at least one combination of the methods described below.
[0407] For example, the encoder or decoder may determine the Yth candidate in the candidate list as the reference block. Here, Y can be 0 or any positive integer. Y can be determined based on at least one of the encoding parameters of the current block and the encoding parameters of the candidate. In addition, Y can be a value preset in the encoder / decoder or a value signaled from the encoder to the decoder.
[0408] Since the Yth candidate in the candidate list can be identified by the encoder / decoder, entropy encoding / decoding of the candidate index of the specified reference block may not be performed. Sorting of the candidates in the candidate list to determine the Yth candidate may be performed according to the above-described embodiment of the method for storing the candidates in the candidate list.
[0409] As another example, the encoder or decoder may reduce or shorten the candidate list so that a maximum of Y candidates remain in the candidate list and determine the Y candidates as reference blocks. Here, Y may be 0 or any positive integer. Y may be determined based on at least one of the encoding parameters of the current block and the encoding parameters of the candidate. Furthermore, Y may be a value preset in the encoder / decoder or a value signaled from the encoder to the decoder.
[0410] For example, the encoder or the decoder may determine Y candidates as reference blocks by leaving only Y candidates having the highest probability of being selected as reference blocks among the candidates in the candidate list.
[0411] In this case, since the Y candidates in the candidate list can be identified by the encoder / decoder, the candidate index of the designated reference block may not be entropy encoded / decoded.
[0412] For example, the candidate list may be reduced or decreased using a method opposite to the method of using at least one embodiment or at least one combination of the embodiments in step S810 .
[0413] Alternatively, the encoder or decoder may determine the reference block by entropy encoding / decoding a candidate index indicating a specific candidate in the candidate list. Here, the candidate index may be a value to which the position, order, etc. of the specific candidate in the candidate list is mapped. The encoder or decoder may encode / decode the current block using the determined reference block (or at least one piece of block information of the determined reference block).
[0414] That is, the encoder may encode the current block using a reference block selected from the candidates in the candidate list (or at least one piece of block information of the reference block) and perform entropy encoding on the candidate index of the reference block. On the other hand, the decoder may entropy decode the candidate index of the reference block and use the candidate indicated by the candidate index among the candidates in the candidate list as the reference block (or at least one piece of block information of the reference block) to decode the current block.
[0415] For example, when the candidate list consists of {A, B, C, D, E, F}, the index of the candidate in the candidate list may be assigned {0, 1, 2, 3, 4, 5}. When the candidate index is 2, candidate C is determined as the reference block. In addition, when the candidate index is 1, candidate B is determined as the block information of the reference block.
[0416] The encoder or decoder may perform entropy encoding / decoding on a maximum of Y candidate indexes. When entropy encoding / decoding is performed on a plurality of candidate indexes, the current block may be encoded / decoded using a plurality of reference blocks indicated by the plurality of candidate indexes, respectively.
[0417] Here, Y may be 0 or any positive integer. Y may be determined based on at least one of the encoding parameters of the current block and the encoding parameters of the candidate. In addition, Y may be a value preset in the encoder / decoder or a value signaled from the encoder to the decoder.
[0418] That is, the encoder may encode the current block using the determined Y reference blocks from the candidates in the candidate list, and may entropy encode the Y candidate indexes of the Y reference blocks. On the other hand, the decoder may entropy decode the Y candidate indexes of the Y reference blocks, and may decode the current block using the Y reference blocks from the candidates in the candidate list, each indicated by the Y candidate indexes.
[0419] Hereinafter, a method of adding information of a current block to a candidate list according to an embodiment of the present invention will be described.
[0420] Figure 24 is a flowchart illustrating a method of encoding / decoding an image according to another embodiment of the present invention.
[0421] Reference Figure 24 , a decoding method according to the present invention may include: in step S2410, deriving block information of a current block by using a candidate list, in step S2420, generating a prediction block of the current block by using the block information of the current block, and in step S2430, adding the block information of the current block to the candidate list.
[0422] Here, the candidate list derived in step S2430 may be used for inter prediction of a subsequent block to be decoded after the current block.
[0423] As another example, the encoding / decoding method according to the present invention may include: deriving block information of the current block by using a candidate list, generating a prediction block of the current block by using the block information of the current block, and adding the block information of the current block to the candidate list.
[0424] As yet another example, the encoding / decoding method according to the present invention may include deriving a merge candidate list of a current block by using a candidate list, deriving motion information of the current block by using the merge candidate list, and adding the motion information of the current block to the candidate list.
[0425] As yet another example, the encoding / decoding method according to the present invention may include: deriving a motion vector of a current block by using a candidate list or a block vector candidate list, deriving motion information of the current block by using the motion vector or the block vector candidate list, and adding the motion information of the current block to the candidate list.
[0426] Here, the candidate list may be used for inter prediction of a block to be encoded after the current block.
[0427] Figure 25 is a diagram illustrating a method of adding block information of a current block to a candidate list according to an embodiment of the present invention.
[0428] At least one piece of block information of the current block used in the encoding or decoding process or generated after the encoding or decoding process may be added or included in the candidate list.
[0429] The information of the block may be at least one of encoding parameters such as an intra prediction mode, a motion vector, motion information, a block vector, a weighting factor value, an inter prediction direction, a reference picture index, an inter prediction indicator, a prediction list utilization flag, etc. Here, the weighting factor value may refer to a weighting factor value applied to each prediction block when generating a bi-prediction block.
[0430] For example, when the current block is not in the affine mode or the triangle partitioning mode, or when the sub-block based temporal motion vector derivation mode is not used, at least one piece of block information of the current block is included in the candidate list.
[0431] The candidate list according to the present invention is maintained during encoding / decoding for each picture, sub-picture, slice, tile, partition, CTU boundary, CTU row, and CTU column, and is used within each picture, sub-picture, slice, tile, partition, CTU boundary, CTU row, and CTU column. In addition, the candidate list according to the present invention may include at least one piece of block information of a block encoded / decoded before the current block within each picture, sub-picture, slice, tile, partition, CTU boundary, CTU row, and CTU column. In addition, the candidate list according to the present invention may include at least one piece of block information within a previously encoded / decoded unit. In the following description, the candidate list may refer to the candidate list according to the present invention.
[0432] like Figure 25As shown in , at least one piece of block information of a candidate in the candidate list may be determined or selected so as to be used in the encoding / decoding process of the current block. Here, the encoding / decoding process of the current block may be performed using the determined at least one piece of block information of the candidate.
[0433] Here, at least one piece of block information used in the encoding / decoding process of the current block or at least one piece of block information of the current block generated after the encoding / decoding process of the current block may be added to or included in the candidate list. In the following description, an operation of adding at least one of block information, a candidate, and a block to the candidate list and an operation of including at least one of block information, a candidate, and a block in the candidate list may have the same meaning.
[0434] For example, when at least one piece of block information of the current block is included in the candidate list, the at least one piece of block information of the current block is added to the beginning or end of the candidate list. In addition, the block information may be added to a position preset between the encoder and the decoder within the candidate list, or may be added to an arbitrary position signaled from the encoder to the decoder.
[0435] As another example, when at least one piece of block information of the current block is included in the candidate list, the maximum number of candidates in the candidate list is considered. When the number of candidates currently included in the candidate list is the maximum number of candidates, the block information of the current block is not included in the candidate list.
[0436] For example, the maximum number of candidates in the candidate list may be determined as P. Here, P may be a positive integer including 0. For example, P may be 5. P may be determined based on at least one of the encoding parameters of the current block and the encoding parameters of the candidate. In addition, P may be a value preset in the encoder / decoder, or may be a value signaled from the encoder to the decoder.
[0437] According to the present invention, the candidates within the candidate list may be added to or included in at least one of the following lists: an intra-frame prediction mode candidate list, a primary most probable mode (MPM) list, a secondary MPM list, a residual intra-frame prediction mode candidate list, a motion vector candidate list, a merge candidate list, a block vector candidate list, a block vector merge candidate list, a sub-block motion vector candidate list, and a sub-block merge candidate list.
[0438] Here, the main MPM list may be an intra-frame prediction mode candidate list including at least one of the following items: the intra-frame prediction mode of a spatially neighboring block, the intra-frame prediction mode (derived mode) derived as a result of subtracting a specific value from the intra-frame prediction mode of the spatially neighboring block or adding a specific value to the intra-frame prediction mode of the spatially neighboring block, and the default intra-frame prediction mode. Here, the default intra-frame prediction mode may be at least one of a DC mode, a planar mode, a vertical mode, and a horizontal mode, etc. The specific value may be at least one of 0, a positive integer, a negative integer, etc. The specific value may be determined based on at least one of the encoding parameters of the current block and the encoding parameters of the candidate. In addition, the specific value may be a value preset in the encoder / decoder, or may be a value signaled from the encoder to the decoder.
[0439] The secondary MPM list may be an intra prediction mode candidate list consisting of intra prediction modes not included in the primary MPM list. When a candidate in the primary MPM list is not determined as the intra prediction mode in the current block, a candidate in the secondary MPM list is determined as the intra prediction mode.
[0440] The residual intra prediction mode candidate list may be an intra prediction mode candidate list composed of intra prediction modes not included in at least one of the primary MPM list and the secondary MPM list. When a candidate included in at least one of the primary MPM list and the secondary MPM list is not determined as the intra prediction mode in the current block, the candidate in the residual intra prediction mode candidate list is determined as the intra prediction mode.
[0441] Therefore, the intra prediction mode candidate list may refer to at least one of a primary MPM list, a secondary MPM list, and a residual intra prediction mode candidate list.
[0442] For example, the candidates in the candidate list may be included at a specific position or item in the intra prediction mode candidate list.
[0443] For example, the candidate in the candidate list may be included at the very beginning of the intra-prediction mode candidate list. As another example, the candidate in the candidate list may be included at the very end of the intra-prediction mode candidate list. As yet another example, the candidate in the candidate list may be included before at least one of the spatial intra-prediction modes in the intra-prediction mode candidate list. As yet another example, the candidate in the candidate list may be included after at least one of the spatial intra-prediction modes in the intra-prediction mode candidate list. As yet another example, the candidate in the candidate list may be included before at least one of the derived intra-prediction modes in the intra-prediction mode candidate list. As yet another example, the candidate in the candidate list may be included after at least one of the derived intra-prediction modes in the intra-prediction mode candidate list. As yet another example, the candidate in the candidate list may be included before at least one of the default intra-prediction modes in the intra-prediction mode candidate list. As yet another example, the candidate in the candidate list may be included after at least one of the default intra-prediction modes in the intra-prediction mode candidate list.
[0444] As another example, the candidates in the candidate list may be included at a specific position or item in the motion vector candidate list.
[0445] For example, the candidate in the candidate list may be included at the very beginning of the motion vector candidate list. As another example, the candidate in the candidate list may be included at the very end of the motion vector candidate list. As yet another example, the candidate in the candidate list may be included before at least one of the spatial motion vectors in the motion vector candidate list. As yet another example, the candidate in the candidate list may be included after at least one of the spatial motion vectors in the motion vector candidate list. As yet another example, the candidate in the candidate list may be included before at least one of the temporal motion vectors in the motion vector candidate list. As yet another example, the candidate in the candidate list may be included after at least one of the temporal motion vectors in the motion vector candidate list. As yet another example, the candidate in the candidate list may be included before at least one of the zero motion vectors in the motion vector candidate list. As yet another example, the candidate in the candidate list may be included after at least one of the zero motion vectors in the motion vector candidate list.
[0446] As yet another example, a candidate in the candidate list may be included at a specific position or item in the merge candidate list.
[0447] For example, a candidate in the candidate list may be included at the very beginning of the merge candidate list. As another example, a candidate in the candidate list may be included at the very end of the merge candidate list. As yet another example, a candidate in the candidate list may be included before at least one spatial merge candidate among the spatial merge candidates in the merge candidate list. As yet another example, a candidate in the candidate list may be included after at least one spatial merge candidate among the spatial merge candidates in the merge candidate list. As yet another example, a candidate in the candidate list may be included before at least one temporal merge candidate among the temporal merge candidates in the merge candidate list. As yet another example, a candidate in the candidate list may be included after at least one temporal merge candidate among the temporal merge candidates in the merge candidate list. As yet another example, a candidate in the candidate list may be included before at least one combined merge candidate among the combined merge candidates in the merge candidate list. As yet another example, a candidate in the candidate list may be included after at least one combined merge candidate among the combined merge candidates in the merge candidate list. As yet another example, a candidate in the candidate list may be included before at least one zero merge candidate among the zero merge candidates in the merge candidate list. As yet another example, a candidate in the candidate list may be included after at least one zero merge candidate among the zero merge candidates in the merge candidate list.
[0448] As yet another example, a candidate in the candidate list may be included at a specific position or entry in the block vector candidate list.
[0449] For example, the candidate in the candidate list may be included at the very beginning of the block vector candidate list. As another example, the candidate in the candidate list may be included at the very end of the block vector candidate list. As yet another example, the candidate in the candidate list may be included before at least one spatial block vector among the spatial block vectors in the block vector candidate list. As yet another example, the candidate in the candidate list may be included after at least one spatial block vector among the spatial block vectors in the block vector candidate list. As yet another example, the candidate in the candidate list may be included before at least one zero block vector among the zero block vectors in the block vector candidate list. As yet another example, the candidate in the candidate list may be included after at least one zero block vector among the zero block vectors in the block vector candidate list.
[0450] As yet another example, a candidate in the candidate list may be included at a specific position or entry in the block vector merge candidate list.
[0451] For example, the candidate in the candidate list may be included at the very beginning of the block vector merge candidate list. As another example, the candidate in the candidate list may be included at the very end of the block vector merge candidate list. As yet another example, the candidate in the candidate list may be included before at least one spatial block vector merge candidate among the spatial block vector merge candidates in the block vector merge candidate list. As yet another example, the candidate in the candidate list may be included after at least one spatial block vector merge candidate among the spatial block vector merge candidates in the block vector merge candidate list. As yet another example, the candidate in the candidate list may be included before at least one combined merge candidate among the combined merge candidates in the block vector merge candidate list. As yet another example, the candidate in the candidate list may be included after at least one combined merge candidate among the combined merge candidates in the block vector merge candidate list. As yet another example, the candidate in the candidate list may be included before at least one zero block vector merge candidate among the zero block vector merge candidates in the block vector merge candidate list. As yet another example, the candidate in the candidate list may be included after at least one zero block vector merge candidate among the zero block vector merge candidates in the block vector merge candidate list.
[0452] As yet another example, the candidates in the candidate list may be included at a specific position or item in the sub-block motion vector candidate list.
[0453] For example, the candidate in the candidate list may be included at the very beginning of the sub-block motion vector candidate list. As another example, the candidate in the candidate list may be included at the very end of the sub-block motion vector candidate list. As yet another example, the candidate in the candidate list may be included before at least one spatial sub-block motion vector among the spatial sub-block motion vectors in the sub-block motion vector candidate list. As yet another example, the candidate in the candidate list may be included after at least one spatial sub-block motion vector among the spatial sub-block motion vectors in the sub-block motion vector candidate list. As yet another example, the candidate in the candidate list may be included before at least one temporal sub-block motion vector among the temporal sub-block motion vectors in the sub-block motion vector candidate list. As yet another example, the candidate in the candidate list may be included after at least one temporal sub-block motion vector among the temporal sub-block motion vectors in the sub-block motion vector candidate list. As yet another example, the candidate in the candidate list may be included before at least one zero motion vector among the zero motion vectors in the sub-block motion vector candidate list. As yet another example, the candidate in the candidate list may be included after at least one zero motion vector among the zero motion vectors in the sub-block motion vector candidate list.
[0454] As yet another example, the candidates in the candidate list may be included at a specific position or item in the sub-block merging candidate list.
[0455] For example, the candidate in the candidate list may be included at the very beginning of the sub-block merge candidate list. As another example, the candidate in the candidate list may be included at the very end of the sub-block merge candidate list. As yet another example, the candidate in the candidate list may be included before at least one spatial sub-block merge candidate among the spatial sub-block merge candidates in the sub-block merge candidate list. As yet another example, the candidate in the candidate list may be included after at least one spatial sub-block merge candidate among the spatial sub-block merge candidates in the sub-block merge candidate list. As yet another example, the candidate in the candidate list may be included before at least one temporal sub-block merge candidate among the temporal sub-block merge candidates in the sub-block merge candidate list. As yet another example, the candidate in the candidate list may be included after at least one temporal sub-block merge candidate among the temporal sub-block merge candidates in the sub-block merge candidate list. As yet another example, the candidate in the candidate list may be included before at least one combined merge candidate among the combined merge candidates in the sub-block merge candidate list. As yet another example, the candidate in the candidate list may be included after at least one combined merge candidate among the combined merge candidates in the sub-block merge candidate list. As yet another example, the candidate in the candidate list may be included before at least one zero merge candidate among the zero merge candidates in the sub-block merge candidate list. As yet another example, the candidate in the candidate list may be included after at least one zero merging candidate among the zero merging candidates in the sub-block merging candidate list.
[0456] In the above example, the combined merge candidate may be a merge candidate generated by combining at least one of the candidates in the merge candidate list. When generating the combined merge candidate, the average value of at least one of the vector values of the candidates is used. For example, in the above example, the combined merge candidate may refer to a merge candidate generated by calculating the average value of the vector values of two merge candidates.
[0457] The candidate list according to the present invention can be initialized at the start of a sequence, picture, sub-picture, slice, tile, partition, CTU boundary, CTU row, and CTU column. That is, for each sequence, picture, sub-picture, slice, tile, partition, CTU boundary, CTU row, and CTU column, all candidates in the candidate list can be deleted or initialized to at least one specific value.
[0458] For example, the candidate list may be initialized to a value of information of a block having a specific value. The specific value may be at least one of 0, a positive integer, and a negative integer. The specific value may be determined based on at least one of a coding parameter of the current block and a coding parameter of the candidate. Furthermore, the specific value may be a value preset in the encoder / decoder, or may be a value signaled from the encoder to the decoder.
[0459] Here, the specific value may be a value corresponding to one of the intra prediction modes, a value corresponding to a temporal motion vector, or the like.
[0460] For example, the specific value may be a value indicating the DC mode or the planar mode as the non-angular intra prediction mode.
[0461] As another example, the specific value may be a motion vector value of a collocated block in a collocated image. In other words, the specific value may be a temporal motion vector.
[0462] As another example, the specific value may be a sub-block based motion vector value of the collocated block within the collocated image. In other words, the specific value may be a sub-block based temporal motion vector value.
[0463] As yet another example, the specific value may be a zero (0,0) motion vector or block vector value.
[0464] According to the present invention, when block information of a current block is added to a candidate list, in order to prevent identical or similar block information from being included in the candidate list, a test is performed for overlap between at least one piece of information of a block already included in the candidate list and the information of the current block. As a result of the test for overlap, the at least one piece of block information of the current block may not be included in the candidate list. Furthermore, as a result of the test for overlap, the at least one piece of block information included in the candidate list may be removed, and the at least one piece of block information of the current block may be included in the candidate list.
[0465] The following description may be about a test for overlap between block information of a current block and candidates included in a candidate list when the block information of the current block is added to the candidate list.
[0466] The test for overlap may be performed only on the first M candidates in the candidate list. As another example, the test for overlap may be performed only on the last M candidates in the candidate list. Here, M may be a positive integer, including 0. For example, M may be 2. M may be determined based on at least one of the encoding parameters of the current block and the encoding parameters of the candidate. Furthermore, M may be a value preset in the encoder / decoder or a value signaled from the encoder to the decoder. Here, for the spatial motion vector above or to the left of the current block, the test for overlap may be performed on the two candidates at the beginning of the candidate list.
[0467] For example, when at least one piece of block information of the current block as the included target is different from at least one piece of information of a block included in the candidate list, the at least one piece of block information of the current block as the included target is included in the candidate list.
[0468] For example, at least one piece of block information of the current block as the included target may be added to the very beginning of the candidate list. As another example, at least one piece of block information of the current block as the included target may be added to the very end of the candidate list.
[0469] Furthermore, through one of the embodiments in which a specific candidate or candidate information is included at a specific position or item in the candidate list, the block information of the current block may be included in the candidate list.
[0470] As another example, when at least one piece of block information of the current block as the included target is identical to at least one piece of information of a block included in the candidate list, the at least one piece of block information of the current block as the included target is not included in the candidate list.
[0471] As yet another example, when at least one piece of block information of the current block as the included target is similar to at least one piece of information of a block included in the candidate list, the at least one piece of block information of the current block as the included target is not included in the candidate list.
[0472] For example, whether pieces of information of blocks included in the candidate list are similar may be determined by absolute values such as an intra prediction mode value, a motion vector value, a block vector value, and the like.
[0473] For example, when the absolute value of the difference between the value of the intra-frame prediction mode of the included target and the value of the intra-frame prediction mode included in the candidate list is equal to or less than T, the intra-frame prediction mode of the included target is not included in the candidate list. As another example, when the absolute value of the difference between the value of the motion vector or block vector of the included target and the value of the motion vector or block vector included in the candidate list is equal to or less than T, the motion vector or block vector of the included target is not included in the candidate list. As yet another example, when the absolute value of the difference between the X component value of the motion vector or block vector of the included target and the X component value of the motion vector or block vector included in the candidate list is equal to or less than T, the motion vector or block vector of the included target is not included in the candidate list. As yet another example, when the absolute value of the difference between the Y component value of the motion vector or block vector of the included target and the Y component value of the motion vector or block vector included in the candidate list is equal to or less than T, the motion vector or block vector of the included target is not included in the candidate list.
[0474] As yet another example, when at least one piece of block information of the current block as the included target is dissimilar to at least one piece of information of a block included in the candidate list, at least one piece of block information of the new current block as the included target is not included in the candidate list.
[0475] For example, whether pieces of information of blocks included in the candidate list are similar may be determined by absolute values such as an intra prediction mode value, a motion vector value, a block vector value, and the like.
[0476] For example, when the absolute value of the difference between the value of the intra-frame prediction mode of the included target and the value of the intra-frame prediction mode included in the candidate list is greater than T, the intra-frame prediction mode of the included target is not included in the candidate list. As another example, when the absolute value of the difference between the value of the motion vector or block vector of the included target and the value of the motion vector or block vector included in the candidate list is greater than T, the motion vector or block vector of the included target is not included in the candidate list. As yet another example, when the absolute value of the difference between the X component value of the motion vector or block vector of the included target and the X component value of the motion vector or block vector included in the candidate list is greater than T, the motion vector or block vector of the included target is not included in the candidate list. As yet another example, when the absolute value of the difference between the Y component value of the motion vector or block vector of the included target and the Y component value of the motion vector or block vector included in the candidate list is greater than T, the motion vector or block vector of the included target is not included in the candidate list.
[0477] Here, T may be a positive integer including 0. T may be determined based on at least one of the encoding parameters of the current block and the encoding parameters of the candidate. In addition, T may be a value preset in the encoder / decoder, or may be a value signaled from the encoder to the decoder.
[0478] In addition, T in the motion vector or block vector may be a value representing at least one of M / N pixels (such as an integer pixel, a 1 / 2 pixel, a 1 / 4 pixel, a 1 / 16 pixel, etc.). Here, M and N may be positive integers. M and N may be determined based on at least one of the encoding parameters of the current block and the encoding parameters of the candidate. In addition, M and N may be values preset in the encoder / decoder, or may be values signaled from the encoder to the decoder.
[0479] The following description relates to testing for overlap between the candidates in the candidate list and the candidates in at least one of the following lists: the intra-frame prediction mode candidate list, the motion vector candidate list, the merge candidate list, the block vector candidate list, the block vector merge candidate list, the sub-block motion vector candidate list, and the sub-block merge candidate list, in a case where at least one of the candidates in the candidate list is added to at least one of the intra-frame prediction mode candidate list, the motion vector candidate list, the merge candidate list, the block vector candidate list, the block vector merge candidate list, the sub-block motion vector candidate list, and the sub-block merge candidate list.
[0480] When at least one candidate among the candidates in the candidate list is added to at least one of the intra-frame prediction mode candidate list, the motion vector candidate list, the merge candidate list, the block vector candidate list, the block vector merge candidate list, the sub-block motion vector candidate list and the sub-block merge candidate list, a test for overlap between the candidate in the candidate list and at least one candidate among the candidates included in at least one of the following lists is performed: the intra-frame prediction mode candidate list, the motion vector candidate list, the merge candidate list, the block vector candidate list, the block vector merge candidate list, the sub-block motion vector candidate list and the sub-block merge candidate list.
[0481] For example, at least one of the candidates in the candidate list may be included at the very beginning or the very end of at least one of the following lists: an intra prediction mode candidate list, a motion vector candidate list, a merge candidate list, a block vector candidate list, a block vector merge candidate list, a sub-block motion vector candidate list, and a sub-block merge candidate list. In addition, block information of the current block may be included in the candidate list by a method in an embodiment in which a specific candidate or candidate information is included at a specific position or item in the candidate list.
[0482] In order to prevent the same or similar candidate from being added to the candidate list or to at least one of the intra prediction mode candidate list, the motion vector candidate list, the merge candidate list, the block vector candidate list, the block vector merge candidate list, the subblock motion vector candidate list, and the subblock merge candidate list, a test for overlap between at least one candidate in the candidate list and a candidate included in at least one of the following lists is performed: the intra prediction mode candidate list, the motion vector candidate list, the merge candidate list, the block vector candidate list, the block vector merge candidate list, the subblock motion vector candidate list, and the subblock merge candidate list. As a result of the test for overlap, at least one candidate in the candidate list may or may not be included in at least one of the intra prediction mode candidate list, the motion vector candidate list, the merge candidate list, the block vector candidate list, the block vector merge candidate list, the subblock motion vector candidate list, and the subblock merge candidate list.
[0483] The test for overlap may be performed only on the M candidates at the very beginning of the candidate list. As another example, the test for overlap may be performed only on the M candidates at the very end of the candidate list. Here, M may be a positive integer, including 0. For example, M may be 2. M may be determined based on at least one of the encoding parameters of the current block and the encoding parameters of the candidate. Furthermore, M may be a value preset in the encoder / decoder or a value signaled from the encoder to the decoder. Here, for the spatial motion vector above or to the left of the current block, the two candidates at the beginning of the candidate list may be tested for overlap.
[0484] For example, when at least one piece of information of a block in the candidate list as the included target is different from at least one piece of information of a block included in at least one of the intra-frame prediction mode candidate list, the motion vector candidate list, the merge candidate list, the block vector candidate list, the block vector merge candidate list, the sub-block motion vector candidate list and the sub-block merge candidate list, at least one piece of information of the block in the candidate list as the included target is included in at least one of the intra-frame prediction mode candidate list, the motion vector candidate list, the merge candidate list, the block vector candidate list, the block vector merge candidate list, the sub-block motion vector candidate list and the sub-block merge candidate list.
[0485] For example, in order of increasing index, at least one piece of information of a block in the candidate list may be included in at least one list of an intra-frame prediction mode candidate list, a motion vector candidate list, a merge candidate list, a block vector candidate list, a block vector merge candidate list, a sub-block motion vector candidate list, and a sub-block merge candidate list.
[0486] In addition, at least one piece of information of a block in the candidate list may be included in at least one of an intra-frame prediction mode candidate list, a motion vector candidate list, a merge candidate list, a block vector candidate list, a block vector merge candidate list, a sub-block motion vector candidate list, and a sub-block merge candidate list, in order of decreasing index.
[0487] As another example, when at least one piece of information of a block in the candidate list that is the included target is the same as at least one piece of information of a block included in at least one of the intra-frame prediction mode candidate list, the motion vector candidate list, the merge candidate list, the block vector candidate list, the block vector merge candidate list, the sub-block motion vector candidate list, and the sub-block merge candidate list, the at least one piece of information of the block in the candidate list that is the included target is not included in at least one of the intra-frame prediction mode candidate list, the motion vector candidate list, the merge candidate list, the block vector candidate list, the block vector merge candidate list, the sub-block motion vector candidate list, and the sub-block merge candidate list.
[0488] As another example, when at least one piece of information of a block in the candidate list that is the target of inclusion is similar to at least one piece of information of a block included in at least one of the intra-frame prediction mode candidate list, the motion vector candidate list, the merge candidate list, the block vector candidate list, the block vector merge candidate list, the sub-block motion vector candidate list, and the sub-block merge candidate list, the at least one piece of information of the block in the candidate list that is the target of inclusion is not included in at least one of the intra-frame prediction mode candidate list, the motion vector candidate list, the merge candidate list, the block vector candidate list, the block vector merge candidate list, the sub-block motion vector candidate list, and the sub-block merge candidate list.
[0489] Here, the situation in which at least one piece of information of a block in the candidate list as the included target is similar to at least one piece of information of a block included in at least one of the intra-frame prediction mode candidate list, the motion vector candidate list, the merge candidate list, the block vector candidate list, the block vector merge candidate list, the sub-block motion vector candidate list and the sub-block merge candidate list may refer to one of the following conditions.
[0490] For example, when the absolute value of the difference between the value of the intra-frame prediction mode as the included target and the value of the intra-frame prediction mode included in the intra-frame prediction mode candidate list is equal to or less than S, the intra-frame prediction mode as the included target is not included in the intra-frame prediction mode candidate list.
[0491] For example, when the absolute value of the difference between the value of the motion vector or block vector as the included target and the value of the motion vector or block vector included in at least one of the motion vector candidate list, the merge candidate list, the block vector candidate list, the block vector merge candidate list, the sub-block motion vector candidate list, and the sub-block merge candidate list is equal to or less than S, the motion vector or block vector as the included target is not included in at least one of the motion vector candidate list, the merge candidate list, the block vector candidate list, the block vector merge candidate list, the sub-block motion vector candidate list, and the sub-block merge candidate list.
[0492] For example, when the absolute value of the difference between the X-component value of the motion vector or block vector as the target of inclusion and the X-component value of the motion vector or block vector included in at least one of the motion vector candidate list, the merge candidate list, the block vector candidate list, the block vector merge candidate list, the sub-block motion vector candidate list, and the sub-block merge candidate list is equal to or less than S, the motion vector or block vector as the target of inclusion is not included in at least one of the motion vector candidate list, the merge candidate list, the block vector candidate list, the block vector merge candidate list, the sub-block motion vector candidate list, and the sub-block merge candidate list.
[0493] For example, when the absolute value of the difference between the Y component value of the motion vector or block vector as the included target and the Y component value of the motion vector or block vector included in at least one of the motion vector candidate list, the merge candidate list, the block vector candidate list, the block vector merge candidate list, the sub-block motion vector candidate list and the sub-block merge candidate list is equal to or less than S, the motion vector or block vector as the included target is not included in at least one of the motion vector candidate list, the merge candidate list, the block vector candidate list, the block vector merge candidate list, the sub-block motion vector candidate list and the sub-block merge candidate list.
[0494] As another example, when at least one piece of information of a block in the candidate list as the included target is not similar to at least one piece of information of a block included in at least one of the intra-frame prediction mode candidate list, the motion vector candidate list, the merge candidate list, the block vector candidate list, the block vector merge candidate list, the sub-block motion vector candidate list and the sub-block merge candidate list, at least one piece of information of the block in the candidate list as the included target is not included in at least one of the intra-frame prediction mode candidate list, the motion vector candidate list, the merge candidate list, the block vector candidate list, the block vector merge candidate list, the sub-block motion vector candidate list and the sub-block merge candidate list.
[0495] Here, the situation where at least one piece of information of a block in the candidate list as the included target is dissimilar to at least one piece of information of a block included in at least one of the intra-frame prediction mode candidate list, the motion vector candidate list, the merge candidate list, the block vector candidate list, the block vector merge candidate list, the sub-block motion vector candidate list and the sub-block merge candidate list may refer to one of the following conditions.
[0496] For example, when the absolute value of the difference between the value of the intra-frame prediction mode as the included target and the value of the intra-frame prediction mode included in the intra-frame prediction mode candidate list is greater than S, the intra-frame prediction mode as the included target is not included in the intra-frame prediction mode candidate list.
[0497] For example, when the absolute value of the difference between the value of the motion vector or block vector as the included target and the value of the motion vector or block vector included in at least one of the motion vector candidate list, the merge candidate list, the block vector candidate list, the block vector merge candidate list, the sub-block motion vector candidate list, and the sub-block merge candidate list is greater than S, the motion vector or block vector as the included target is not included in at least one of the motion vector candidate list, the merge candidate list, the block vector candidate list, the block vector merge candidate list, the sub-block motion vector candidate list, and the sub-block merge candidate list.
[0498] For example, when the absolute value of the difference between the X-component value of the motion vector or block vector as the target of inclusion and the X-component value of the motion vector or block vector included in at least one of the motion vector candidate list, the merge candidate list, the block vector candidate list, the block vector merge candidate list, the sub-block motion vector candidate list, and the sub-block merge candidate list is greater than S, the motion vector or block vector as the target of inclusion is not included in at least one of the motion vector candidate list, the merge candidate list, the block vector candidate list, the block vector merge candidate list, the sub-block motion vector candidate list, and the sub-block merge candidate list.
[0499] For example, when the absolute value of the difference between the Y component value of the motion vector or block vector as the included target and the Y component value of the motion vector or block vector included in at least one of the motion vector candidate list, the merge candidate list, the block vector candidate list, the block vector merge candidate list, the sub-block motion vector candidate list and the sub-block merge candidate list is greater than S, the motion vector or block vector as the included target is not included in at least one of the motion vector candidate list, the merge candidate list, the block vector candidate list, the block vector merge candidate list, the sub-block motion vector candidate list and the sub-block merge candidate list.
[0500] In the above description, S may be a positive integer, including 0. S may be determined based on at least one of the encoding parameters of the current block and the encoding parameters of the candidate. Furthermore, S may be a value preset in the encoder / decoder, or may be a value signaled from the encoder to the decoder. Furthermore, in the case of a motion vector or block vector, S may be a value representing at least one of M / N pixels (such as an integer pixel, 1 / 2 pixel, 1 / 4 pixel, 1 / 16 pixel, etc.). Here, M and N may be positive integers.
[0501] A test for overlap between at least one candidate among the candidates in the candidate list and a candidate included in at least one of the intra prediction mode candidate list, the motion vector candidate list, the merge candidate list, the block vector candidate list, the block vector merge candidate list, the subblock motion vector candidate list, and the subblock merge candidate list is performed. As a result of the test for overlap, at least one candidate among the candidates included in at least one of the intra prediction mode candidate list, the motion vector candidate list, the merge candidate list, the block vector candidate list, the block vector merge candidate list, the subblock motion vector candidate list, and the subblock merge candidate list may be removed, and at least one candidate among the candidates in the candidate list may be included in at least one of the intra prediction mode candidate list, the motion vector candidate list, the merge candidate list, the block vector candidate list, the block vector merge candidate list, the subblock motion vector candidate list, and the subblock merge candidate list.
[0502] For example, at least one of the candidates in the candidate list may be included at the very beginning or the very end of at least one of the intra-frame prediction mode candidate list, the motion vector candidate list, the merge candidate list, the block vector candidate list, the block vector merge candidate list, the sub-block motion vector candidate list and the sub-block merge candidate list.
[0503] The candidate list according to the present invention can manage candidates according to a first-in-first-out (FIFO) rule. For example, when a new candidate needs to be added to the candidate list and the number of candidates in the candidate list is the same as the maximum number of candidates, the candidate that was first added is first removed from the candidate list and the new candidate is added to the candidate list.
[0504] For example, the new candidate may be included at the very beginning or the very end of the candidate list.
[0505] For example, the candidate list according to the present invention may include at least one piece of information about the intra prediction mode.
[0506] For example, the candidate list may include intra prediction modes of spatially neighboring blocks. As another example, the candidate list may include intra prediction modes derived as a result of subtracting a specific value from the intra prediction mode of a spatially neighboring block or adding a specific value to the intra prediction mode of a spatially neighboring block. As yet another example, the candidate list may include a default intra prediction mode. As yet another example, the candidate list may include non-angular intra prediction modes other than DC mode or planar mode. As yet another example, the candidate list may include intra prediction modes based on each CTU.
[0507] As another example, the candidate list according to the present invention may include at least one piece of information about a motion vector, a block vector, or a merge candidate.
[0508] For example, the candidate list may include spatial motion vectors, spatial block vectors, or spatial merge candidates. As another example, the candidate list may include temporal motion vectors or temporal merge candidates. As yet another example, the candidate list may include sub-block-based motion vectors or sub-block-based merge candidates. As yet another example, the candidate list may include sub-block-based temporal motion vectors or sub-block-based temporal merge candidates. As yet another example, the candidate list may include spatial motion vectors, spatial block vectors, or spatial merge candidates based on each CTU. As yet another example, the candidate list may include temporal motion vectors or temporal merge candidates based on the same-positioned CTUs of each CTU. As yet another example, the candidate list may include sub-block-based motion vectors or sub-block-based merge candidates based on the same-positioned CTUs of each CTU. As yet another example, the candidate list may include sub-block-based temporal motion vectors or sub-block-based temporal merge candidates based on the same-positioned CTUs of each CTU.
[0509] As another example, a candidate list may include spatial motion vectors, spatial block vectors, or spatial merge candidates, but may not include temporal motion vectors or temporal merge candidates. As another example, a candidate list may include temporal motion vectors or temporal merge candidates, but may not include spatial motion vectors, spatial block vectors, or spatial merge candidates. As another example, a candidate list may include spatial motion vectors, spatial block vectors, spatial merge candidates, temporal motion vectors, or temporal merge candidates. As another example, a candidate list may include spatial motion vectors, spatial block vectors, spatial merge candidates, temporal motion vectors, or temporal merge candidates, but may not include subblock-based motion vectors or subblock-based merge candidates. As another example, a candidate list may include spatial motion vectors, spatial block vectors, spatial merge candidates, temporal motion vectors, or temporal merge candidates for each CTU, but may not include temporal motion vectors or temporal merge candidates. As another example, a candidate list may include temporal motion vectors or temporal merge candidates for each CTU, but may not include spatial motion vectors, spatial block vectors, or spatial merge candidates. As another example, a candidate list may include spatial motion vectors, spatial block vectors, spatial merge candidates, temporal motion vectors, or temporal merge candidates for each CTU.
[0510] As yet another example, the candidate list may include integer and / or sub-pixel based motion vectors, block vectors, or merge candidates.
[0511] For example, the candidate list may include motion vectors, block vectors, or merge candidates based on integer pixels. As another example, the candidate list may include motion vectors, block vectors, or merge candidates based on pixels smaller than integer pixels. As yet another example, the candidate list may include motion vectors, block vectors, or merge candidates based on 1 / 4 pixels. As yet another example, the candidate list may include motion vectors, block vectors, or merge candidates based on 1 / 16 pixels.
[0512] A separate candidate list may be constructed for each intra prediction mode, motion vector, block vector, and merge candidate that may be included in the candidate list.
[0513] If a specific block exists at a boundary of at least one of a picture, a sub-picture, a slice, a tile, a partition, a CTU boundary, a CTU row, and a CTU column, or exists outside a boundary of at least one of a picture, a sub-picture, a slice, a tile, a partition, a CTU boundary, a CTU row, and a CTU column, at least one piece of information of the specific block may be included in the candidate list. Here, the candidate list may be used to replace the line buffer.
[0514] For example, in the case where a specific block exists at an upper picture, sub-picture, slice, tile, partition, CTU boundary, CTU row, and CTU column for the current block, in the case where the specific block exists at a boundary of an upper picture, sub-picture, slice, tile, partition, CTU boundary, CTU row, and CTU column to which the current block does not belong, or in the case where the specific block exists outside an upper boundary of a picture, sub-picture, slice, tile, partition, CTU boundary, CTU row, and CTU column to which the current block belongs, at least one piece of information of the specific block may be included in the candidate list.
[0515] As another example, in the case where a specific block exists at a left picture, sub-picture, slice, tile, partition, CTU boundary, CTU row, and CTU column for the current block, in the case where the specific block exists at a boundary of a left picture, sub-picture, slice, tile, partition, CTU boundary, CTU row, and CTU column to which the current block does not belong, or in the case where the specific block exists outside the left boundary of the picture, sub-picture, slice, tile, partition, CTU boundary, CTU row, and CTU column to which the current block belongs, at least one piece of information of the specific block may be included in the candidate list.
[0516] In addition, if a specific block exists at a boundary of at least one of a picture, a sub-picture, a slice, a tile, a partition, a CTU boundary, a CTU row, and a CTU column, or exists outside a boundary of at least one of a picture, a sub-picture, a slice, a tile, a partition, a CTU boundary, a CTU row, and a CTU column, at least one piece of information of the specific block may not be included in the candidate list. In this case, by not including the information of the specific block in the candidate list, the line buffer may be removed.
[0517] For example, in the case where the specific block exists in the upper picture, sub-picture, slice, tile, partition, CTU boundary, CTU row and CTU column of the current block, in the case where the specific block exists at the boundary of the upper picture, sub-picture, slice, tile, partition, CTU boundary, CTU row and CTU column to which the current block does not belong, or in the case where the specific block exists outside the upper boundary of the picture, sub-picture, slice, tile, partition, CTU boundary, CTU row and CTU column to which the current block belongs, at least one piece of information of the specific block may not be included in the candidate list.
[0518] As another example, in the case where the specific block exists at the left picture, sub-picture, slice, tile, partition, CTU boundary, CTU row, and CTU column of the current block, in the case where the specific block exists at the boundary of the left picture, sub-picture, slice, tile, partition, CTU boundary, CTU row, and CTU column to which the current block does not belong, or in the case where the specific block exists outside the left boundary of the picture, sub-picture, slice, tile, partition, CTU boundary, CTU row, and CTU column to which the current block belongs, at least one piece of information of the specific block may not be included in the candidate list.
[0519] In addition, when the current block and a block related to block information already included in the candidate list exist in or belong to different pictures, sub-pictures, slices, tiles, partitions, CTU boundaries, CTU rows, and CTU columns, at least one piece of information of the current block is not included in the candidate list.
[0520] That is, in the case where block information of the current block is added to the candidate list for a specific block, when the specific block and the current block exist in or belong to different pictures, sub-pictures, slices, parallel blocks, partitions, CTU boundaries, CTU rows, and CTU columns, at least one piece of information of the current block is not included in the candidate list for the specific block.
[0521] When a candidate is added to the candidate list, a specific candidate having a result of adding or subtracting a specific value from at least one piece of information of the block for the candidate as information of the block is added to the candidate list.
[0522] For example, a result of adding or subtracting a specific value from the intra prediction mode of a target candidate included in the candidate list may be determined as a new intra prediction mode, and a specific candidate having the new intra prediction mode may be added to the candidate list.
[0523] As another example, a result of adding or subtracting a specific value from a motion vector or block vector of a candidate that is a target included in the candidate list may be determined as a new motion vector or block vector, and a specific candidate having the new motion vector or block vector may be added to the candidate list.
[0524] Furthermore, when adding a candidate to the candidate list, the candidate is not added to the candidate list, but a specific candidate having a result of adding or subtracting a specific value from at least one piece of information of the block for the candidate as information of the block is added to the candidate list.
[0525] Furthermore, when at least one of the candidates is added to the candidate list, a specific candidate having a result of calculating a statistic of at least one piece of information of a block for the at least one of the candidates as information of the block is added to the candidate list.
[0526] Furthermore, a specific candidate having a result of adding or subtracting a specific value from at least one piece of information of a block for a candidate included in the candidate list as information of the block may be included in the candidate list.
[0527] For example, a specific value may be added to or subtracted from the intra prediction modes of the candidates included in the candidate list to generate a new intra prediction mode, and a specific candidate having the new intra prediction mode may be added to the candidate list.
[0528] As another example, a specific value may be added or subtracted from the motion vectors or block vectors of the candidates included in the candidate list to generate a new motion vector or block vector, and the specific candidate having the new motion vector or block vector may be added to the candidate list.
[0529] Furthermore, a specific candidate having a result of adding or subtracting a specific value from at least one piece of information of a block for a candidate included in the candidate list as information of a block may be added to the candidate list, but a candidate already included in the candidate list may be excluded from the candidate list.
[0530] Furthermore, a specific candidate having a result of calculating a statistic of at least one piece of information of a block for at least one of the candidates included in the candidate list as information of the block may be added to the candidate list.
[0531] Here, the specific value may be at least one of 0, a positive integer, and a negative integer. The specific value may be determined based on at least one of the encoding parameters of the current block and the encoding parameters of the candidate. In addition, the specific value may be a value preset in the encoder / decoder, or may be a value signaled from the encoder to the decoder.
[0532] When constructing at least one of an intra prediction mode candidate list, a motion vector candidate list, a merge candidate list, a block vector candidate list, a block vector merge candidate list, a subblock motion vector candidate list, and a subblock merge candidate list, the candidate list according to the present invention may be used.
[0533] For example, the candidates in the candidate list may be used as candidates when constructing the intra prediction mode candidate list. For example, the candidates in the candidate list may be included in the intra prediction mode candidate list.
[0534] As another example, the candidates in the candidate list may be used as candidates when constructing the motion vector candidate list. For example, the candidates in the candidate list may be included in the motion vector candidate list.
[0535] As another example, the candidates in the candidate list may be used as candidates when constructing the merge candidate list. For example, the candidates in the candidate list may be included in the merge candidate list.
[0536] As yet another example, the candidates in the candidate list may be used as candidates when constructing the block vector candidate list. For example, the candidates in the candidate list may be included in the block vector candidate list.
[0537] As another example, the candidates in the candidate list may be used as candidates when constructing the block vector merge candidate list. For example, the candidates in the candidate list may be included in the block vector merge candidate list.
[0538] As another example, the candidates in the candidate list may be used as candidates when constructing the sub-block motion vector candidate list. For example, the candidates in the candidate list may be included in the sub-block motion vector candidate list.
[0539] As another example, the candidates in the candidate list may be used as candidates when constructing the sub-block merging candidate list. For example, the candidates in the candidate list may be included in the sub-block merging candidate list.
[0540] In addition, the candidate list according to the present invention may refer to at least one of the intra prediction mode candidate list, motion vector candidate list, merge candidate list, block vector candidate list, block vector merge candidate list, sub-block motion vector candidate list, and sub-block merge candidate list. That is, the candidate list may be the same as at least one of the intra prediction mode candidate list, motion vector candidate list, merge candidate list, block vector candidate list, block vector merge candidate list, sub-block motion vector candidate list, and sub-block merge candidate list.
[0541] In addition, the candidate list according to the present invention may refer to another candidate list in addition to at least one of the intra-frame prediction mode candidate list, motion vector candidate list, merge candidate list, block vector candidate list, block vector merge candidate list, sub-block motion vector candidate list, and sub-block merge candidate list. That is, at least one of the intra-frame prediction mode candidate list, motion vector candidate list, merge candidate list, block vector candidate list, block vector merge candidate list, sub-block motion vector candidate list, and sub-block merge candidate list, and the candidate list may be a separate list. In this case, the candidate list according to the present invention may be a candidate list that includes at least one candidate among the candidates included in or added to at least one of the intra-frame prediction mode candidate list, motion vector candidate list, merge candidate list, block vector candidate list, block vector merge candidate list, sub-block motion vector candidate list, and sub-block merge candidate list.
[0542] The above-described embodiments can be performed in the same manner in an encoder and a decoder.
[0543] An image may be encoded / decoded using at least one of the embodiments or at least one combination of the embodiments.
[0544] The order in which the embodiments are applied in the encoder and the decoder may be different, and the order in which the embodiments are applied in the encoder and the decoder may be the same.
[0545] The embodiments may be performed for each of the luminance signal and the chrominance signal, and the embodiments for the luminance signal and the chrominance signal may be performed in the same manner.
[0546] The shape of a block to which the embodiment of the present invention is applied may be a square shape or a non-square shape.
[0547] The above-described embodiments of the present invention may be applied based on the size of at least one of a coding block, a prediction block, a transform block, a block, a current block, a coding unit, a prediction unit, a transform unit, a unit, and a current unit. Here, the size may be defined as the minimum size and / or maximum size to which the embodiment is applied, or may be defined as a fixed size to which the embodiment is applied. In addition, with respect to the embodiments, the first embodiment may be applied to a first size, and the second embodiment may be applied to a second size. That is, the embodiments may be applied in various ways based on the size. In addition, the embodiments of the present invention may be applied only to cases of a minimum size or larger and a maximum size or smaller. That is, at least one of the embodiments may be applied only when the block size is within a predetermined range.
[0548] For example, the embodiment may be applied only when the size of the current block is equal to or greater than 8×8. For example, the embodiment may be applied only when the size of the current block is equal to 4×4. For example, the embodiment may be applied only when the size of the current block is equal to or less than 16×16. For example, the embodiment may be applied only when the size of the current block is equal to or greater than 16×16 and equal to or less than 64×64.
[0549] The embodiments of the present invention can be applied according to time layers. A separate identifier can be signaled to identify the time layer to which the embodiments are applicable, and the embodiments can be applied to the time layer specified by the identifier. Here, the identifier can be defined as the lowest layer and / or the highest layer to which the embodiments are applicable, or can be defined as indicating a specific layer to which the embodiments are applicable. Furthermore, a fixed time layer can be defined to which the embodiments are applicable.
[0550] For example, the embodiment may be applied only when the temporal layer of the current image is the lowest layer. For example, the embodiment may be applied only when the current temporal layer identifier is 1 or greater. For example, the embodiment may be applied only when the temporal layer of the current image is the highest layer.
[0551] The reference picture set used in the reference picture list construction process and the reference picture list modification process may be at least one of the reference picture lists L0, L1, L2, and L3.
[0552] When calculating the boundary strength by the deblocking filter, one or more and up to N motion vectors or block vectors of the current block are used. Here, N represents a positive integer 1 or greater, for example, 2, 3, 4, etc.
[0553] In the case where a motion vector or a block vector is based on at least one of the following units: 16 pixels (16pel), 8 pixels (8pel), 4 pixels (4pel), integer pixels (integerpel), 1 / 2 pixel (1 / 2pel), 1 / 4 pixel (1 / 4pel), 1 / 8 pixel (1 / 8pel), 1 / 16 pixel (1 / 16pel), 1 / 32 pixel (1 / 32pel), and 1 / 64 pixel (1 / 64pel), embodiments of the present invention can be applied. In addition, in the encoding / decoding process of the current block, the motion vector or the block vector can be selectively used on a per-pixel basis.
[0554] At least one of the syntax elements such as an index and a flag entropy-encoded by the encoder and entropy-decoded by the decoder may use at least one of the following binarization, debinarization, and entropy encoding / decoding methods. Here, the binarization / debinarization and entropy encoding / decoding methods may include at least one of the following methods: a signed 0th-order Exp_Golomb binarization / debinarization method (se(v)), a signed kth-order Exp_Golomb binarization / debinarization method (sek(v)), an unsigned 0th-order Exp_Golomb binarization / debinarization method for positive integers (ue(v)), and an unsigned kth-order Exp_Golomb binarization / debinarization method for positive integers (uek(v)). , fixed-length binarization / debinarization method (f(n)), truncated rice binarization / debinarization method or truncated unary binarization / debinarization method (tu(v)), truncated binary binarization / debinarization method (tb(v)), context-adaptive arithmetic coding / decoding method (ae(v)), byte-based bit string (b(8)), signed integer binarization / debinarization method (i(n)), unsigned positive integer binarization / debinarization method (u(n)), and unary binarization / debinarization method.
[0555] More than one of the embodiments is applied to the encoding / decoding process of the current block.A specific embodiment or at least one combination of the embodiments may be applied to the encoding / decoding process of the current block.
[0556] A slice type or a tile group type to which the embodiment of the present invention is applied may be defined, and the embodiment of the present invention may be applied according to the slice type or the tile group type.
[0557] In the above embodiments, the method is described based on a flowchart having a series of steps or units, but the present invention is not limited to the order of the steps, but rather, some steps may be performed simultaneously with other steps or in a different order. In addition, it should be understood by those skilled in the art that the steps in the flowchart are not mutually exclusive, and other steps may be added to the flowchart, or some steps may be deleted from the flowchart without affecting the scope of the present invention.
[0558] The embodiments include various aspects of the examples. All possible combinations for each aspect may not be described, but those skilled in the art will be able to recognize different combinations. Therefore, the present invention may include all replacements, modifications and changes within the scope of the claims.
[0559] As described above, the embodiment of the present invention can be implemented in the form of program instructions that can be executed by various computer components, and can be stored on a computer-readable recording medium. The computer-readable recording medium can include program instructions, data files, data structures, etc., individually or in combination. The program instructions to be recorded on the computer-readable recording medium can be specially designed and configured for the embodiment of the present invention, or can be well known to and can be used by those skilled in the art of computer software. The example of a computer-readable recording medium includes a magnetic recording medium (such as a hard disk, a floppy disk, and a magnetic tape), an optical data storage medium (such as a CD-ROM or a DVD-ROM), a magneto-optical medium (such as a floppy disk), and a hardware device (such as a read-only memory (ROM), a random access memory (RAM), and a flash memory) that is specifically constructed to store and implement program instructions. The example of program instructions not only includes machine language code formatted by a compiler, but also includes high-level language code that can be implemented by a computer using an interpreter, etc. The hardware device can be configured to be operated by one or more software modules or vice versa, to carry out processing according to the present invention.
[0560] Although the present invention has been described with reference to specific items such as specific structural elements, only some embodiments and the accompanying drawings, such specific details disclosed herein are only representative to help a more comprehensive understanding of the present invention. However, the present invention is not limited to the exemplary embodiments set forth herein, and those skilled in the art will appreciate that the present invention can be implemented in many alternative forms.
[0561] Accordingly, the invention is intended to cover not only the exemplary embodiments, but also various alternatives, modifications, equivalents and other embodiments, which may be included within the spirit and scope of the invention as defined by the claims.
[0562] Industrial Applicability
[0563] The present invention can be used to encode or decode images.
Claims
1. A method for decoding an image, the method comprising: Derive the merge candidate list of the current block; updating the merge candidate list of the current block based on a motion information candidate list, wherein the motion information candidate list includes motion information candidates derived from blocks decoded before the current block; deriving motion information of the current block based on the updated merge candidate list of the current block; and updating the motion information candidate list based on the motion information of the current block, The motion information candidate list is initialized according to the coding tree unit CTU row. wherein the merge candidate list is updated by inserting the motion information candidates included in the motion information candidate list as new merge candidates into the merge candidate list, wherein, for the two motion information candidates with the highest indexes in the motion information candidate list, when a motion information candidate is the same as one of the merge candidates in the merge candidate list, the motion information candidate is not added to the merge candidate list; Among them, for motion information candidates other than the two motion information candidates with the highest index, even if the motion information candidate is the same as one of the merge candidates in the merge candidate list, the motion information candidate is still added to the merge candidate list.
2. The method according to claim 1, wherein Blocks included in the same processing area as the current block are not used to update the motion information candidate list, and The processing area has a size equal to or smaller than that of the CTU.
3. The method according to claim 1, wherein When the affine mode and the sub-block based temporal motion vector derivation mode are not applied to the current block, the motion information candidate list is updated with the motion information of the current block.
4. The method according to claim 1, wherein The step of updating the motion information candidate list includes: When the number of motion information candidates included in the motion information candidate list is a preset value, deleting the motion information candidate located at the first position in the motion information candidate list; and The motion information of the current block is added as a new motion information candidate to the motion information candidate list.
5. The method according to claim 1, wherein When the motion information of the current block is already included in the motion information candidate list, after deleting the same motion information candidate as the motion information of the current block from the motion information candidate list, the motion information of the current block is added to the motion information candidate list.
6. The method of claim 4, wherein: The preset value represents the maximum number of motion information candidates that can be included in the motion information candidate list.
7. The method of claim 1, wherein: The motion information candidate in the motion information candidate list is added to the merge candidate list as the new merge candidate after a spatial merge candidate and a temporal merge candidate are added to the merge candidate list.
8. A method for encoding an image, the method comprising: Derive the merge candidate list of the current block; updating the merge candidate list of the current block based on a motion information candidate list, wherein the motion information candidate list includes motion information candidates derived from blocks encoded before the current block; deriving motion information of the current block based on the updated merge candidate list of the current block; and updating the motion information candidate list based on the motion information of the current block, The motion information candidate list is initialized according to the coding tree unit CTU row. wherein the merge candidate list is updated by inserting the motion information candidates included in the motion information candidate list as new merge candidates into the merge candidate list, wherein, for the two motion information candidates with the highest indexes in the motion information candidate list, when a motion information candidate is the same as one of the merge candidates in the merge candidate list, the motion information candidate is not added to the merge candidate list; Among them, for motion information candidates other than the two motion information candidates with the highest index, even if the motion information candidate is the same as one of the merge candidates in the merge candidate list, the motion information candidate is still added to the merge candidate list.
9. The method of claim 8, wherein: Blocks included in the same processing area as the current block are not used to update the motion information candidate list, and The processing area has a size equal to or smaller than that of the CTU.
10. The method of claim 8, wherein: When the affine mode and the sub-block based temporal motion vector derivation mode are not applied to the current block, the motion information candidate list is updated with the motion information of the current block.
11. The method of claim 8, wherein: The step of updating the motion information candidate list includes: When the number of motion information candidates included in the motion information candidate list is a preset value, deleting the motion information candidate located at the first position in the motion information candidate list; and The motion information of the current block is added as a new motion information candidate to the motion information candidate list.
12. The method of claim 8, wherein: When the motion information of the current block is already included in the motion information candidate list, after deleting the same motion information candidate as the motion information of the current block from the motion information candidate list, the motion information of the current block is added to the motion information candidate list.
13. The method of claim 11, wherein: The preset value represents the maximum number of motion information candidates that can be included in the motion information candidate list.
14. The method of claim 11, wherein: The motion information candidate in the motion information candidate list is added to the merge candidate list as the new merge candidate after a spatial merge candidate and a temporal merge candidate are added to the merge candidate list.
15. A non-transitory computer-readable recording medium storing a bitstream generated by a method of encoding a video by an encoding device, the method comprising: Derive the merge candidate list of the current block; updating the merge candidate list of the current block based on a motion information candidate list, wherein the motion information candidate list includes motion information candidates derived from blocks encoded before the current block; deriving motion information of the current block based on the updated merge candidate list of the current block; and updating the motion information candidate list based on the motion information of the current block, The motion information candidate list is initialized according to the coding tree unit CTU row. wherein the merge candidate list is updated by inserting the motion information candidates included in the motion information candidate list as new merge candidates into the merge candidate list, wherein, for the two motion information candidates with the highest indexes in the motion information candidate list, when a motion information candidate is the same as one of the merge candidates in the merge candidate list, the motion information candidate is not added to the merge candidate list; Among them, for motion information candidates other than the two motion information candidates with the highest index, even if the motion information candidate is the same as one of the merge candidates in the merge candidate list, the motion information candidate is still added to the merge candidate list.