Image encoding / decoding method and device, and recording medium storing bit stream
By using candidate lists to derive motion information in image encoding/decoding, the problem of low compression efficiency of high-resolution image data is solved, and more efficient image data compression and decoding is achieved.
Patent Information
- Application Number
- CN202510289077.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2018-09-18
- Filing Date
- 2019-09-18
- Publication Date
- 2025-05-13
AI Technical Summary
The prior art is difficult to effectively compress high-resolution and high-quality image data, resulting in increased transmission and storage costs.
By using the candidate list to derive the motion information of the current block and generate the prediction block, the compression efficiency of image encoding/decoding is improved.
Improves the compression efficiency of image encoding/decoding and reduces the stored and transmitted bitstream size.
Smart Images

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