Image encoding / decoding method and device based on sub-block division

By adopting asymmetric sub-block partition structure and independent prediction methods in video encoding/decoding, the problem of low encoding/decoding efficiency in the prior art is solved, and more efficient video data processing is achieved.

CN113841398BActive Publication Date: 2025-05-16ELECTRONICS & TELECOMM RES INST
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202080036941.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2019-06-25
Filing Date
2020-06-16
Publication Date
2025-05-16
Estimated Expiration
2040-06-16

AI Technical Summary

Technical Problem

In the existing video encoding/decoding methods, the encoding/decoding blocks usually have square or rectangular shapes, and the partition structure is limited, making it difficult to effectively utilize local characteristics in the video, resulting in low encoding/decoding efficiency.

Method used

The video encoding/decoding method based on asymmetric sub-blocks is adopted to partition the current block into asymmetric sub-blocks through straight lines, such as triangles, rectangles, trapezoids and pentagons, and independently predict them to improve partition flexibility and efficiency.

Benefits of technology

By using an asymmetric sub-block partition structure, the local characteristics of video frames can be more effectively utilized, the efficiency of video encoding and decoding can be improved, the amount of data can be reduced, and the transmission and storage costs can be reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113841398B_ABST
    Figure CN113841398B_ABST
Patent Text Reader

Abstract

Provided is an image encoding / decoding method and device. The image decoding method disclosed in the present invention comprises: a step of acquiring block partition information about a current block; a step of partitioning the current block into a first sub-block and a second sub-block based on the block partition information; a step of deriving motion information about the first sub-block and motion information about the second sub-block; a step of generating prediction samples of the first sub-block and prediction samples of the second sub-block based on the motion information about the first sub-block and the motion information about the second sub-block; and a step of obtaining a weighted sum of the prediction samples of the first sub-block and the prediction samples of the second sub-block to generate the prediction samples of the current block, wherein the block partition information may be index information indicating an index of a table, wherein the table includes information indicating a plurality of predefined asymmetric partitioning forms.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a video encoding / decoding method, device and recording medium for storing a bit stream. More specifically, the present invention relates to a video encoding / decoding method and device based on at least one asymmetric sub-block. Background Art

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

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

[0004] In conventional video encoding / decoding methods and devices, encoding / decoding blocks always have a square shape or a rectangular shape or both a square shape and a rectangular shape, and are partitioned into a quadtree shape. Accordingly, encoding / decoding is performed with limited consideration of local characteristics within a video. Summary of the invention

[0005] Technical issues

[0006] An object of the present invention is to provide a method and apparatus for video encoding / decoding using various asymmetric sub-block partition structures.

[0007] In addition, another object of the present invention is to provide a method and apparatus for video encoding / decoding, wherein prediction is independently performed on asymmetric sub-blocks in the video encoding / decoding.

[0008] In addition, another object of the present invention is to provide a video encoding / decoding method and device based on asymmetric sub-blocks in at least one of a block partition structure in which a quadtree is followed by a binary tree, a combined quadtree and binary tree block partition structure, and a separated PU / TU tree block partition structure, thereby improving the encoding / decoding efficiency.

[0009] In addition, another object of the present invention is to provide a video encoding / decoding method and apparatus for partitioning a current block into at least one or more asymmetric sub-blocks or performing different prediction on each asymmetric sub-block.

[0010] In addition, another object of the present invention is to provide a method and apparatus for storing motion information of an asymmetrically subdivided current block.

[0011] In addition, another object of the present invention is to provide a recording medium storing a bit stream generated by the video encoding / decoding method or apparatus of the present invention.

[0012] Technical Solution

[0013] A method for decoding an image according to the present invention, the method may include: obtaining block partition information of a current block; partitioning the current block into a first sub-block and a second sub-block based on the block partition information; deriving motion information of the first sub-block and motion information of the second sub-block respectively; generating prediction samples of the first sub-block and prediction samples of the second sub-block respectively based on the motion information of the first sub-block and the motion information of the second sub-block; and generating prediction samples of the current block by weighted sum of the prediction samples of the first sub-block and the prediction samples of the second sub-block, wherein the block partition information is index information indicating an index of a table, wherein the table includes information indicating a plurality of predefined asymmetric partition shapes.

[0014] In the method for decoding an image according to the present invention, the steps of respectively deriving motion information of a first sub-block and motion information of a second sub-block include: respectively obtaining a merge index of the first sub-block and a merge index of the second sub-block; generating a merge candidate list; deriving motion information of the first sub-block by using the merge candidate list and the merge index of the first sub-block; and deriving motion information of the second sub-block by using the merge candidate list and the merge index of the second sub-block.

[0015] In the method for decoding an image according to the present invention, the merge candidate list is generated based on the current block.

[0016] In the method for decoding an image according to the present invention, wherein, the step of partitioning the current block into the first sub-block and the second sub-block comprises: partitioning the current block into the first sub-block and the second sub-block through a straight line.

[0017] In the method for decoding an image according to the present invention, the information indicating the plurality of predefined asymmetric partition shapes comprises: at least one of angle information and distance information of the straight line.

[0018] In the method for decoding an image according to the present invention, the first sub-block and the second sub-block have any one of a triangle, a rectangle, a trapezoid and a pentagon.

[0019] In the method for decoding an image according to the present invention, it also includes: storing at least one of motion information of a first sub-block, motion information of a second sub-block and third motion information, wherein when the motion information of the first sub-block and the motion information of the second sub-block refer to a reference picture in the same direction, the third motion information is derived as any one of the motion information of the first sub-block and the motion information of the second sub-block.

[0020] In the method for decoding an image according to the present invention, when the horizontal length and the vertical length of the current block are less than respective predetermined thresholds, the step of partitioning the current block into the first sub-block and the second sub-block based on the block partition information is not performed.

[0021] According to the method for encoding an image of the present invention, the method may include: determining a block partition structure of a current block; partitioning the current block into a first sub-block and a second sub-block based on the block partition structure; respectively deriving motion information of the first sub-block and motion information of the second sub-block; encoding the block partition information based on the block partition structure; and encoding a merge index of the first sub-block and a merge index of the second sub-block based on the motion information of the first sub-block and the motion information of the second sub-block, respectively, wherein the block partition information is index information of an index indicating a table, wherein the table includes information indicating a plurality of predefined asymmetric partition shapes.

[0022] In the method for encoding an image according to the present invention, the steps of respectively encoding the merge index of a first sub-block and the merge index of a second sub-block include: generating a merge candidate list; encoding the merge index of the first sub-block by using the merge candidate list and motion information of the first sub-block; and encoding the merge index of the second sub-block by using the merge candidate list and motion information of the second sub-block.

[0023] In the method for encoding an image according to the present invention, the merge candidate list is generated based on the current block.

[0024] In the method for encoding an image according to the present invention, the step of partitioning the current block into the first sub-block and the second sub-block includes: partitioning the current block into the first sub-block and the second sub-block through a straight line.

[0025] In the method for encoding an image according to the present invention, the information indicating the plurality of predefined asymmetric partition shapes comprises: at least one of angle information and distance information of the straight line.

[0026] In the method for encoding an image according to the present invention, the first sub-block and the second sub-block have any one of a triangle, a rectangle, a trapezoid and a pentagon.

[0027] In the method for encoding an image according to the present invention, it also includes: storing at least one of motion information of a first sub-block, motion information of a second sub-block, and third motion information, wherein when the motion information of the first sub-block and the motion information of the second sub-block refer to a reference picture in the same direction, the third motion information is derived as any one of the motion information of the first sub-block and the motion information of the second sub-block.

[0028] In the method for encoding an image according to the present invention, when the horizontal length and the vertical length of the current block are less than respective predetermined thresholds, the step of partitioning the current block into the first sub-block and the second sub-block based on the block partition information is not performed.

[0029] The computer-readable recording medium according to the present invention may store a bit stream generated by the image encoding method according to the present invention.

[0030] Beneficial Effects

[0031] According to the present invention, a video encoding / decoding method and apparatus using various asymmetric sub-block partition structures can be provided.

[0032] In addition, according to the present invention, a video encoding / decoding method and apparatus for independently performing prediction on an asymmetric sub-block of each partition can be provided.

[0033] In addition, according to the present invention, a recording medium for storing a bit stream generated by the video encoding / decoding method or apparatus of the present invention can be provided.

[0034] In addition, according to the present invention, video encoding and decoding efficiency can be improved. BRIEF DESCRIPTION OF THE DRAWINGS

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

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

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

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

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

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

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

[0042] Figure 8 is a diagram illustrating a method of deriving spatial merging candidates according to an embodiment of the present invention.

[0043] Fig. 9 is a diagram illustrating a method of deriving a temporal merging candidate according to an embodiment of the present invention.

[0044] Fig.10 2 is a diagram illustrating a method of deriving a sub-block-based temporal-spatial combination merging candidate according to an embodiment of the present invention.

[0045] Fig.11 is a diagram illustrating a method of deriving inter-frame prediction information by using a bidirectional matching method according to an embodiment of the present invention.

[0046] Fig.12 is a diagram illustrating a method of deriving inter-frame prediction information by using a template matching method according to an embodiment of the present invention.

[0047] Fig.13 is a diagram illustrating a method of deriving inter-frame prediction information based on overlapped block motion compensation (OMBC) according to an embodiment of the present invention.

[0048] Fig.14 2 is a diagram illustrating quadtree partitioning, symmetric binary tree partitioning, and asymmetric binary tree partitioning according to an embodiment of the present invention.

[0049] Fig.15 is a diagram illustrating symmetric binary tree partitioning after quadtree partitioning according to an embodiment of the present invention.

[0050] Fig.16 is a diagram illustrating asymmetric partitioning according to an embodiment of the present invention.

[0051] Fig.17 2 is a diagram illustrating a method of deriving motion prediction information of a sub-block by using a lowest-level sub-block according to an embodiment of the present invention.

[0052] Figures 18 to 21 is a diagram illustrating a type of storing motion information of each block according to an embodiment of the present invention.

[0053] Fig. 22 is a flowchart illustrating a video decoding method according to an embodiment of the present invention.

[0054] Fig.23 is a flowchart illustrating a video encoding method according to an embodiment of the present invention. DETAILED DESCRIPTION

[0055] 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, wherein the accompanying drawings illustrate specific embodiments in which the present invention may be practiced. These embodiments are described in sufficient detail to enable those skilled in the art to implement the present disclosure. It should be understood that the various embodiments of the present disclosure, although different, are not necessarily mutually exclusive. For example, 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 (with the full range of equivalents claimed by the claims, in the case of appropriate interpretation).

[0056] 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, the "first" component may be named as the "second" component, and the "second" component may also be similarly named as the "first" component. The term "and / or" includes a combination of multiple items or any one of the multiple items.

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

[0058] 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 of the listed components. Therefore, at least two components of each component can be combined to form a component, or a component can be partitioned 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 partitioned are also included in the scope of the present invention.

[0059] 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 form includes the expression of 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 elements, but may include additional elements in an embodiment of the present invention or in the scope of the present invention.

[0060] In addition, some components may not be indispensable components for performing the basic functions of the present invention, but rather selective components that only improve the performance thereof. The present invention may be implemented by including only indispensable components for realizing the essence of the present invention without including components for improving performance. Structures that include only indispensable components without including selective components that only improve performance are also included within the scope of the present invention.

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

[0062] 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".

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

[0064] 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 picture.

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

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

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

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

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

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

[0071] 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 1.

[0072] Terminology Description

[0073] Encoder: This refers to the device that performs encoding. In other words, it refers to the encoding device.

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

[0075] Block: is an M×N array of samples. Here, M and N may represent positive integers, and a block may represent an array of samples in a two-dimensional shape. 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.

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

[0077] 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-partition units during encoding or decoding, a unit may represent a sub-partition 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. Depending on 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. In addition, 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.

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

[0079] When the size of the coding block is within a predetermined range, it can be partitioned 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 partitioned 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 partition 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 partition using only quadtree partitioning. Here, the block to be partitioned may be at least one of a coding block and a transform block. In this case, information indicating the partitioning of the coding block (e.g., split_flag) 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 partition using only binary or ternary tree partitioning. In this case, the above description of the quadtree partition may be applied to the binary tree partition or the ternary tree partition in the same manner.

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

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

[0082] 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 picture or a neighboring block of the block.

[0083] 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 for the first time. 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.

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

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

[0086] The adaptation parameter set may represent a parameter set that can be shared by reference in different pictures, sub-pictures, slices, tile groups, tiles, or partitions. In addition, information in the adaptation parameter set may be used by referencing different adaptation parameter sets for sub-pictures, slices, tile groups, tiles, or partitions within a picture.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[0102] 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 partitioning a prediction unit may also be prediction units.

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

[0104] A reference picture list may refer to a list including one or more reference pictures used for inter prediction or motion compensation. There are several types of reference picture lists available, including LC (List Combination), L0 (List 0), L1 (List 1), L2 (List 2), L3 (List 3).

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

[0106] The prediction list utilization flag indicates whether at least one reference picture in a specific reference picture list is used to generate 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.

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

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

[0109] A motion vector may be a two-dimensional vector used for inter-frame prediction or motion compensation. A motion vector may represent an offset between a target block for encoding / decoding and a reference block. For example, (mvX, mvY) may represent a motion vector. Here, mvX may represent a horizontal component, and mvY may represent a vertical component.

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

[0111] The 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.

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

[0113] The motion vector candidate index may represent an indicator indicating a motion vector candidate in the motion vector candidate list. Alternatively, it may be an index of a motion vector predictor.

[0114] The motion information may represent information including at least one of a motion vector, a reference picture index, an inter prediction indicator, a prediction list utilization flag, a reference picture list information, a reference picture, a motion vector candidate, a motion vector candidate index, a merge candidate, and a merge index.

[0115] The merge candidate list may refer to a list consisting of one or more merge candidates.

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

[0117] The merge index may represent an indicator indicating a merge candidate in the merge candidate list. Alternatively, the merge index may indicate a block in a reconstructed block that is spatially / temporally adjacent to the current block, from which the merge candidate has been derived. Alternatively, the merge index may indicate at least one piece of motion information of the merge candidate.

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

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

[0120] Quantization parameter: may represent a value used when a transform coefficient is used to generate a quantized level during quantization. The quantization parameter may also represent 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 on a quantization step size.

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

[0122] Scan: can 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 can be called scanning, and changing a one-dimensional matrix of coefficients to a two-dimensional matrix can be called scanning or inverse scanning.

[0123] Transform coefficient: may refer to a coefficient value generated after performing a transform in an encoder. A 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.

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

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

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

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

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

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

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

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

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

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

[0134] The encoding device 100 may perform encoding of an input image by using an intra mode or an inter mode or both an intra mode and an inter mode. In addition, the encoding device 100 may generate a 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 the current picture as the current encoding target. The input block may be referred to as the current block as the current encoding target, or may be referred to as the encoding target block.

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

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

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

[0138] When the value of the motion vector is not an integer, the motion prediction unit 111 and the motion compensation unit 112 may generate a prediction block by applying an interpolation filter to a partial 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 depending on the determined mode.

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

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

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

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

[0143] The entropy encoding unit 150 may generate a bit stream 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 bit stream. 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.

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

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

[0146] The coding parameters may include information such as syntax elements (flags, indexes, etc.) that are encoded in the encoder and sent to the decoder with a signal, as well as information derived when performing encoding or decoding. The coding parameters may represent information required when encoding or decoding an image. For example, at least one value or combination of the following items may be included in the coding parameters: unit / block size, unit / block depth, unit / block partition information, unit / block shape, unit / block partition structure, whether to perform quadtree-shaped partitioning, whether to perform binary tree-shaped partitioning, binary tree-shaped partition direction (horizontal or vertical), binary tree-shaped partition shape (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 primary (first) transform is used, information on whether the secondary transform is used, primary transform index, secondary transform index , information on whether a residual signal exists, coding block pattern, coding block flag (CBF), quantization parameter, quantization parameter residual, quantization matrix, whether to apply an intra-frame loop filter, intra-frame loop filter coefficients, intra-frame loop filter taps, intra-frame loop filter shape / shape, whether to apply a deblocking filter, deblocking filter coefficients, deblocking filter taps, deblocking filter strength, deblocking filter shape / shape, 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 / shape,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 samples, reconstructed chrominance samples, residual luminance samples, residual chrominance samples, luminance transform coefficient, chrominance transform coefficient, quantized luminance level, quantized chrominance level, transform coefficient level scanning method, motion vector search area at decoder side size, shape of a motion vector search area at a decoder side, number of motion vector searches at a decoder side, information about a CTU size, information about a minimum block size, information about a maximum block size, information about a maximum block depth, information about 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 about a luminance signal or information about a chrominance signal.

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

[0148] When the encoding apparatus 100 performs encoding by inter-frame prediction, the encoded current picture may be used as a reference picture for another image that is subsequently processed. Therefore, the encoding apparatus 100 may reconstruct or decode the encoded current picture, or store the reconstructed or decoded image as a reference picture in the reference picture buffer 190.

[0149] 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. A reconstructed block may be generated by adding the dequantized or inversely transformed coefficient or the dequantized and inversely transformed coefficient to the prediction block. 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.

[0150] 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 a loop filter.

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

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

[0153] 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 shape and coefficient of the ALF to be applied to each block may vary.

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

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

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

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

[0158] 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-frame mode or an inter-frame mode. In addition, the decoding device 200 may generate a reconstructed image or a decoded image generated by decoding, and output the reconstructed image or the decoded image.

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

[0160] 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 as 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.

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

[0162] In order to decode the transform coefficient level (quantized level), the entropy decoding unit 210 may change the coefficient of the unidirectional vector shape into a two-dimensional block shape by using the transform coefficient scanning method.

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

[0164] When the intra mode is used, the intra prediction unit 240 may generate a predicted block by performing spatial prediction on the current block, wherein the spatial prediction uses sample values ​​of blocks that are adjacent to the decoding target block and have been decoded.

[0165] 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 picture stored in the reference picture buffer 270 .

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

[0167] Figure 3 is a diagram schematically showing a partition structure of an image when the image is encoded and decoded. Figure 3 An example of partitioning a single cell into a plurality of lower-level cells is schematically shown.

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

[0169] Reference Figure 3 , the image 300 is partitioned sequentially according to the maximum coding unit (LCU), and the LCU unit is determined as a partition structure. Here, the LCU may be used in the same meaning as the coding tree unit (CTU). Unit partitioning may mean partitioning a block associated with the unit. In the block partition information, information about the unit depth may be included. The depth information may indicate the number or degree of the unit being partitioned or both the number and degree of the unit being partitioned. A single unit may be partitioned into a plurality of 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.

[0170] The partition structure may indicate the distribution of coding units (CUs) within the LCU 310. Such distribution may be determined according to whether a single CU is partitioned into a plurality of (positive integers equal to or greater than 2, including 2, 4, 8, 16, etc.) 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 sizes smaller than the horizontal size and vertical size before partitioning according to the number of partitions. The CU may be recursively partitioned into a plurality of 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 predetermined depth or a predetermined size. For example, the depth of the LCU may be 0, and the depth of the minimum coding unit (SCU) may be a predetermined 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 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. Also, 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.

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

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

[0173] 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 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 shape.

[0174] 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 having a size of 32×32 is vertically partitioned 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 having a size of 8×32 is horizontally partitioned 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 by a binary tree partition structure.

[0175] For example, when one coding unit is partitioned into three sub-coding units, the horizontal size or the vertical size of the coding unit may be partitioned at a ratio of 1:2:1, thereby generating three sub-coding units having a ratio of the horizontal size or the vertical size of 1:2:1. For example, when a coding unit having a size of 16×32 is partitioned horizontally into three sub-coding units, the three sub-coding units may have sizes of 16×8, 16×16, and 16×8, respectively, in order from the uppermost sub-coding unit to the lowermost sub-coding unit. For example, when a coding unit having a size of 32×32 is partitioned vertically into three sub-coding units, the three sub-coding units may have sizes of 8×32, 16×32, and 8×32, respectively, in order from the left sub-coding unit to the right sub-coding unit. When one coding unit is partitioned into three sub-coding units, the coding unit may be said to be partitioned into three sub-coding units or partitioned according to a ternary tree partition structure.

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

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

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

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

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

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

[0182] When a coding unit corresponding to a node of a multi-type tree is further partitioned according to a multi-type tree partition structure, the coding unit may include partition direction information. The partition direction information may indicate in which direction the current coding unit will be partitioned for the multi-type tree partition. The partition direction information having a first value (e.g., "1") may indicate that the current coding unit will be partitioned vertically. The partition direction information having a second value (e.g., "0") may indicate that the current coding unit will be partitioned horizontally.

[0183] When the coding unit corresponding to the node of the multi-type tree is further partitioned according to the multi-type tree partition structure, the current coding unit may include partition tree information. The partition tree information may indicate a tree partition structure to be used to partition the nodes of the multi-type tree. The partition tree information having a first value (e.g., "1") may indicate that the current coding unit will be partitioned according to a binary tree partition structure. The partition tree information having a second value (e.g., "0") may indicate that the current coding unit will be partitioned according to a ternary tree partition structure.

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

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

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

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

[0188] However, when the size of the coding unit (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 partition of the coding unit for transforming is not separately signaled, and the partition of the coding unit for transforming may be determined by comparison between the horizontal size or vertical size of the coding unit and the horizontal size or vertical size of the maximum transform block. For example, when the horizontal size (width) of the coding unit is larger than the horizontal size (width) of the maximum transform block, the coding unit may be vertically divided into two equal parts. For example, when the vertical size (height) of the coding unit is larger than the vertical size (height) of the maximum transform block, the coding unit may be horizontally divided into two equal parts.

[0189] Information on the maximum and / or minimum size of a coding unit and information on the maximum and / or minimum size of a transform block may be signaled or determined at 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.

[0190] Information on the minimum size of the coding unit corresponding to the leaf node of the quadtree (quadtree minimum size) and / or information on the maximum depth from the root node of the multi-type tree to the leaf node (maximum tree depth of the multi-type tree) may be signaled or determined at 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 an intra-picture slice and an inter-picture slice.

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

[0192] As another example, the maximum size of the binary tree and / or the maximum size of the ternary tree may be signaled or determined at the slice level. Alternatively, the minimum size of the binary tree and / or the minimum size of the ternary tree may be signaled or determined at the slice level.

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

[0194] For example, when the size of the coding unit is not greater than the minimum size of the quadtree, the coding unit does not include the quad partition information. Therefore, the quad partition information may be inferred as the second value.

[0195] For example, when the size (horizontal size and vertical size) of the coding unit corresponding to the node of the multi-type tree is greater than the maximum size (horizontal size and vertical size) of the binary tree and / or the maximum size (horizontal size and vertical size) of the ternary tree, the coding unit may not be partitioned by the binary tree or the ternary tree. Therefore, the multi-type tree partition indication information may not be signaled, but the multi-type tree partition indication information may be inferred as the second value.

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

[0197] Optionally, the binary tree partition or ternary tree partition may be limited based on the size of the virtual pipeline data unit (hereinafter, the pipeline buffer size). For example, when the coding unit is partitioned 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 partitions may be limited.

[0198] - N×M (N and / or M is 128) ternary tree partitions for coding units

[0199] - 128×N (N<=64) binary tree partitions in the horizontal direction for coding units

[0200] - N×128 (N<=64) binary tree partitions in the vertical direction for coding units

[0201] Optionally, when the depth of the coding unit corresponding to the node of the multi-type tree is equal to the maximum depth of the multi-type tree, the coding unit may not be further partitioned into two and / or three partitions. Therefore, the multi-type tree partition indication information may not be sent by a signal, but the multi-type tree partition indication information may be inferred as the second value.

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

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

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

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

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

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

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

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

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

[0211] 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 performing both copying and interpolation, may be used to replace the unavailable sample value of the sample, so that the replaced sample value is used as the reference sample of the current block.

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

[0213] 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 samples of fragment A and fragment F can be filled with the samples of the closest fragment B and fragment E, respectively, instead of retrieving from the reconstructed neighboring blocks. The index information indicating the reference sample line to be used for intra prediction of the current block can be signaled. For example, in Figure 7 In the example, reference sample line indicators 0, 1, and 2 may be signaled as index information indicating reference sample lines 0, 1, and 2. When the upper boundary of the current block is the boundary of the CTU, only reference sample line 0 may be available. Therefore, in this case, index information may not be signaled. When a reference sample line other than reference sample line 0 is used, filtering for a prediction block to be described later may not be performed.

[0214] When intra prediction is performed, a filter may be applied to at least one of reference samples and prediction samples based on the intra prediction mode and the current block size / shape.

[0215] In the case of the planar mode, when generating the prediction block of the current block, according to the position of the prediction target sample in the prediction block, the sample value of the prediction target sample can be generated by using the weighted sum of the upper reference sample and the left reference sample of the current block 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 can be used. In addition, in the case of the angular mode, the prediction block can be generated by using the upper reference sample, the left reference sample, the upper right reference sample and / or the lower left reference sample of the current block. In order to generate the prediction sample value, interpolation of real number units can be performed.

[0216] 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 the parameters of the linear model are derived, 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, secondary sampling 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 a linear model and intra prediction between color components may be performed based on samples of the corresponding subsamples. Whether to perform intra prediction between color components and / or the range of a template may be signaled as an intra prediction mode.

[0217] The current block may be partitioned into two sub-blocks or four sub-blocks in the horizontal direction or the vertical direction. The partitioned sub-blocks may be reconstructed sequentially. That is, intra prediction may be performed on the sub-block to generate a sub-prediction block. In addition, inverse quantization and / or inverse transformation may be performed on the sub-block to generate a sub-residual block. The reconstructed sub-block may be generated by adding the sub-prediction block to the sub-residual block. The reconstructed sub-block may be used as a reference sample for intra prediction of the sub-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 signaled. It may be limited to performing sub-block-based intra prediction 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.

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

[0219] The intra-frame prediction mode of the current block can be entropy encoded / decoded by predicting the intra-frame prediction mode of the block adjacent to the current block. In the case where the intra-frame prediction mode of the current block is the same as that of the neighboring block, the same information as that of the intra-frame prediction mode of the current block and the neighboring block can be sent by signaling using predetermined flag information. In addition, the 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 can be sent by signaling. In the case where the intra-frame prediction mode of the current block and the neighboring block is not the same, the intra-frame prediction mode information of the current block can be entropy encoded / decoded by performing entropy encoding / decoding based on the intra-frame prediction mode of the neighboring block.

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

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

[0222] 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) for 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) for 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.

[0223] Hereinafter, embodiments of inter prediction will be described in detail.

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

[0225] The motion information of the current block may be derived during inter-picture prediction by each of the encoding apparatus 100 and the decoding apparatus 200. The motion information of the current block may be derived by using 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.

[0226] The derivation method of motion information may be different depending on the prediction mode of the current block. For example, the prediction modes applied to inter prediction include AMVP mode, merge mode, skip mode, merge mode with motion vector difference, sub-block merge mode, geometric partition mode, combined inter-frame intra-frame prediction mode, affine mode, etc. Here, the merge mode may be referred to as motion merge mode.

[0227] 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 of the current block may be derived by using the generated motion vector candidate list. The motion information of the current block may be determined based on the derived motion vector candidate. The motion vector of the co-located block or the motion vector of the block adjacent to the co-located block may be referred to as a temporal motion vector candidate, and the motion vector of the reconstructed neighboring block may be referred to as a spatial motion vector candidate.

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

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

[0230] 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 decoded target block through the sum of the entropy-decoded MVD and the affine controlled motion vector candidate.

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

[0232] Another example of a method of deriving motion information of a current block may be a merge mode. The merge mode may indicate a method of merging motions of a plurality of blocks. The merge mode may indicate 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 co-located 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).

[0233] 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 a combination of 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.

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

[0235] 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 sends it to the decoding device 200 with a signal. The decoding device 200 can 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 sent with the signal can be referred to as a merge mode with a motion vector difference.

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

[0237] 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 the reference picture (sub-block based temporal merge candidates) and / or affine control point motion vector merge candidates.

[0238] The geometric partition mode may denote a mode of deriving motion information by partitioning the current block into predefined 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.

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

[0240] 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 corrected motion information.

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

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

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

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

[0245] A quantized level signal (quantized coefficient) may be generated by performing quantization on a residual signal or a result of performing a primary transform and / or a secondary transform. Depending on the intra prediction mode or block size / shape of the block, the quantized level signal may be scanned according to at least one of a diagonal upper right scan, a vertical scan, and a horizontal scan. For example, when scanning a coefficient in a diagonal upper right scan, the coefficient of the block shape is changed to a one-dimensional vector shape. In addition to the diagonal upper right scan, depending on the intra prediction mode and / or the size of the transform block, a horizontal scan that scans the coefficient of a two-dimensional block shape horizontally or a vertical scan that scans the coefficient of a two-dimensional block shape vertically may be used. The scanned quantized level coefficient may be entropy encoded for insertion into a bitstream.

[0246] 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 shape by reverse scanning. For reverse scanning, at least one of diagonal upper right scanning, vertical scanning, and horizontal scanning can be used.

[0247] The quantized level coefficients may then be dequantized, then inversely transformed twice as needed, and finally inversely transformed once as needed to produce a reconstructed residual signal.

[0248] Inverse mapping in the dynamic range can be performed for the luminance component reconstructed by intra prediction or inter prediction before loop filtering. The dynamic range can be partitioned into 16 equal segments, and the mapping function of each segment can be sent with a signal. The mapping function can be sent with a signal at the slice level or the parallel block group level. The inverse mapping function for performing inverse mapping can be derived based on the mapping function. 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 a reconstructed block. However, since intra prediction is performed in the mapping area, the prediction block generated via intra prediction can be used to generate a reconstructed block without mapping / inverse mapping.

[0249] 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 partitions of the luminance component and the chroma component follow the same tree structure. Scaling can be performed based on the average value of the sample values ​​of the luminance prediction block corresponding to the chroma block. In this case, when the current block uses inter-frame prediction, the luminance prediction block may 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 values ​​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, loop filtering, and reference picture storage can be performed in the inverse mapping area.

[0250] Information indicating whether mapping / inverse mapping of luma components and chroma components is available may be signaled through a sequence parameter set.

[0251] The prediction block of the current block can be generated based on a block vector indicating the displacement between the current block and the reference block in the current picture. In this way, the prediction mode for generating the prediction block with reference to the current picture is called an intra-block copy (IBC) mode. The IBC mode can be applied to M×N (M<=64, N<=64) coding units. The IBC mode may include 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 sent with a signal so that a merge candidate can be specified. The block vector of the specified merge candidate can be used as the block vector of the current block. The merge candidate list may include at least one of a spatial candidate, a history-based candidate, a candidate based on the average of two candidates, and a zero merge candidate. In the case of the AMVP mode, a difference block vector may be sent with a signal. 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 sent with a signal. The prediction block in the IBC mode is included in the current CTU or the left CTU and is limited to a block in an area that has been reconstructed. For example, the value of the block vector can be limited so that the prediction block of the current block is located in the region of three 64×64 blocks before the 64×64 block to which the current block belongs in the 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 can be reduced.

[0252] In the following, reference will be made to Figures 8 to 23 A sub-block partitioning method and / or a method of deriving prediction information between sub-blocks according to an embodiment of the present invention is described.

[0253] A method of deriving inter prediction information will be described.

[0254] When inter prediction of the current block is performed according to the merge mode, the merge candidates may include a spatial merge candidate, a temporal merge candidate, a subblock-based temporal merge candidate, a subblock-based temporal and spatial combined merge candidate, a combined merge candidate, a zero merge candidate, etc. The merge candidate may include inter prediction information of at least one of an inter prediction indicator, a reference picture index of a reference picture list, a motion vector, and a picture order count (POC).

[0255] A method of deriving spatial merging candidates will be described.

[0256] From reconstructed blocks spatially adjacent to the current block to be encoded / decoded, spatial merging candidates for the current block may be derived.

[0257] Figure 8 is a diagram illustrating a method of deriving spatial merging candidates according to an embodiment of the present invention.

[0258] Reference Figure 8 , motion information may be derived from a block corresponding to at least one of a block A1 located on the left side of a current block X to be encoded / decoded, a block B1 located above the current block X, a block B0 located at the upper right corner of the current block X, a block A0 located at the lower left corner of the current block X, and a block B2 located at the upper left corner of the current block X. A spatial merge candidate of the current block may be determined by using the derived motion information. In an example, the derived motion information may be used as a spatial merge candidate of the current block.

[0259] The spatial merge candidate may represent a block reconstructed spatially adjacent to the block to be encoded / decoded (or motion information of a spatially adjacent reconstructed block). The block may have a square shape or a non-square shape. In addition, the block reconstructed spatially adjacent to the block to be encoded / decoded may be divided in units of low-level blocks (sub-blocks). At least one spatial merge candidate may be derived for each low-level block.

[0260] Deriving a spatial merge candidate may mean deriving a spatial merge candidate and adding it to a merge candidate list. Here, each of the merge candidates added to the merge candidate list may have different motion information.

[0261] Up to maxNumSpatialMergeCand spatial merge candidates may be derived. Here, maxNumSpatialMergeCand may be a positive integer including 0. In the example, maxNumSpatialMVPCand may be 5. MaxNumMergeCand may be the maximum number of merge candidates that may be included in the merge candidate list, and may be a positive integer including 0. In addition, numMergeCand may represent the number of merge candidates in the actual merge candidate list included in the predefined MaxNumMergeCand. In addition, the use of maxNumSpatialMergeCand, numMergeCand, and MaxNumMergeCand does not limit the scope of the present invention. The encoding / decoding device may use the above information by using parameter values ​​having the same meaning as numMergeCand and MaxNumMergeCand.

[0262] A method of deriving temporal merging candidates will be described.

[0263] Temporal merge candidates may be derived from blocks reconstructed in temporally adjacent pictures or reference pictures of the current block to be encoded / decoded. A reference picture temporally adjacent to the current block may represent a co-located picture (picture). Information of the co-located picture (e.g., at least one of an inter-prediction indicator, a reference picture index, and motion vector information indicating the co-located block of the current block) may be sent from the encoder to the decoder in at least one coding block unit within a sequence / picture / slice / parallel block / CTU / CU. In addition, information about the co-located picture may be signaled in multiple units. For example, information about the co-located picture may be signaled in picture units and slice units, respectively. Alternatively, the information about the co-located picture may be implicitly derived in the encoder / decoder by using at least one of the inter-prediction indicator of the co-located picture at the sequence / picture / slice / tile level, and the reference picture index information, motion information (e.g., an inter-prediction indicator or a reference picture index or both) of the current block or the temporal and spatial neighboring blocks or both of the current block and the temporal and spatial neighboring blocks that have been encoded / decoded according to the hierarchy of the encoding / decoding order in the encoder / decoder. For example, when there is no information about the co-located picture at the slice level, the information about the co-located picture at the picture level may be regarded as information about the co-located picture at the slice level.

[0264] Here, when deriving a temporal merge candidate for the current block, the position of the co-located picture and / or the co-located block within the co-located picture may be selected by using at least one piece of motion information of the temporal and spatial neighboring blocks that have been encoded / decoded. Therefore, a block at the same position within the co-located picture may be selected based on the position of the current block. Optionally, the co-located block of the current block may be defined as a block that is moved by a corresponding vector from the spatially same position of the current block within the selected co-located picture using at least one piece of motion vector information of the temporal and spatial neighboring blocks that have been encoded / decoded.

[0265] Here, the motion information of the temporal and spatial neighboring blocks that have been encoded / decoded may be at least one of a motion vector, a reference picture index, an inter prediction indicator, a picture order count (POC), and information about a co-located picture at a current encoding picture (or slice) level.

[0266] Deriving the temporal merge candidate may mean adding the derived temporal merge candidate to the merge candidate list when the motion information of the derived temporal merge candidate is different from the motion information of the merge candidate list.

[0267] The number of temporal merge candidates derived from this may be as many as maxNumTemporalMergeCand. Here, maxNumTemporalMergeCand may be a positive integer including 0. For example, maxNumTemporalMergeCand may be 1. However, the use of maxNumTemporalMergeCand does not limit the scope of the present invention. The encoder / decoder may use the above information by having a parameter value having the same meaning as maxNumTemporalMergeCand.

[0268] In addition, prediction using the temporal merging candidate may be referred to as TMVP (Temporal Motion Vector Prediction).

[0269] Fig. 9 is a diagram illustrating a method of deriving a temporal merging candidate according to an embodiment of the present invention.

[0270] Reference Fig. 9 , a temporal merge candidate can be derived in a block at position H or a block at position C3, wherein the block at position H exists outside a co-located block C at the same spatial position as the current block X to be encoded / decoded within a reference picture of the current picture to be encoded / decoded.

[0271] Here, when the temporal merge candidate may be derived from the block at position H, the temporal merge candidate may be derived from the block at position H. Otherwise, when the temporal merge candidate is not derived from the block at position H, the temporal merge candidate may be derived from the block at position C3. The order of deriving the temporal merge candidates may vary.

[0272] In addition, when the predetermined position or position C3 is intra-coded, a temporal merging candidate may be derived in the block at position H or position C3. The co-located block of the current block may have a square shape or a non-square shape.

[0273] When the distance between the picture including the current block and the reference picture of the current block is different from the distance between the picture including the co-located block and the reference picture of the co-located block, the temporal merge candidate can be derived by performing scaling on the motion vector of the co-located block. The scaling of the motion vector can be performed according to the ratio of td to tb (in the example, ratio = (tb / td)). Here, td may represent the difference between the POC of the co-located picture and the POC of the reference picture of the co-located block. In addition, tb may represent the difference between the POC of the picture to be encoded / decoded and the POC of the reference picture of the current block.

[0274] Derivation of sub-block based temporal merging candidates will be described.

[0275] The temporal merging candidate may be derived from the co-located sub-block to be encoded / decoded in units of sub-blocks having at least one of a size, a shape, and a depth smaller than the current block. For example, the sub-block may be a block having a horizontal or vertical length smaller than the current block, or a block having a deeper depth or a minimized shape than the current block, or may be a block included in the current block.

[0276] The co-located sub-block of the sub-block to be encoded / decoded may have a square shape or a non-square shape. In addition, the co-located block of the current block may be divided into sub-block units having at least one of a size, shape, and depth that is smaller or deeper than the current block. At least one temporal merge candidate may be derived for each sub-block.

[0277] When at least one temporal merging candidate is derived by performing division by sub-block units, the temporal merging candidate may be selected based on at least one of the size, shape, and depth of the sub-block. Fig. 9 A temporal merge candidate is derived from a co-located sub-block at the position H or C3 or both H and C3 described above. Optionally, at least one temporal merge candidate may be derived by using motion information (in the example, at least one of a motion vector, a reference picture index, an inter-prediction indicator, and a POC) stored in each sub-block unit of the co-located block associated with a position moved according to any motion information derived from a neighboring block of the current block.

[0278] In addition, whether to derive a sub-block-based temporal merging candidate may be determined based on whether there is motion information about a sub-block at a predefined position of a co-located block corresponding to a position moved according to random motion information derived from a neighboring block of the current block. For example, a sub-block-based temporal merging candidate may be derived only when motion information exists in a sub-block at a predefined position of the co-located block. Here, the sub-block at the predefined position of the co-located block may be a sub-block at a center position.

[0279] In addition, when there is no available motion information stored at each sub-block unit of the co-located block corresponding to the position moved according to the random motion information derived from the neighboring blocks of the current block, at least one temporal merging candidate may be derived by using the motion information of the sub-block at the predefined position of the co-located block for determining whether to derive the sub-block-based temporal merging candidate.

[0280] When deriving a temporal merge candidate for the current block or a sub-block of the current block, a motion vector of each reference picture list (e.g., L0 or L1 or both) brought from a co-located sub-block within the co-located block may be scaled to a motion vector corresponding to an arbitrary reference picture of the current block. Optionally, after obtaining a plurality of motion vectors by scaling a motion vector generated from a co-located sub-block to a motion vector corresponding to at least one of all reference pictures that can be referenced by a sub-block of the current block, at least one prediction block using the scaled motion vector corresponding to each reference picture may be obtained. In addition, a prediction block of the current block or sub-block may be obtained by using a weighted sum of the obtained prediction blocks.

[0281] In addition, prediction by subblock-based temporal merging candidates may be referred to as subblock-based temporal motion vector prediction (SbTMVP).

[0282] A method of deriving sub-block based temporal and spatial combination merging candidates will be described.

[0283] A merge candidate of the current block may be derived by dividing the current block into subblocks and by using at least one piece of motion information of spatially neighboring subblocks and co-located subblocks within a co-located picture for each obtained subblock unit.

[0284] Fig.10 2 is a diagram illustrating a method for deriving a sub-block-based temporal and spatial combination merging candidate according to an embodiment of the present invention.

[0285] Fig.10 is a diagram showing a block structure in which a shadow represented by an 8×8 current block is divided into four 4×4 sub-blocks (i.e., A, B, C, and D blocks). A temporal-spatial combination merging candidate based on a sub-block may be derived by using motion vector information of a sub-block temporally and spatially adjacent to each sub-block. Here, the motion vector information may represent a motion vector, an inter-frame prediction indicator, a reference picture index, a POC, etc.

[0286] exist Fig.10 In the example, when a residual signal is derived according to motion compensation after dividing a current block into sub-blocks, motion information may be obtained by performing a scan starting at a sub-block located above the first sub-block A from a left-to-right direction. In an example, when the first upper sub-block is encoded by using an intra prediction method, the second upper sub-block may be sequentially scanned. In other words, scanning of the upper sub-blocks may be performed until an upper sub-block including available motion vector information is found.

[0287] In addition, after obtaining the available motion information of the upper sub-block, the available motion information may be obtained by performing scanning from the top to the bottom direction at the sub-block c on the left side of the first sub-block A.

[0288] In addition, after obtaining the spatial adjacent motion information of the left subblock or the upper subblock or both the left subblock and the upper subblock, the temporal motion information can be derived by obtaining the motion information of the co-located subblock or the co-located block of the current subblock, or the co-located subblock and the co-located block of the current subblock.

[0289] Here, the position of the co-located block or the sub-block of the co-located block can be represented by Fig. 9 The motion information at the position C3 or the position H described above may represent the co-located block at the position compensated by the motion vector derived from the sub-block adjacent to the current block or the co-located block. At least one of the motion information of the block adjacent to L0 or L1 or both L0 and L1 in space and the motion information of the block adjacent in time may be obtained by using the above method. In addition, based on at least one piece of motion information obtained, a sub-block-based temporal-spatial combination merging candidate of the current sub-block to be encoded / decoded may be derived.

[0290] In an example, for L0 or L1 or both L0 and L1, at least one piece of motion vector information derived in the temporal / spatial sub-block of the description of the sub-block of the current block, a motion vector scan may be performed to be associated with the first reference picture of the current block. Subsequently, by using at least one of an average value, a maximum value, a minimum value, a median value, a weighted value, and a mode of up to three scaled motion vectors, a motion vector of the first current sub-block A or a temporal-spatial combined merging candidate of the first sub-block A may be derived. In addition, temporal-spatial combined merging candidates of sub-blocks B, C, and D may be derived by using the above method.

[0291] In addition, prediction using sub-block based temporal spatial combination merging candidates may be referred to as STMVP (spatial-temporal motion vector prediction).

[0292] Derivation of additional merge candidates will be described.

[0293] As an additional merge candidate that can be used in the present invention, at least one of a modified spatial merge candidate, a modified temporal merge candidate, a combined merge candidate, and a merge candidate having a predetermined motion information value may be derived.

[0294] Here, deriving the additional merge candidate may mean that when there is a merge candidate having different motion information from the merge candidate present in the existing merge candidate list, adding the corresponding merge candidate to the merge candidate list.

[0295] The modified spatial merge candidate may mean a merge candidate obtained by modifying motion information of at least one of the spatial merge candidates derived using the above method.

[0296] The modified temporal merge candidate may mean a merge candidate obtained by modifying motion information of at least one temporal merge candidate derived using the above method.

[0297] The combined merge candidate may refer to a merge candidate using at least one piece of motion information of the merge candidate, wherein the merge candidate is a spatial merge candidate, a temporal merge candidate, a modified spatial merge candidate, a modified temporal merge candidate, a combined merge candidate, and a merge candidate with a predetermined motion information value present in the merge candidate list. Here, the combined merge candidate may refer to a combined bidirectional prediction merge candidate. In addition, prediction using the combined merge candidate may be referred to as CMP (Combined Motion Prediction).

[0298] The merge candidate having the predetermined motion information value may mean a zero merge candidate having a motion vector (0, 0). In addition, prediction using the merge candidate having the predetermined motion information value may be referred to as ZMP (Zero Motion Prediction).

[0299] At least one of a modified spatial merge candidate, a spatial merge candidate, a modified temporal merge candidate, a temporal merge candidate, a combined merge candidate, and a merge candidate with a predetermined motion information value may be derived for each subblock of the current block, and the merge candidate derived for each subblock may be added to a merge candidate list.

[0300] The inter prediction information may be derived in subblock units having at least one of a size, shape, and depth that is smaller or deeper than a current block to be encoded / decoded. In an example, the size may represent a horizontal size or a vertical size or both.

[0301] When the inter prediction information is derived in sub-block units of the current block, the encoder / decoder may derive the inter prediction information by using at least one of a bidirectional matching method and a template matching method.

[0302] When the bidirectional matching method is used, an initial motion vector list may be configured. When configuring the initial motion vector list, motion vectors adjacent to the current block may be used.

[0303] In an example, the initial motion vector list may be configured by using a prediction motion vector candidate of an AMVP mode of a current block.

[0304] In another example, the initial motion vector list may be configured by using merge candidates of a merge mode of the current block.

[0305] In another example, the initial motion vector list may be configured with a unidirectional motion vector of L0 or L1 or both L0 and L1 of the merge mode of the current block.

[0306] In another example, the initial motion vector list may be configured with motion vectors of remaining blocks except for the merge mode of the current block.

[0307] In another example, the initial motion vector list may be configured by combining at least N motion vectors of the above examples. Here, N may represent a positive integer greater than 0.

[0308] In another example, the initial motion vector list may be configured with motion vectors of one direction of list 0 or list 1.

[0309] Fig.11 is a diagram illustrating a method of deriving inter-frame prediction information by using a bidirectional matching method according to an embodiment of the present invention.

[0310] Reference Fig.11 , when the motion vector in the initial motion vector list is in the L0 list

[0311] When the MV0 in the image is in the same track as MV0, the reference image in the opposite direction can be deduced.

[0312] Here, the MV1 in the block indicated by MV0 can be

[0313] The MV having the minimum SAD (sum of absolute differences) between the blocks indicated by MV0 and MV1 is derived as the inter-frame prediction information of the current sub-block.

[0314] Fig.12 is a diagram illustrating a method of deriving inter-frame prediction information by using a template matching method according to an embodiment of the present invention.

[0315] By using Fig.12 The template defined in , the neighboring blocks of the current block can be used as templates. Here, the horizontal (width) and vertical (height) sizes of the template can be the same as or different from the horizontal (width) and vertical (height) sizes of the current block.

[0316] In the example, the top of the current block (Cur block) can be used as a template.

[0317] In another example, the left portion of the current block may be used as a template.

[0318] In another example, the left portion and the upper portion of the current block may be used as a template.

[0319] In another example, in a reference picture (Ref0) of a current picture (Cur pic), an upper or left portion, or both an upper and left portion, of a co-located block of a current block may be used as a template.

[0320] In another example, an MV having a minimum SAD between a template of the current block and a template of the reference block may be derived as the inter prediction information of the current subblock.

[0321] When inter-frame prediction information is derived in sub-block units of the current block, brightness compensation may be performed. For example, brightness changes of spatially adjacent samples of the current block sampled in at least N samples and brightness changes of spatially adjacent samples of the reference block may be approximated by using a linear model, where N is an arbitrary positive integer. In addition, the linear model may be applied to a block to which motion compensation of the current sub-block is applied in order to perform brightness compensation.

[0322] When inter-frame prediction information is derived in sub-block units of the current block, affine-based spatial motion prediction and compensation may be performed. For example, for a motion vector of the upper left coordinate of the current block and a motion vector at the upper right of the current block, a motion vector may be generated in sub-block units of the current block by using an affine transformation formula. In addition, motion compensation may be performed by using the generated motion vector.

[0323] Fig.13 is a diagram illustrating a method of deriving inter-frame prediction information based on OMBC (Overlapped Block Motion Compensation) according to an embodiment of the present invention.

[0324] When inter-frame prediction information is derived by sub-block units of the current block, a block compensated by using the inter-frame prediction information of the current block is combined with at least one sub-block compensated by using the inter-frame prediction information of at least one of the sub-blocks at left, right, upper and lower positions included in the current block, and an OBMC-based prediction block of the sub-block of the current block can be generated.

[0325] In an example, execution may be applied only for sub-blocks existing at boundary positions inside the current block.

[0326] In another example, execution may be applied for all sub-blocks within the current block.

[0327] In another example, the execution may be applied to a sub-block existing at a left boundary position inside the current block.

[0328] In another example, the execution may be applied to a sub-block existing at a right boundary position inside the current block.

[0329] According to an embodiment of the present invention, a picture may be encoded / decoded by dividing the picture by the number of sub-block units. Unit and block may be used to have the same meaning.

[0330] Fig.14 is a diagram showing quadtree partitioning, symmetric binary tree partitioning, and asymmetric binary tree partitioning according to an embodiment of the present invention. Fig.14 In , w may represent the horizontal size of the block, and h may represent the vertical size of the block.

[0331] Reference Fig.14 ,Quadtree partitioning is a partitioning shape in which a block is divided into four sub-blocks, and the horizontal and vertical sizes of the four sub-blocks can be half of the horizontal and vertical sizes of the block before the partitioning.

[0332] Binary tree partitioning is a partitioning shape that divides a block into two sub-blocks, and may include symmetric binary tree partitioning (symmetric partitioning) or asymmetric binary tree partitioning (asymmetric partitioning). Here, symmetric binary tree partitioning may include horizontal symmetric partitioning and vertical symmetric partitioning. In addition, asymmetric binary tree partitioning may include horizontal asymmetric partitioning or vertical asymmetric partitioning, or both horizontal asymmetric partitioning and vertical asymmetric partitioning. In addition, the leaf nodes of the binary tree may represent CUs.

[0333] The nodes divided by the symmetric binary tree can have the same size. In addition, the nodes divided by the asymmetric binary tree can have different sizes.

[0334] According to an embodiment of the present invention, as a partition structure, there may be a quadtree (QT) partition.

[0335] Reference Fig.14 , a CTU can be recursively divided into multiple CUs by using a quadtree structure. Whether to use intra prediction or inter prediction can be determined based on the CU unit.

[0336] In an example, one CU may be divided into at least M PUs. Here, M may be a positive integer equal to or greater than 2.

[0337] In another example, one CU may be divided into at least N TUs by using a quadtree structure. Here, N may be a positive integer equal to or greater than 2.

[0338] According to an embodiment of the present invention, as a partition structure, there may be a quadtree followed by a binary tree partition. Quadtree followed by a binary tree partition may represent a partition structure in which quadtree partition is applied first and then a binary tree partition is applied. Here, a leaf node of a quadtree or a leaf node of a binary tree may represent a CU.

[0339] In an example, one CTU may be recursively divided into two or four CUs by using a binary tree after quadtree partitioning. Here, when the CU is divided into two, the partitioning may be performed by using a binary tree (BT) structure, and when the CU is divided into four, the partitioning may be performed by using a quadtree structure. Because the CTU is partitioned by the quadtree and then the binary tree, the CU may have a square shape or a non-square (rectangular) shape.

[0340] When a CU is divided by using a quadtree followed by a binary tree division, at least one of a first flag (indicating whether to perform quadtree division or whether to perform further division, or whether to perform quadtree division and whether to perform further division) and a first index (indicating whether to perform horizontal symmetric division or vertical symmetric division and whether to perform further division, or whether to perform horizontal symmetric division or vertical symmetric division and whether to perform further division) may be sent by a signal. Here, when the first flag indicates a first value, it may indicate that the division is performed by using a quadtree structure, and when the first flag indicates a second value, it may indicate that further division is not performed. In addition, when the first index indicates a first value, it may indicate that further division is not performed, when the first index indicates a second value, it may indicate horizontal symmetric division, and when the first index indicates a third value, it may indicate vertical symmetric division. When the first flag indicates the second value, the first index may be sent by a signal. In addition, when it is determined that further division of the CU is impossible based on the size or depth of the CU or both the size and depth of the CU, the first flag or the first index or both the first flag and the first index may not be sent by a signal.

[0341] Fig.15 is a diagram showing symmetric binary tree partitioning after quadtree partitioning according to an embodiment of the present invention. Fig.15 In the embodiment, the QT split flag may indicate whether to perform quadtree partitioning, the BT split flag may indicate whether to perform binary tree partitioning, and the BT split type may indicate whether to perform horizontal partitioning (or horizontal direction partitioning) or vertical partitioning (or vertical direction partitioning).

[0342] Reference Fig.15 , a CTU can be divided by using a quadtree structure. In addition, the leaf nodes of the quadtree can be further divided by using a binary tree structure. Here, the leaf nodes of the quadtree or the leaf nodes of the binary tree can represent a CU.

[0343] In the quadtree-post binary tree partition structure, a CU may be used as a unit for performing prediction and transformation without further partitioning it. In other words, in the quadtree-post binary tree partition structure, a CU, a PU, and a TU may have the same size. In addition, whether to use intra prediction or inter prediction may be determined by a CU as a unit. In other words, in the quadtree-post binary tree partition structure, at least one of intra prediction, inter prediction, transformation, inverse transformation, quantization, inverse quantization, entropy encoding / decoding, and in-loop filtering may be performed in square blocks or non-square (rectangular) block units.

[0344] A CU may include one luminance (Y) component block and two chrominance (Cb / Cr) component blocks. In addition, a CU may include one luminance component block or two chrominance component blocks. In addition, a CU may include one luminance component, a Cr chrominance component block, or a Cb chrominance component block.

[0345] According to an embodiment of the present invention, a binary tree followed by a quadtree partition may exist as a partition structure.

[0346] According to an embodiment of the present invention, a combined quadtree and binary tree partition may exist as a partition structure. The combined quadtree and binary tree partition may represent a partition structure in which quadtree partition and binary tree partition are applied without priority. In the above-mentioned quadtree followed by binary tree partition, quadtree partition is applied preferentially. However, in the combined quadtree and binary tree partition, quadtree partition is not prior and binary tree partition may be applied first.

[0347] One CTU may be recursively divided into two or four CUs by using a combined quadtree and binary tree partition structure. In the combined quadtree and binary tree partition structure, quadtree partition or binary tree partition may be applied to one CU. Here, when the CU is divided into two, the partition may be performed by using a binary tree, and when the CU is divided into four, the partition may be performed by using a quadtree. In addition, since the CU is obtained by dividing the CTU using the combined quadtree and binary tree structure, the CU may have a square or non-square (rectangular) shape.

[0348] By using a block partitioning structure combining quadtree and binary tree shapes, a picture can be encoded / decoded in all non-square block shapes having predetermined horizontal and vertical sizes or larger.

[0349] The luminance signal and the chrominance signal within the CTU may be divided by different block division structures. For example, in the case of a specific slice (I slice), the luminance signal and the chrominance signal within the CTU may be divided by different block division structures. In the case of other slices (P slices or B slices), the luminance signal and the chrominance signal within the CTU may be divided by the same block division structure. Here, the Cb signal and the Cr signal may use different intra-frame prediction modes, and the intra-frame prediction mode of each of the Cb signal and the Cr signal may be entropy encoded / decoded. The intra-frame prediction mode of the Cb signal may be entropy encoded / decoded by using the intra-frame prediction mode of the Cr signal. Conversely, the intra-frame prediction mode of the Cr signal may be entropy encoded / decoded by using the intra-frame prediction mode of the Cb signal.

[0350] A method of deriving intra prediction or inter prediction information or both intra prediction and inter prediction information on a subblock basis will be described.

[0351] Hereinafter, a sub-block partitioning method will be described.

[0352] The current block (CU) may have a square or rectangular shape or both a square and rectangular shape, and may represent a leaf node of at least one of a quadtree, a binary tree, and a ternary tree. In addition, at least one of intra prediction or inter prediction or both intra prediction and inter prediction, primary / secondary transform and inverse transform, quantization, inverse quantization, entropy encoding / decoding, and in-loop filter encoding / decoding may be performed in units of at least one of the size, shape, and depth of the current block (CU).

[0353] The current block may be divided into symmetric subblocks or asymmetric subblocks or at least one of the symmetric subblocks and the asymmetric subblocks. Intra-frame prediction or inter-frame prediction information or both intra-frame prediction and inter-frame prediction information may be derived for each subblock. Here, the symmetric subblock may refer to the symmetric subblocks obtained by using the Fig.14 The sub-blocks are obtained by using at least one of the quadtree, binary tree and ternary tree partition structures described above. Fig.16 The sub-blocks are obtained by dividing the structure described above, but are not limited thereto. The asymmetric sub-block may refer to at least one sub-block having a shape other than a square or a rectangle or both among the sub-blocks.

[0354] exist Fig.16 In the embodiment, when the current block is divided into two sub-blocks, the two sub-blocks may be defined as a first sub-block and a second sub-block, respectively. In addition, the first sub-block may be referred to as sub-block A, and the second sub-block may be referred to as sub-block B.

[0355] When the current block is divided into at least one of a symmetric sub-block or an asymmetric sub-block or both, the minimum size of the sub-block may be defined as M×N. Here, M and N may represent positive integers greater than 0, respectively. In addition, M and N may have the same or different values ​​from each other. In an example, a 4×4 block may be defined as a minimum size sub-block.

[0356] When the current block is divided into at least one of a symmetric sub-block or an asymmetric sub-block or both a symmetric sub-block and an asymmetric sub-block, no further block division may be performed for a specific block size or a specific block depth or a smaller size / deeper depth. Information of a specific block size or a specific block depth may be entropy encoded / decoded in units of at least one of a video parameter set (VPS), a sequence parameter set (SPS), a picture parameter set (PPS), a parallel block header, a slice header, a CTU, and a CU.

[0357] Information of a specific block size or a specific block depth may be entropy encoded / decoded for each of luminance and chrominance signals, and may have parameter values ​​different from each other.

[0358] Information of a specific block size or a specific block depth may be entropy encoded / decoded for each of the Cb and Cr signals and may have different parameter values.

[0359] Information of a specific block size at a specific block depth may be entropy encoded / decoded for each upper layer level and may have different parameter values.

[0360] The information of the specific block size or the specific block depth can be determined based on a comparison between the size of the current block or the depth of the current block and a predetermined threshold. The predetermined threshold may represent a reference size or depth for determining a block structure. In addition, the predetermined threshold may be represented in the shape of at least one of a minimum value and a maximum value of the reference size or depth. In addition, the predetermined threshold may be a value predefined in an encoder / decoder, may be variably derived based on a coding parameter of the current block, or may be signaled through a bitstream.

[0361] In an example, when the size or depth of the current block is equal to or less than / equal to or greater than a predetermined threshold, the current block may not be divided into at least one sub-block. For example, when the sum of the horizontal length and the vertical length of the current block is equal to or less than a predetermined threshold, the current block may not be divided into at least one sub-block.

[0362] For another example, when the size or depth of the current block is less than or greater than a predetermined threshold, partitioning the current block into at least one sub-block may not be performed. For example, when the sum of the horizontal length and the vertical length of the current block is less than a predetermined threshold, the current block may not be partitioned into at least one sub-block. In addition, when the horizontal and vertical lengths of the current block are respectively less than a predetermined threshold, the current block may not be partitioned into at least one sub-block. Here, the predetermined threshold may be 8.

[0363] For another example, when the current block is a quadtree leaf node having a predetermined threshold depth, partitioning the current block into at least one sub-block may not be performed.

[0364] For another example, when the current block is a binary tree leaf node having a predetermined threshold depth, partitioning the current block into at least one sub-block may not be performed.

[0365] For another example, when the current block is a leaf node of a quadtree, binary tree, and / or ternary tree that performs motion prediction / compensation by an affine transformation formula, partitioning the current block into at least one subblock or asymmetric subblock may not be performed.

[0366] For another example, when the current block is a quadtree, binary tree and / or ternary tree leaf node for deriving inter-frame prediction information by using at least one of a bidirectional matching method and a template matching method, partitioning the current block into at least one sub-block or asymmetric sub-block may not be performed.

[0367] When the current block is partitioned into at least one asymmetric sub-block, at least one of the sub-blocks obtained thereby may have any shape other than a square and / or a rectangle.

[0368] For example, the current block may be partitioned into two sub-blocks by a straight line. In this case, the sub-blocks thus obtained may be triangular, square (rectangular, trapezoidal) and hexagonal block shapes.

[0369] According to the present invention, when a current block is partitioned into at least one asymmetric sub-block, at least one of the sub-blocks obtained thereby may have a triangular shape.

[0370] Fig.16 is a diagram illustrating asymmetric partitioning according to an embodiment of the present invention. Fig.16 In , w may represent the horizontal size of the block, and h may represent the vertical size of the block.

[0371] exist Fig.16 In (a), when the current block is partitioned into two sub-blocks, the current block can be partitioned into two triangular sub-blocks using a diagonal boundary extending from the upper left to the lower right of the current block. Here, the remaining area except the upper right area of ​​the current block (the second sub-block or sub-block B) can be defined as the first sub-block or sub-block A.

[0372] exist Fig.16 In (b), when the current block is partitioned into two sub-blocks, the current block can be partitioned into two triangular sub-blocks using a diagonal boundary extending from the upper right to the lower left of the current block. Here, the remaining area except the lower right area of ​​the current block (the second sub-block or sub-block B) can be defined as the first sub-block or sub-block A.

[0373] Reference Fig.16 (a) and Fig.16 (b), when the current block is partitioned into four sub-blocks, the current block may be partitioned into four triangular sub-blocks obtained by drawing a diagonal boundary from the upper left to the lower right and then drawing a diagonal boundary from the upper right to the lower left. Alternatively, the current block may be partitioned into four triangular sub-blocks by drawing a diagonal boundary from the upper right to the lower left and then drawing a diagonal boundary from the upper left to the lower right.

[0374] In addition, when a motion prediction / compensation method of a current block (CU) is at least one of a skip mode and a merge mode, partitioning of triangular sub-blocks may be applied.

[0375] exist Fig.16 In (c), when the current block is partitioned into two sub-blocks, the remaining area except the lower right area of ​​the current block (the second sub-block or sub-block B) can be defined as the first sub-block or sub-block A.

[0376] exist Fig.16 In (d), when the current block is partitioned into two sub-blocks, the remaining area except the lower left area of ​​the current block (the second sub-block or sub-block B) can be defined as the first sub-block or sub-block A.

[0377] exist Fig.16 In (e), when the current block is partitioned into two sub-blocks, the remaining area except the upper right area of ​​the current block (the second sub-block or sub-block B) can be defined as the first sub-block or sub-block A.

[0378] exist Fig.16 In (f), when the current block is partitioned into two sub-blocks, the remaining area except the upper left area of ​​the current block (the second sub-block or sub-block B) can be defined as the first sub-block or sub-block A.

[0379] exist Fig.16 In (g), when the current block is partitioned into two sub-blocks, the upper part area, the lower part area and the left part area of ​​the current block are composed of The shaped area may be defined as a first sub-block or sub-block A. In addition, the remaining area except the first sub-block or sub-block A may be defined as a second sub-block or sub-block B.

[0380] exist Fig.16In (h), when the current block is partitioned into two sub-blocks, the upper part area, the lower part area and the right part area of ​​the current block are composed of The shaped area may be defined as a first sub-block or sub-block A. In addition, the remaining area except the first sub-block or sub-block A may be defined as a second sub-block or sub-block B.

[0381] exist Fig.16 In (i), when the current block is partitioned into two sub-blocks, the sub-blocks are composed of the lower part, the right part, and the left part of the current block. The shaped area may be defined as a first sub-block or sub-block A. In addition, the remaining area except the first sub-block or sub-block A may be defined as a second sub-block or sub-block B.

[0382] exist Fig.16 In (j), when the current block is partitioned into two sub-blocks, a "П"-shaped area consisting of an upper partial area, a right partial area, and a left partial area of ​​the current block may be defined as a first sub-block or sub-block A. In addition, a remaining area except the first sub-block or sub-block A may be defined as a second sub-block or sub-block B.

[0383] exist Fig.16 In (k), when the current block is partitioned into two sub-blocks, the remaining area of ​​the current block except the central area (the second sub-block or sub-block B) can be defined as the first sub-block or sub-block A.

[0384] In addition, Fig.16 (a) to Fig.16 The first sub-block (or sub-block A) and the second sub-block (or sub-block B) defined in (k) may be interchanged with each other.

[0385] The encoder / decoder may store a table or list including a plurality of asymmetric partition shapes. The asymmetric partition shape of the current block determined in the encoder may be sent to the decoder in the form of an index or a flag. In other words, based on information indicating a plurality of partition shapes (e.g., angle and distance information) and a table including corresponding indexes, the encoder may send the index of the table to the decoder.

[0386] In addition, the encoder / decoder may determine the asymmetric partition shape of the current block based on the encoding parameters of the current block. In addition, the encoder / decoder may determine the asymmetric partition shape of the current block based on neighboring blocks of the current block.

[0387] When the current block is partitioned into at least one asymmetric sub-block, the sub-block obtained thereby may have a horizontal size and / or a vertical size equal to or smaller than a horizontal size (w) and / or a vertical size (h) of the current block.

[0388] exist Fig.16In the partitioning process, when the current block is partitioned into two sub-blocks, the horizontal size and / or the vertical size of the sub-block may be smaller than the horizontal size and / or the vertical size of the current block.

[0389] exist Fig.16 (c) to Fig.16 In (f), when the current block is partitioned into two sub-blocks, the second sub-block may have a horizontal size of (3 / 4)×w and a vertical size of (3 / 4)×h, respectively, compared with the current block.

[0390] exist Fig.16 (g) to Fig.16 In (h), when the current block is partitioned into two sub-blocks, the second sub-block may have a horizontal size of (3 / 4)×w and a vertical size of (2 / 4)×h, respectively, compared with the current block.

[0391] exist Fig.16 In (i) to (j) of 16, when the current block is partitioned into two sub-blocks, the second sub-block may have a horizontal size of (2 / 4)×w and a vertical size of (3 / 4)×h, respectively, compared with the current block.

[0392] exist Fig.16 In (k), compared with the current block, the second sub-block may have a horizontal size of (2 / 4)×w and a vertical size of (2 / 4)×h, respectively.

[0393] In addition, the above-mentioned ratio of the horizontal size and / or the vertical size of the second sub-block may be predefined in the encoder or obtained based on information signaled from the encoder to the decoder.

[0394] The current block (CU) may have a square shape or a rectangular shape or both a square shape and a rectangular shape. In addition, the current block may be partitioned into at least one asymmetric sub-block by using the above method so that intra prediction and / or inter prediction information may be derived. Here, each sub-block may derive intra prediction and / or inter prediction information in a lowest level sub-block unit, and the lowest level sub-block may represent a minimum block unit having a predetermined size. For example, a 4×4 block size may be defined as a lowest level sub-block.

[0395] In addition, information about the size of the lowest-level sub-block may be entropy encoded / decoded in units of at least one of a video parameter set (VPS), a sequence parameter set (SPS), a picture parameter set (PPS), a tile header, a slice header, a CTU, and a CU.

[0396] The current block (CU) can represent a quadtree, binary tree and / or ternary tree leaf node, and can perform intra-frame prediction and / or inter-frame prediction, primary / secondary transform and inverse transform, quantization, inverse quantization, entropy encoding / entropy decoding and / or in-loop filtering encoding / decoding in units of sub-block size, shape and / or depth.

[0397] The current block (CU) may represent a quadtree, a binary tree, and / or a ternary tree leaf node. At least one encoding / decoding process of intra / inter prediction, primary / secondary transform and inverse transform, quantization, inverse quantization, entropy encoding / decoding, and in-loop filtering encoding / decoding of the current block may be performed in units of subblock size, shape, and / or depth.

[0398] For example, when a current block (CU) is encoded, intra / inter prediction may be performed in units of sub-block size, shape, and depth, and the remaining processing except for intra / inter prediction (such as primary / secondary transform and inverse transform, quantization, inverse quantization, entropy encoding / entropy decoding, and in-loop filtering) may be performed in units of size, shape, and / or depth of the current block.

[0399] For another example, when the current block is divided into two subblocks (eg, a first subblock and a second subblock), the first subblock and the second subblock may derive different pieces of intra prediction information.

[0400] For yet another example, when the current block is divided into two sub-blocks (eg, a first sub-block and a second sub-block), the first sub-block and the second sub-block may derive different pieces of inter prediction information.

[0401] For yet another example, when the current block is divided into two sub-blocks (e.g., a first sub-block and a second sub-block), the first sub-block and the second sub-block may derive combined intra-frame and / or inter-frame prediction information. Here, the first sub-block may derive inter-frame prediction information, and the second sub-block may derive intra-frame prediction information. Alternatively, the first sub-block may derive intra-frame prediction information, and the second sub-block may derive inter-frame prediction information.

[0402] For yet another example, when encoding a current block (CU), primary / secondary transforms and inverse transforms may be performed in units of sub-block size, shape, and / or depth. In addition to primary / secondary transforms and inverse transforms, remaining processing (such as intra-frame and / or inter-frame prediction, quantization, inverse quantization, entropy encoding / decoding, and in-loop filtering) may be performed in units of size, shape, and / or depth of the current block.

[0403] For another example, when the current block is divided into two sub-blocks (e.g., a first sub-block and a second sub-block), the primary / secondary transform process and the inverse transform process of the first sub-block and / or the second sub-block may be skipped. Alternatively, different primary / secondary transform processes and inverse transform processes may be performed.

[0404] For another example, when the current block is divided into two sub-blocks (e.g., a first sub-block and a second sub-block), the secondary transform process and the inverse transform process of the first sub-block and / or the second sub-block may be skipped. Alternatively, different primary / secondary transform processes and different inverse transform processes may be performed.

[0405] For another example, when encoding a current block (CU), quantization and inverse quantization may be performed in units of sub-block size, shape, and / or depth. In addition to quantization and inverse quantization, the remaining processing (such as intra-frame and / or inter-frame prediction, primary / secondary transform and inverse transform, entropy encoding / decoding, and in-loop filtering) may be performed in units of the size, shape, and / or depth of the current block.

[0406] For yet another example, when the current block is divided into two sub-blocks (eg, a first sub-block and a second sub-block), quantization and inverse quantization processes of the first sub-block and / or the second sub-block may be skipped. Alternatively, different quantization and inverse quantization processes may be performed.

[0407] For another example, when the current block is divided into two sub-blocks (e.g., a first sub-block and a second sub-block), the first sub-block may be quantized according to a quantization parameter set in the first encoding, and the second sub-block may be encoded / decoded by using a quantization parameter different from the quantization parameter initially set. Here, according to a method set in the encoder / decoder, a quantization parameter and / or offset of a second sub-block different from the quantization parameter set in the first encoding may be explicitly transmitted or implicitly derived.

[0408] As another example, when the current block is divided into two sub-blocks (e.g., a first sub-block and a second sub-block), the second sub-block may be quantized according to a quantization parameter set in the first encoding, and the first sub-block may be encoded / decoded by using a quantization parameter different from the quantization parameter initially set. Here, according to a method set in the encoder / decoder, a quantization parameter and / or offset of the first sub-block different from the quantization parameter set in the first encoding may be explicitly transmitted or implicitly derived.

[0409] As another example, when encoding a current block (CU), entropy encoding / decoding may be performed in units of sub-block size, shape, and / or depth. In addition to entropy encoding / decoding, the remaining processing (such as intra-frame and / or inter-frame prediction, primary / secondary transform and inverse transform, quantization and inverse quantization, and in-loop filtering) may be performed in units of the size, shape, and / or depth of the current block.

[0410] For another example, when encoding a current block (CU), in-loop filtering may be performed in units of sub-block size, shape, and / or depth. In addition to in-loop filtering, the remaining processing (such as intra-frame and / or inter-frame prediction, primary / secondary transform and inverse transform, quantization, inverse quantization, and entropy encoding / decoding) may be performed in units of the size, shape, and / or depth of the current block.

[0411] For yet another example, when the current block is divided into two sub-blocks (eg, a first sub-block and a second sub-block), in-loop filtering of the first sub-block and / or the second sub-block may be skipped. Alternatively, different in-loop filtering processes may be performed.

[0412] When the current block is divided into at least one symmetric sub-block and / or an asymmetric sub-block, a flag indicating whether partitioning into sub-blocks is performed and / or index information about the sub-block partition type may be signaled by block (CU) units through the bitstream. For example, the index information about the asymmetric sub-block partition type may be signaled at at least one level of sequence, picture, sub-picture, slice, parallel block, CTU and CU. In addition, a flag indicating whether asymmetric sub-block partitioning is possible may be signaled at the sequence level. Optionally, the flag indicating whether asymmetric sub-block partitioning is possible may be variably derived based on the coding parameters of the current block. For example, the flag indicating whether asymmetric sub-block partitioning is possible may not be signaled through the bitstream, but may be implicitly derived based on the coding parameters of the current block (e.g., the size of the current block, the prediction mode of the current block, the slice type, and the flag indicating whether asymmetric sub-block partitioning is possible, etc.). Here, the flag may be signaled by using Fig.16 The subblock partition type may be defined by at least one of the asymmetric subblock partition types described in (a) to (k) of 16, and then encoding / decoding of the current block may be performed. Optionally, the subblock partition type may be predefined in the encoder / decoder and different from Fig.16 16 (a) to (k) of 16. At least one of the sub-blocks obtained by partitioning may have any block shape other than a square and / or a rectangle. In addition, the sub-block partition type may include information about a direction for partitioning the current block into sub-blocks, a sub-block shape, a shape relationship between the current block and the sub-block, and / or a shape relationship between the sub-blocks.

[0413] For example, when at least one of the types of 16 (a) to 16 (k) is used, a flag indicating whether to perform sub-block-based encoding and decoding and / or a sub-block partition index (or sub-block partition type) can be sent by a bitstream signal, or can be variably derived based on the encoding parameters of the current block. Here, when the index information is explicitly sent, at least one of a truncated Rice binarization method, a k-order exponential Columbus (exp_golomb) binarization method, a restricted k-order exp_golomb binarization method, a fixed length binarization method, a unary binarization method, and a truncated unary binarization method can be used. In addition, after binarization, CABAC (ae (v)) can be finally used to encode / decode the current block.

[0414] In addition, for example, when Fig.16When at least one of the two types of (a) to (b) of 16 is used, a flag indicating whether triangle sub-block partitioning is performed on the current block (CU) may be signaled.

[0415] The flag may be signaled in units of at least one of a video parameter set (VPS), a sequence parameter set (SPS), a picture parameter set (PPS), a tile header, a slice header, a CTU, and a CU. Also, in the case of a specific slice (e.g., a B slice), the flag may be signaled.

[0416] In addition, when triangle subblock partitioning is performed on a current block (CU), an index indicating at least one of a direction of partitioning the CU into triangle subblocks and motion information of the triangle subblocks may be signaled. The index may be variably derived based on encoding parameters of the current block.

[0417] In addition, when the flag indicates the first value, it may indicate that motion prediction / compensation based on the triangle sub-block is used to generate prediction samples of the current block (CU). In addition, at the same time, the index may be signaled only when the flag indicates the first value.

[0418] The index range may be 0 to M. M may be a positive integer greater than 0. For example, M may be 39.

[0419] In addition, the encoder / decoder may store a table or list for deriving directions for partitioning the current block into arbitrary sub-blocks and / or motion information of the sub-blocks from the indexes.

[0420] Table 1 is an example of a lookup table showing directions of partitioning a current block into triangular sub-blocks. Based on the above indexes, the directions of partitioning into triangular sub-blocks can be derived.

[0421] Table 1

[0422] merge_triangle_idx[xCb][yCb] 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 TriangleDir 0 1 1 0 0 1 1 1 0 0 0 0 1 0 0 0 0 1 1 1 merge_triangle_idx[xCb][yCb] 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 TriangleDir 1 0 0 1 1 1 1 1 1 1 0 0 1 0 1 0 0 1 0 0

[0423] Referring to Table 1, when TriangleDir has a first value of 0, it may indicate that the current block is partitioned into two triangular sub-blocks using a diagonal boundary from the upper left to the lower right. For example, it may indicate Fig.16 In addition, when TriangleDir has a second value of 1, it may indicate that the current block is partitioned into two triangular sub-blocks using a diagonal boundary from the upper right to the lower left. For example, it may indicate Fig.16 In addition, the first value and the second value may be interchanged with each other.

[0424] In addition, the index (merge_triangle_idx) indicating the partition direction of the subblock may be in the range of 0 to 39. The index may be signaled for the current block. The index information may be the same as the index information indicating the merge candidate to be used in each subblock described in Table 2 below.

[0425] In addition, for example, the current block may be divided into two sub-blocks by a straight line, and prediction samples of the current block may be generated by performing motion prediction / compensation on the sub-blocks. A flag indicating whether motion prediction / compensation based on the sub-blocks obtained by straight line partitioning is possible may be signaled.

[0426] The flag may be signaled in units of at least one of a video parameter set (VPS), a sequence parameter set (SPS), a picture parameter set (PPS), a tile header, a slice header, a CTU, and a CU. Also, in the case of a specific slice (e.g., a B slice), the flag may be signaled.

[0427] In addition, when the flag indicates the first value, information indicating whether motion prediction / compensation based on the sub-block obtained by the straight line partitioning is performed may be derived. In addition, information indicating whether motion prediction / compensation based on the sub-block obtained by the straight line partitioning is performed may be variably derived based on the encoding parameters of the current block. For example, information indicating whether motion prediction / compensation based on the sub-block obtained by the straight line partitioning is performed may be implicitly derived based on the encoding parameters of the current block (e.g., the size of the current block, the prediction mode of the current block, the slice type, etc.).

[0428] In addition, when subblock partitioning of the current block (CU) is performed using a straight line, an index indicating at least one of angle information and distance information of the straight line may be signaled. The index may be variably derived based on an encoding parameter of the current block.

[0429] Additionally, at the same time, the index may be signaled only when the flag indicates the first value.

[0430] The index range may be 0 to M. M may be a positive integer greater than 0. For example, M may be 63.

[0431] In addition, the encoder / decoder may store a table or list for deriving directions for partitioning the current block into arbitrary sub-blocks and / or motion information of the sub-blocks from the indexes.

[0432] In addition, at least one of the flag and the index entropy-encoded in the encoder and entropy-decoded in the decoder may use at least one of the following binarization methods.

[0433] Truncated Rice Binarization Method

[0434] k-order Exp_Golomb binarization method

[0435] Finite k-order Exp_Golomb binarization method

[0436] Fixed-length binarization method

[0437] Unary Binarization Method

[0438] Truncated Unary Binarization Method

[0439] Hereinafter, a method of deriving intra subblock and / or inter subblock prediction information will be described.

[0440] When the current block is divided into at least one symmetric and / or asymmetric sub-block, each sub-block obtained thereby can derive prediction information of the current block by using at least one of the following methods: deriving different pieces of intra-frame prediction information between sub-blocks, deriving different pieces of inter-frame prediction information between sub-blocks, and deriving combined intra-frame / inter-frame prediction information between sub-blocks.

[0441] The inter prediction information may represent motion information for motion prediction / compensation (e.g., at least one of a motion vector, an inter prediction indicator, a reference picture index, a picture order count, a skip flag, a merge flag, a merge index, an affine flag, an OBMC flag, a bidirectional matching and / or template matching flag, and a bidirectional optical flow (BIO) flag). In addition, the inter prediction information and the motion information may be defined to have the same meaning.

[0442] The intra prediction information may represent intra prediction mode information (eg, at least one of an MPM flag, an MPM index, a selected mode set flag, a selected mode index, and a remaining mode index) used to generate the intra prediction block.

[0443] The inter-frame and / or intra-frame prediction information may be explicitly sent from the encoder to the decoder via a bitstream, or the inter-frame and / or intra-frame prediction information may be variably derived based on the shape, size, and / or depth of the current block and / or sub-block. In addition, the inter-frame and / or intra-frame prediction information may be variably derived based on encoding parameters of the current block and / or sub-block, or the inter-frame and / or intra-frame prediction information may be signaled via a bitstream.

[0444] Hereinafter, a method of deriving inter prediction information between subblocks will be described.

[0445] When the current block is divided into at least one symmetric and / or asymmetric sub-block, each of the sub-blocks obtained thereby can derive different pieces of inter-frame prediction information. Here, each sub-block can derive inter-frame prediction information by using at least one inter-frame prediction method among skip mode, merge mode, AMVP mode, motion prediction / compensation using an affine transformation equation, motion prediction / compensation based on bidirectional matching, motion prediction / compensation based on template matching, and motion prediction / compensation based on OBMC.

[0446] When the current block is divided into two sub-blocks, the first sub-block (or sub-block A) and / or the second sub-block (or sub-block B) can derive different pieces of inter-frame prediction information. When deriving the inter-frame prediction information of the first sub-block, the motion information can be derived by using at least one inter-frame prediction method of the skip mode, merge mode, AMVP mode, motion prediction / compensation using an affine transformation equation, motion prediction / compensation based on bidirectional matching, motion prediction / compensation based on template matching, and motion prediction / compensation based on OBMC. In addition, when deriving the inter-frame prediction information of the second sub-block, the motion information can be derived by using at least one inter-frame prediction method of the skip mode, merge mode, AMVP mode, motion prediction / compensation using an affine transformation equation, motion prediction / compensation based on bidirectional matching, motion prediction / compensation based on template matching, and motion prediction / compensation based on OBMC.

[0447] When the current block is divided into two sub-blocks, each sub-block may derive motion information in a lowest level sub-block unit. Here, the lowest level sub-block may represent a minimum block unit having a predetermined value. For example, a 4×4 block size may be defined as a lowest level sub-block.

[0448] When the current block is divided into two sub-blocks, all sub-blocks can perform different motion prediction / compensation based on the skip mode according to the shape of each sub-block. Here, the current block can explicitly send two different motion information (e.g., at least one of the skip flag and / or merge index information and the picture order count).

[0449] When the current block is divided into two sub-blocks, all sub-blocks can perform different motion prediction / compensation based on the merge mode according to the shape of each sub-block. Here, the current block can explicitly send two different motion information (e.g., at least one of the merge flag and / or merge index information and the picture order count).

[0450] When the current block is divided into two sub-blocks, the first sub-block and / or the second sub-block may perform motion prediction / compensation based on different pieces of motion information based on a merge mode. Here, the current block may derive two different pieces of motion information based on different merge modes in each sub-block by configuring a single merge candidate list. For example, the current block may configure a merge candidate list including N merge candidates by using a spatial merge candidate, a temporal merge candidate, a combined merge candidate, and a zero merge candidate, and then derive motion information by using different merge candidates in each sub-block obtained by partitioning. N may represent a natural number greater than 0. When the merge candidate list is configured, if the corresponding merge candidate has bidirectional motion information, the merge candidate list may consist only of unidirectional prediction candidates to reduce memory bandwidth. For example, in bidirectional motion information, only L0 or L1 motion information may be added to the list. Alternatively, the average or weighted sum of L0 and L1 motion information may be added to the list. In addition, when different merge candidates are used in each sub-block, a predefined value may be used.

[0451] For example, when a different merge candidate is used for each sub-block, the Nth candidate in the merge candidate list may be used for the first sub-block (or sub-block A), and the Mth candidate in the merge candidate list may be used for the second sub-block (or sub-block B). N and M may be natural numbers including 0, and may be different from each other. In addition, N and M may be values ​​predefined in the encoder / decoder.

[0452] For another example, in order to use a different merge candidate for each subblock, a first merge index and a second merge index may be signaled for a first subblock and a second subblock, respectively.

[0453] For another example, when a different merge candidate is used for each sub-block, a merge candidate group (or a merge candidate group list or table) may be defined and used for the merge candidate (or index information of the merge candidate) corresponding to each sub-block. The merge candidate group may include a pair of merge candidates for each sub-block as an element. In addition, when the number of merge candidates configured with spatial merge candidates, temporal merge candidates, combined merge candidates, zero merge candidates, etc. is N, each merge candidate corresponding to each sub-block may have a value from 0 to N-1. Here, N is a natural number including 0.

[0454] Table 2 shows an example of a lookup table representing merge candidates used in each sub-block.

[0455] Table 2

[0456] merge_triangle_idx[xCb][yCb] 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 A 1 0 0 0 2 0 0 1 3 4 0 1 1 0 0 1 1 1 1 2 B 0 1 2 1 0 3 4 0 0 0 2 2 2 4 3 3 4 4 3 1 merge_triangle_idx[xCb][yCb] 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 A 2 2 4 3 3 3 4 3 2 4 4 2 4 3 4 3 2 2 4 3 B 0 1 3 0 2 4 0 1 3 1 1 3 2 2 3 1 4 4 2 4

[0457] Refer to Table 2, such as Fig.16As shown in (a) or (b) of 16, when the current block is divided into two triangular sub-blocks, A may represent the first sub-block (or sub-block A), and B may represent the second sub-block (or sub-block B). In addition, when the number of merge candidates configured with spatial merge candidates, temporal merge candidates, combined merge candidates, zero merge candidates, etc. is 5, A and B may have values ​​from 0 to 4, respectively.

[0458] In addition, the index (merge_triangle_idx) indicating the index information of the merge candidate mapped to each sub-block may range from 0 to M. M may be a positive integer greater than 0. For example, in Table 2, M may be 39. The index may be signaled for the current block. Accordingly, the motion information of the sub-block may be derived based on the index. In addition, the index information may be the same as the index information indicating the partition direction information of the sub-block described in Table 1.

[0459] In addition, the encoder / decoder may store a table or list for deriving directions for partitioning the current block into arbitrary sub-blocks and / or motion information of the sub-blocks from the indexes.

[0460] When the current block is divided into two sub-blocks, the first sub-block can perform motion prediction / compensation based on bidirectional matching, and the second sub-block can perform motion prediction / compensation based on template matching. Here, the motion information of each sub-block (e.g., at least one of a motion vector, an inter-frame prediction indicator, a reference picture index, and a POC) can be explicitly sent from the encoder, or can be implicitly derived in the encoder / decoder.

[0461] When the current block is divided into two sub-blocks, the first sub-block can perform motion prediction / compensation based on template matching, and the second sub-block can perform motion prediction / compensation based on bidirectional matching. Here, the motion information of each sub-block (e.g., at least one of a motion vector, an inter-frame prediction indicator, a reference picture index, and a POC) can be explicitly sent from the encoder, or can be implicitly derived in the encoder / decoder.

[0462] When the current block is divided into two sub-blocks, the first sub-block can perform motion prediction / compensation by using motion information of spatially adjacent blocks, and the second sub-block can derive inter-frame prediction information by using at least one inter-frame prediction method of skip mode, merge mode, AMVP mode, motion prediction / compensation using affine transformation equation, motion prediction / compensation based on bidirectional matching, motion prediction / compensation based on template matching, and OBMC-based motion prediction / compensation.

[0463] When the current block is divided into two sub-blocks, the second sub-block can perform motion prediction / compensation by using motion information of spatially adjacent blocks, and the first sub-block can derive inter-frame prediction information by using at least one inter-frame prediction method of skip mode, merge mode, AMVP mode, motion prediction / compensation using affine transformation equation, motion prediction / compensation based on bidirectional matching, motion prediction / compensation based on template matching, and motion prediction / compensation based on OBMC.

[0464] In addition, based on the inter-frame prediction information (i.e., motion information) of the first sub-block and the second sub-block derived by the above method, inter-frame prediction can be performed on each of the first sub-block and the second sub-block, so that prediction samples can be generated for each sub-block. In addition, the final prediction sample of the current block can be derived by the weighted sum of the prediction samples generated for the two sub-blocks.

[0465] In addition, the first subblock and / or the second subblock that performs motion prediction / compensation by using motion information of spatially neighboring blocks may induce motion information in a lowest level subblock unit having a predetermined size.

[0466] When the current block is divided into two sub-blocks, the motion information of the current block may be stored by using at least one of the motion information of the first sub-block, the motion information of the second sub-block, and the third motion information generated by the first sub-block and the second sub-block. The motion information may be stored in units of N×N size. In addition, the motion information may be stored in a motion information buffer of a temporally adjacent picture for temporal motion information prediction, and may be used to predict motion information of a spatially adjacent block. N may be a positive integer greater than 0, and may have at least one value of 2, 4, 8, 16, 32, 64, 128, and 256. For example, the motion information may be stored in 4×4 units.

[0467] For example, when the current block is divided into two sub-blocks, each sub-block may have unidirectional motion information. The area for storing the unidirectional motion information of the first sub-block may be defined as type 0 (sType=0), and the area for storing the unidirectional motion information of the second sub-block may be defined as type 1 (sType=1). Type 0 and type 1 may be defined opposite to each other. In addition, the area for storing the third motion information generated by the motion information of the first sub-block and the motion information of the second sub-block may be defined as type 2 (sType=2). Motion information corresponding to at least one of type 0, type 1, and type 2 may be stored in each N×N motion information storage unit. For example, as Figures 18 to 21 As shown, when the motion information storage unit is 4×4, the type can be derived per 4×4 size.

[0468] In addition, the motion information storage unit may be different according to the motion information of the first subblock, the motion information of the second subblock, or the third motion information. In addition, the motion information storage unit may be different according to type 0, type 1, or type 2.

[0469] As described below, the motion information type in each motion information storage unit may be derived based on at least one of the number of horizontal / vertical blocks, an aspect ratio, and partition direction information.

[0470] -minSb=min(numSbX,numSbY)-1

[0471] Here, numSbX is the number of N×N horizontal blocks, and numSbY is the number of N×N vertical blocks. For example, when the motion information storage unit is 4×4, numSbX and numSbY represent the number of 4×4 blocks in the horizontal direction and the vertical direction, respectively. Min() represents a function for calculating a minimum value.

[0472] -CbRatio=(cbWidth>cbHeight)? (cbWidth / cbHeight):(cbHeight / cbWidth)

[0473] Here, cbWidth represents the width of the current block, and cbHeight represents the height of the current block.

[0474] -(xSbIdx,ySbIdx)xSbIdx=0~numSbx-1,ySbIdx=0~numSby-1

[0475] Here, (xSbIdx, ySbIdx) represents the index of the N×N sub-block of the current block. For example, when the motion information storage unit is 4×4, (xSbIdx, ySbIdx) represents the index of each 4×4 sub-block.

[0476] For each N×N sub-block, the motion information type may be determined as follows.

[0477] xIdx=(cbWidth>cbHeight)? (xSbIdx / cbRatio):xSbIdx

[0478] yIdx=(cbWidth>cbHeight)? ySbIdx:(ySbIdx / cbRatio)

[0479] When the sub-block partition direction is from the upper left to the lower right (ie, when the partition direction information has the first value (0)),

[0480] sType=(xIdx=?yIdx)? 2:((xIdx>yIdx)?0:1)

[0481] When the sub-block partition is from the upper right to the lower left (ie, when the partition direction information has the second value (1)),

[0482] sType=(xIdx==yIdx)? 2:((xIdx>yIdx)?0:1)

[0483] When minSb is defined as min(numSbX, numSbY), the equation can be defined as follows.

[0484] sType=(xIdx+yIdx==minSb)? 2:((xIdx+yIdx <minSb)?0:1)

[0485] like Fig.16 (a) and Fig.16 As shown in (b), when the current block is diagonally divided into two sub-blocks, the area for storing the unidirectional motion information of the upper sub-block may be defined as type 0 (sType=0), and the area for storing the unidirectional motion information of the lower sub-block may be defined as type 1 (sType=1). In each motion information storage unit, motion information corresponding to at least one of type 1 and type 2 may be stored. For example, Figures 19 to 20 As shown, when the motion information storage unit is 4×4, the type can be derived per 4×4 size.

[0486] When the sub-block partition direction is from the upper left to the lower right (ie, when the partition direction information has the first value (0)),

[0487] sType=((xIdx>=yIdx)?0:1)

[0488] When the sub-block partition is from the upper right to the lower left (ie, when the partition direction information has the second value (1)), sType=((xIdx+yIdx <minSb)?0:1)

[0489] Here, minSb may be defined as min(numSbX, numSbY).

[0490] In addition, if Fig.16 (a) and Fig.16 As shown in (b), when the current block is divided into two sub-blocks by diagonal lines, the motion information can be stored by using only type 2 (sType=2) (i.e., the third motion information generated by the unidirectional motion information of the upper sub-block and the unidirectional motion information of the lower sub-block). Fig.21As shown, when the motion information storage unit is 4×4, only type 2 may be used for each 4×4 size.

[0491] In addition, if Fig.16 (a) and Fig.16 As shown in (b), when the current block is diagonally divided into two sub-blocks, the motion information of the current block may be stored in the N×N motion information storage unit by using only unidirectional motion information (sType=0) of the upper sub-block.

[0492] In addition, if Fig.16 (a) and Fig.16 As shown in (b), when the current block is diagonally divided into two sub-blocks, the motion information of the current block can be stored in the N×N motion information storage unit by using only unidirectional motion information (sType=1) of the lower sub-block.

[0493] like Fig.16 (a) and Fig.16 As shown in (b), when the current block is diagonally divided into two sub-blocks, only the unidirectional motion information of the upper sub-block or the unidirectional motion information of the lower sub-block may be stored in the N×N motion information storage unit based on the sub-block partition direction information.

[0494] For example, Fig.16 As shown in (a), when the current block is divided from the upper left to the lower right, the unidirectional motion information of the upper sub-block can be stored in the N×N motion information storage unit. On the contrary, the unidirectional motion information of the lower sub-block can be stored in the N×N motion information storage unit.

[0495] For example, Fig.16 As shown in (b), when the current block is divided from the upper right to the lower left, the unidirectional motion information of the lower sub-block can be stored in the N×N motion information storage unit. Conversely, the unidirectional motion information of the upper sub-block can be stored in the N×N motion information storage unit.

[0496] As described below, when the motion information type derived by the N×N motion information storage unit is type 2 (sType=2), the third motion information may be derived according to the direction of the reference picture (or the type of reference picture list) referenced by the unidirectional motion information of each subblock.

[0497] When the unidirectional motion information of the first subblock and the unidirectional motion information of the second subblock refer to reference pictures in different directions (for example, when the motion information of the first subblock refers to the L0 reference picture and the motion information of the second subblock refers to the L1 reference picture), the third motion information can be generated in the form of bidirectional motion information by combining the unidirectional motion information of the first subblock and the unidirectional motion information of the second subblock.

[0498] On the contrary, when the unidirectional motion information of the first subblock and the unidirectional motion information of the second subblock refer to the reference picture in the same direction (for example, when the motion information of the first subblock refers to the L0 reference picture and the motion information of the second subblock refers to the L0 reference picture), the third motion information may be set to any one of the motion information of the first subblock and the motion information of the second subblock.

[0499] In addition, as described below, when the motion information type is type 2 (sType=2), the third motion information may be derived according to the direction of the reference picture (or the type of the reference picture list) referenced by the unidirectional motion information of each subblock.

[0500] When the unidirectional motion information of the first subblock and the unidirectional motion information of the second subblock refer to reference pictures in different directions, the motion information of the first subblock may be used as the L0 motion information of the third motion information, and the motion information of the second subblock may be used as the L1 motion information of the third motion information. When the unidirectional motion information of the first subblock and the unidirectional motion information of the second subblock jointly refer to the L0 reference picture, the third motion information may be set as follows.

[0501] When the motion information of the first subblock is used as the L0 motion information and there is a reference picture having the same POC value as the L0 reference picture indicated by the motion information of the second subblock in the L1 reference picture, the motion vector of the second subblock may be used as the L1 motion vector, and the reference picture index of the L1 reference picture having the same POC value may be used as the L1 reference picture index.

[0502] - As described above, when there is no reference picture having the same POC value as the L0 reference picture indicated by the motion information of the second subblock in the L1 reference picture, the motion information of the second subblock may be used as the L0 motion information. In addition, when there is a reference picture having the same POC value as the L0 reference picture indicated by the motion information of the first subblock in the L1 reference picture, the motion vector of the first subblock may be used as the L1 motion vector, and the reference picture index of the L1 reference picture having the same POC value may be used as the L1 reference picture index.

[0503] -When no condition is satisfied, the motion information of the first subblock may be used as the L0 motion information, and the L1 motion information may be set to be unavailable. In other words, the L1 motion vector may be set to (0,0) for the horizontal direction and the vertical direction, and the L1 reference picture index may be set to a value of -1. For another example, the motion information of the second subblock may be used as the L0 motion information, and the L1 motion information may be set to be unavailable. In other words, the L1 motion vector may be set to (0,0) for the horizontal direction and the vertical direction, and the L1 reference picture index may be set to a value of -1.

[0504] -For yet another example, in the absence of a process for searching for a reference picture having the same POC value in the L1 direction, the L0 motion vector in the L0 motion information may be set to a value derived by using at least one of an average value, a minimum value, and a maximum value of motion vectors of the first subblock and the second subblock, and the L0 reference picture index may be set to a reference picture index of the first subblock or a reference picture index of the second subblock. The L1 motion vector may be set to (0,0) for the horizontal direction and the vertical direction, and the L1 reference picture index may be set to a value of -1.

[0505] -For yet another example, in the absence of a process for searching for a reference picture having the same POC value in the L1 direction, the motion information of the definition subblock as the first subblock or the second subblock may be set to the L0 motion information, the L1 motion vector may be set to (0,0) for the horizontal and vertical directions, and the L1 reference picture index may be set to a value of -1. For example, the motion information of the first subblock may be used as the L0 motion information. For example, the motion information of the second subblock may be used as the L0 motion information.

[0506] -For yet another example, in the absence of a process for searching for a reference picture having the same POC value in the L1 direction, the motion information of the subblock may be set to L0 motion information based on the subblock partition direction information which is the motion information of the first subblock or the motion information of the second subblock, the L1 motion vector may be set to (0,0) for the horizontal direction and the vertical direction, and the L1 reference picture index may be set to a value of -1. For example, when Fig.16 When the current block is divided from the upper left to the lower right as shown in (a) of FIG. 1 , the motion information of the upper sub-block may be set to L0 motion information. Fig.16 When the current block is divided from the upper right to the lower left as shown in (b) of FIG. 1 , the motion information of the lower sub-block can be set to L0 motion information. Fig.16 When the current block is divided from the upper left to the lower right as shown in (a) of FIG. 1 , the motion information of the lower sub-block may be set to L0 motion information. Fig.16 When the current block is divided from the upper right to the lower left as shown in (b), the motion information of the upper sub-block may be set to L0 motion information.

[0507] When the unidirectional motion information of the first subblock and the unidirectional motion information of the second subblock commonly refer to the L1 reference picture, the third motion information may be set as follows.

[0508] When the motion information of the first subblock is used as the L1 motion information and there is a reference picture having the same POC value as the L1 reference picture indicated by the motion information of the second subblock in the L0 reference picture, the motion vector of the second subblock may be used as the L0 motion vector, and the reference picture index of the L0 reference picture having the same POC value may be used as the L0 reference picture index.

[0509] - As described above, when there is no reference picture having the same POC value as the L1 reference picture indicated by the motion information of the second subblock in the L0 reference picture, the motion information of the second subblock may be used as the L1 motion information. In addition, when there is a reference picture having the same POC value as the L1 reference picture indicated by the motion information of the first subblock in the L0 reference picture, the motion vector of the first subblock may be used as the L0 motion vector, and the reference picture index of the L0 reference picture having the same POC value may be used as the L0 reference picture index.

[0510] -When no condition is satisfied, the motion information of the first subblock may be used as the L1 motion information, and the L0 motion information may be set to be unavailable. In other words, the L0 motion vector may be set to (0,0) for the horizontal direction and the vertical direction, and the L0 reference picture index may be set to a value of -1. For another example, the motion information of the second subblock may be used as the L1 motion information, and the L0 motion information may be set to be unavailable. In other words, the L0 motion vector may be set to (0,0) for the horizontal direction and the vertical direction, and the L0 reference picture index may be set to a value of -1.

[0511] -For yet another example, in the absence of a process for searching for a reference picture having the same POC value in the L0 direction, the L1 motion vector in the L1 motion information may be set to a value derived by using at least one of an average value, a minimum value, and a maximum value of motion vectors of the first subblock and the second subblock, and the L1 reference picture index may be set to a reference picture index of the first subblock or a reference picture index of the second subblock. The L0 motion vector may be set to (0,0) for the horizontal direction and the vertical direction, and the L0 reference picture index may be set to a value of -1.

[0512] -For yet another example, in the absence of a process for searching for a reference picture having the same POC value in the L0 direction, the motion information of the definition subblock as the first subblock or the second subblock may be set to the L1 motion information, the L0 motion vector may be set to (0,0) for the horizontal direction and the vertical direction, and the L0 reference picture index may be set to a value of -1. For example, the motion information of the first subblock may be used as the L1 motion information. For example, the motion information of the second subblock may be used as the L1 motion information.

[0513] -For yet another example, in the absence of a process for searching for a reference picture having the same POC value in the L0 direction, the motion information of the subblock may be set to L1 motion information based on the subblock partition direction information which is the motion information of the first subblock or the motion information of the second subblock, the L0 motion vector may be set to (0,0) for the horizontal direction and the vertical direction, and the L0 reference picture index may be set to a value of -1. For example, when Fig.16 When the current block is divided from the upper left to the lower right as shown in (a) of FIG. 1 , the motion information of the upper sub-block may be set to L1 motion information. Fig.16 When the current block is divided from the upper right to the lower left as shown in (b) of FIG. 1 , the motion information of the lower sub-block can be set to L1 motion information. Fig.16 When the current block is divided from the upper left to the lower right as shown in (a) of FIG. 1 , the motion information of the lower sub-block may be set to L1 motion information. Fig.16 When the current block is divided from the upper right to the lower left as shown in (b), the motion information of the upper sub-block may be set to L1 motion information.

[0514] Fig.17 is a diagram illustrating a method of deriving motion prediction information of a sub-block by using a lowest-level sub-block according to an embodiment of the present invention.

[0515] exist Fig.16 In (c), when the current block is divided into two asymmetric sub-blocks and the first sub-block performs motion prediction / compensation by using motion information of spatially adjacent blocks, refer to Fig.17 , the motion prediction / compensation of the first sub-block may be performed in units of the lowest-level sub-block of the first sub-block, and thus the motion information of the spatially adjacent lowest-level sub-block located to the left and / or above the lowest-level sub-block may be implicitly derived as the motion information of the first sub-block. Here, the size of the lowest-level sub-block may be 4×4. Here, the second sub-block may explicitly derive motion information by using the AMVP mode.

[0516] exist Fig.17 In the embodiment, the motion information of the upper left lowest level subblock among the lowest level subblocks of the first subblock may be derived by using at least one of the motion information of the upper left lowest level subblock adjacent in space, the motion information of the upper lowest level subblock adjacent in space, and the motion information of the upper left lowest level subblock adjacent in space. Here, the motion information of the upper left lowest level subblock may use the motion information of one lowest level subblock among the spatially adjacent left, upper, and upper left lowest level subblocks. Alternatively, the motion information may be derived based on at least one of an average value, a mode, and a weighted sum of up to three adjacent lowest level subblocks.

[0517] exist Fig.17 In the embodiment, the motion information of the lowest-level subblock of the first subblock may be derived by using at least one of a spatially adjacent left lowest-level subblock and / or a spatially adjacent upper lowest-level subblock.

[0518] exist Fig.17In the method, when there is no motion information in a spatially adjacent left lowest-level subblock or a spatially adjacent upper lowest-level subblock, or in both the spatially adjacent left lowest-level subblock and the spatially adjacent upper lowest-level subblock, the motion information of the lowest-level subblock of the first subblock can be derived in the lowest-level subblocks to the left and / or above of the spatially adjacent left lowest-level subblock and / or the spatially adjacent upper lowest-level subblock.

[0519] exist Fig.17 In the present invention, when there is no motion information in a spatially adjacent left lowest level sub-block or a spatially adjacent upper lowest level sub-block, or both a spatially adjacent left lowest level sub-block and a spatially adjacent upper lowest level sub-block, the motion information of the lowest level sub-block of the first sub-block can be replaced by the motion information derived by the AMVP mode in the second sub-block.

[0520] exist Fig.16 , when the current block is divided into two sub-blocks, the first sub-block may perform motion prediction / compensation by using at least one motion information of the merge candidate list, and the second sub-block may derive inter-frame prediction information by using at least one inter-frame prediction method among skip mode, merge mode, AMVP mode, motion prediction / compensation using an affine transformation equation, motion prediction / compensation based on bidirectional matching, motion prediction / compensation based on template matching, and motion prediction / compensation based on OBMC. Alternatively, the second sub-block may perform motion prediction / compensation by using at least one motion information of the merge candidate list, and the first sub-block may derive inter-frame prediction information by using at least one inter-frame prediction method among skip mode, merge mode, AMVP mode, motion prediction / compensation using an affine transformation equation, motion prediction / compensation based on bidirectional matching, motion prediction / compensation based on template matching, and motion prediction / compensation based on OBMC.

[0521] According to the above example, the first subblock and / or the second subblock that performs motion prediction / compensation by using at least one piece of motion information of the merge candidate list may induce motion information in a lowest level subblock unit having a predetermined size.

[0522] exist Fig.16 In (c), when the current block is divided into two asymmetric sub-blocks, the motion information of the first sub-block may be implicitly derived by using at least one piece of motion information of the merge candidate list.

[0523] For example, the first piece of motion information in the merge candidate list of the current block may be derived as the motion information of the first sub-block.

[0524] For another example, by using Fig. 9The motion information of the first sub-block is derived from at least one piece of motion information derived from A0, A1, B0, B1, B2, C3 and H.

[0525] For yet another example, the lowest level sub-block located to the left of the first sub-block can be obtained by using Fig. 9 In addition, the highest-level sub-block located above the first sub-block can be obtained by using at least one piece of motion information derived from A0, A1 and B2 in Fig. 9 The motion information is derived from at least one piece of motion information derived from B0, B1 and B2.

[0526] exist Fig.16 In the embodiment of the present invention, when the current block is divided into two sub-blocks, the first sub-block may perform motion prediction / compensation by using at least one motion information of a motion vector candidate list used in the AMVP mode, and the second sub-block may derive inter-frame prediction information by using at least one inter-frame prediction method among the skip mode, the merge mode, the AMVP mode, the motion prediction / compensation using an affine transformation equation, the motion prediction / compensation based on bidirectional matching, the motion prediction / compensation based on template matching, and the motion prediction / compensation based on OBMC. Alternatively, the second sub-block may perform motion prediction / compensation by using at least one motion information of a motion vector candidate list used in the AMVP mode, and the first sub-block may derive inter-frame prediction information by using at least one inter-frame prediction method among the skip mode, the merge mode, the AMVP mode, the motion prediction / compensation using an affine transformation equation, the motion prediction / compensation based on bidirectional matching, the motion prediction / compensation based on template matching, and the motion prediction / compensation based on OBMC.

[0527] According to the above example, the first subblock and / or the second subblock that performs motion prediction / compensation by using at least one piece of motion information of the motion vector candidate list used in the AMVP mode may derive motion information in a lowest level subblock unit having a predetermined size.

[0528] exist Fig.16 In (a), when the current block is divided into two asymmetric sub-blocks, the motion information of the first sub-block may be implicitly derived by using at least one piece of motion information of the motion vector candidate list used in the AMVP mode.

[0529] For example, the first piece of motion information of the motion vector candidate list used in the AMVP mode for the current block may be derived as the motion information of the first subblock.

[0530] For another example, the motion information of the first subblock may be derived by using a zero motion vector.

[0531] Hereinafter, a method of deriving intra prediction information between subblocks will be described.

[0532] When the current block is divided into at least one or more symmetric / asymmetric sub-blocks, each sub-block obtained thereby may derive different pieces of intra-frame prediction information between the sub-blocks. Here, the sub-blocks of the current block may derive different pieces of intra-frame prediction information in units of the lowest level sub-blocks. The lowest level sub-block may represent a minimum block unit having a predetermined size. A 4×4 block size may be defined as the size of the lowest level sub-block.

[0533] exist Fig.16 In the present invention, when the current block is divided into two subblocks, the first subblock (or subblock A) and / or the second subblock (or subblock B) may derive intra prediction information in a lowest level subblock unit having a predetermined size.

[0534] exist Fig.16 In (c), when the first subblock performs intra prediction by using intra prediction information of a spatially neighboring block, referring to Fig.17 , the motion prediction / compensation of the first subblock can be performed in units of the lowest level subblock of the first subblock, so the intra prediction information of the spatially adjacent lowest level subblock located on the left and / or above the lowest level subblock can be implicitly derived as the intra prediction information of the first subblock. Here, the size of the lowest level subblock can be 4×4. Here, the intra prediction information of the second subblock can be explicitly derived by using reference samples adjacent to the current block to minimize the distortion value of the second subblock.

[0535] For example, after generating a prediction block having the size of the current block by using reference samples adjacent to the current block, the distortion value can derive an intra-frame prediction mode in which the sum of absolute differences (SAD) and / or the sum of absolute transform differences (SATD) is minimized only in the actual second sub-block area as the intra-frame prediction mode of the second sub-block.

[0536] exist Fig.17 In the embodiment, the intra-frame prediction mode of the upper left lowest level subblock in the lowest level subblock of the first subblock can be derived by using the intra-frame prediction mode information of at least one of the spatially adjacent left, upper and upper left lowest level subblocks. Here, the intra-frame prediction mode information of one lowest level subblock in the spatially adjacent left, upper and upper left lowest level subblocks can be used as the intra-frame prediction mode information of the upper left lowest level subblock. Alternatively, the intra-frame prediction mode information of the current lowest level subblock can be derived by using at least one of the average value, mode, weighted sum of the intra-frame prediction modes of up to three lowest level neighboring subblocks.

[0537] exist Fig.17 In the embodiment, the intra prediction mode information of the lowest level subblock of the first subblock may be derived by using at least one of the spatially adjacent left and / or upper lowest level subblocks.

[0538] exist Fig.17 In the embodiment, when there is no intra prediction mode information in the spatially adjacent left and / or upper lowest level subblocks, the intra prediction mode information of the lowest level subblock of the first subblock may be derived in the lowest level subblock adjacent to the spatially adjacent left and / or upper lowest level subblocks. "Adjacent" may mean "left" and / or "above".

[0539] exist Fig.17 In the embodiment, when intra prediction mode information does not exist in the spatially adjacent left and / or upper lowest level subblocks, the intra prediction mode information of the lowest level subblock of the first subblock may be replaced with the intra prediction mode information derived in the second subblock.

[0540] When the intra prediction block is generated for the first subblock, after generating at least one intra prediction block in a lowest level subblock unit, a final prediction block may be generated by using a weighted sum of the prediction blocks.

[0541] For example, according to the above method, after generating a prediction block (pred_1) by using an intra prediction mode implicitly derived in a first subblock by a lowest-level subblock unit, a prediction block (pred_2) may be generated by applying an intra prediction mode derived in a second subblock to a lowest-level subblock of the first subblock. Thus, a prediction block of a lowest-level subblock of the first subblock may be generated by using a weighted and / or average value of pred_1 and / or pred_2.

[0542] Hereinafter, a method of deriving combined intra / inter prediction information between sub-blocks will be described.

[0543] When the current block is divided into at least one or more symmetric and / or asymmetric sub-blocks, each sub-block obtained thereby may derive different pieces of intra-frame and / or inter-frame prediction information between the sub-blocks. Here, the sub-blocks of the current block may derive different pieces of intra-frame and / or inter-frame prediction information according to the lowest level sub-block unit. The lowest level sub-block may represent a minimum block unit having a predetermined size. A 4×4 block size may be defined as the size of the lowest level sub-block.

[0544] exist Fig.16 In the embodiment of the present invention, when the current block is divided into two sub-blocks, the first sub-block may derive intra prediction information, and the second sub-block may derive inter prediction information.

[0545] exist Fig.16 In the embodiment of the present invention, when the current block is divided into two sub-blocks, the first sub-block may derive intra prediction information in a lowest level sub-block unit, and the second sub-block may derive inter prediction information.

[0546] exist Fig.16In the embodiment of the present invention, when the current block is divided into two subblocks, the first subblock may derive intra prediction information, and the second subblock may derive inter prediction information in a lowest level subblock unit.

[0547] exist Fig.16 In the embodiment, when the current block is divided into two sub-blocks, the first sub-block may derive intra prediction information in a lowest level sub-block unit, and the second sub-block may also derive inter prediction information in a lowest level sub-block unit.

[0548] exist Fig.16 In the embodiment of the present invention, when the current block is divided into two sub-blocks, the first sub-block may derive inter-frame prediction information, and the second sub-block may derive intra-frame prediction information.

[0549] exist Fig.16 In the present invention, when the current block is divided into two sub-blocks, the first sub-block may derive inter-frame prediction information in a lowest-level sub-block unit, and the second sub-block may derive intra-frame prediction information.

[0550] exist Fig.16 In the embodiment, when the current block is divided into two sub-blocks, the first sub-block may derive inter-prediction information, and the second sub-block may derive intra-prediction information in a lowest-level sub-block unit.

[0551] exist Fig.16 In the embodiment, when the current block is divided into two sub-blocks, the first sub-block may derive inter-frame prediction information in a lowest-level sub-block unit, and the second sub-block may also derive intra-frame prediction information in a lowest-level sub-block unit.

[0552] Fig. 22 is a flowchart illustrating a video decoding method according to an embodiment of the present invention.

[0553] Reference Fig. 22 , the decoder may obtain block partition information of the current block (S2201). Here, the block partition information may be index information indicating an index of a table including information indicating a plurality of predefined asymmetric partition shapes.

[0554] In addition, the decoder may partition the current block into a first sub-block and a second sub-block based on the block partition information ( S2202 ).

[0555] More specifically, the decoder may partition the current block into a first sub-block and a second sub-block by a straight line.

[0556] In addition, at least one of angle information and distance information of the straight line may be included in the information indicating the plurality of predefined asymmetric partition shapes.

[0557] In addition, the first sub-block and the second sub-block may have any one of a triangle, a rectangle, a trapezoid, and a pentagon.

[0558] In addition, when the horizontal length and the vertical length of the current block are respectively smaller than the predetermined threshold, step S2202 may not be performed.

[0559] In addition, the decoder may derive motion information of the first subblock and motion information of the second subblock, respectively ( S2203 ).

[0560] More specifically, the decoder can obtain the merge index of the first sub-block and the merge index of the second sub-block respectively, and generate a merge candidate list. In addition, the decoder can derive the motion information of the first sub-block by using the merge candidate list and the merge index of the first sub-block, and derive the motion information of the second sub-block by using the merge candidate list and the merge index of the second sub-block.

[0561] In addition, a merge candidate list may be generated based on the current block.

[0562] In addition, the decoder may generate prediction samples of the first subblock and the second subblock based on the motion information of the first subblock and the motion information of the second subblock, respectively ( S2204 ).

[0563] In addition, the decoder may generate the prediction samples of the current block by a weighted sum of the prediction samples of the first sub-block and the prediction samples of the second sub-block ( S2205 ).

[0564] In addition, the decoder may store at least one of the motion information of the first sub-block, the motion information of the second sub-block, and the third motion information. Here, when the motion information of the first sub-block and the motion information of the second sub-block refer to the reference picture in the same direction, the third motion information may be derived as any one of the motion information of the first sub-block and the motion information of the second sub-block.

[0565] Fig.23 is a flowchart illustrating a video encoding method according to an embodiment of the present invention.

[0566] Reference Fig.23 , the encoder may determine a block partition structure of a current block (S2301).

[0567] In addition, the encoder may partition the current block into a first sub-block and a second sub-block based on the block partition structure ( S2302 ).

[0568] More specifically, the encoder may partition the current block into a first sub-block and a second sub-block by a straight line.

[0569] In addition, at least one of angle information and distance information of the straight line may be included in the information indicating the plurality of predefined asymmetric partition shapes.

[0570] In addition, the first sub-block and the second sub-block may have any one of a triangle, a rectangle, a trapezoid, and a pentagon.

[0571] In addition, when the horizontal length and the vertical length of the current block are respectively smaller than the predetermined threshold, step S2302 may not be performed.

[0572] In addition, the encoder may derive motion information of the first subblock and motion information of the second subblock, respectively ( S2303 ).

[0573] In addition, the encoder may encode block partition information based on the block partition structure (S2304).

[0574] Here, the block partition information may be index information indicating an index of a table including information indicating a plurality of predefined asymmetric partition shapes.

[0575] In addition, the encoder may encode a merge index of the first subblock and a merge index of the second subblock based on the motion information of the first subblock and the motion information of the second subblock, respectively ( S2305 ).

[0576] More specifically, the encoder may generate a merge candidate list. In addition, the encoder may encode a merge index of the first subblock by using the merge candidate list and the motion information of the first subblock, and encode a merge index of the second subblock by using the merge candidate list and the motion information of the second subblock.

[0577] Here, a merge candidate list may be generated based on the current block.

[0578] In addition, the encoder may store at least one of the motion information of the first subblock, the motion information of the second subblock, and the third motion information. Here, when the motion information of the first subblock and the motion information of the second subblock refer to a reference picture in the same direction, the third motion information may be derived as any one of the motion information of the first subblock and the motion information of the second subblock.

[0579] The computer-readable non-transitory recording medium according to the present invention may store Fig.23 The bitstream produced by the video encoding method described in .

[0580] The above embodiments may be performed in the same way in an encoder and a decoder.

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

[0582] The order applied to the above embodiments may be different between the encoder and the decoder, or the order applied to the above embodiments may be the same in the encoder and the decoder.

[0583] The above embodiments may be performed on each of the luminance signal and the chrominance signal, or may be performed identically on the luminance and chrominance signals.

[0584] The block shape to which the above embodiments of the present invention are applied may have a square shape or a non-square shape.

[0585] At least one of the syntax elements (flags, indices, etc.) entropy-encoded in the encoder and entropy-decoded in the decoder may use at least one of the following binarization, de-valued, entropy encoding / entropy decoding methods.

[0586] Truncated Rice Binarization

[0587] k-order Exp_Golomb binarization

[0588] Finite k-order Exp_Golomb binarization

[0589] Fixed-length binarization

[0590] Binarization

[0591] Truncated unary binarization

[0592] Truncated Binary Binarization

[0593] The above embodiments of the present invention may be applied according to the size of at least one of a coding block, a prediction block, a transform block, a block, a current block, a coding unit, a prediction unit, a transform unit, a unit, and a current unit. Here, the size may be defined as a minimum size or a maximum size or both a minimum size and a maximum size, so that the above embodiments are applied, or may be defined as a fixed size to which the above embodiments are applied. In addition, in the above embodiments, the first embodiment may be applied to a first size, and the second embodiment may be applied to a second size. In other words, the above embodiments may be applied according to size combinations. In addition, the above embodiments may be applied when the size is equal to or greater than the minimum size and equal to or less than the maximum size. In other words, the above embodiments may be applied when the block size is included in a specific range.

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

[0595] The above embodiments of the present invention may be applied in accordance with time layers. In order to identify the time layers to which the above embodiments may be applied, a corresponding identifier may be signaled, and the above embodiments may be applied to the specified time layers identified by the corresponding identifiers. Here, the identifier may be defined as the lowest layer or the highest layer or both the lowest layer and the highest layer to which the above embodiments may be applied, or may be defined as a specific layer indicating the application of the embodiments. In addition, a fixed time layer to which the embodiments may be applied may be defined.

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

[0597] A slice type or a tile group type to which the above embodiments of the present invention are applied may be defined, and the above embodiments may be applied depending on the corresponding slice type or tile group type.

[0598] 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 can 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 can be added to the flowchart, or some steps can be deleted from the flowchart without affecting the scope of the present invention.

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

[0600] The embodiments of the present invention can be implemented in the form of program instructions that can be executed by various computer components and recorded in a computer-readable recording medium. The computer-readable recording medium may include independent program instructions, data files, data structures, etc. or a combination of program instructions, data files, data structures, etc. The program instructions recorded in the computer-readable recording medium may be specially designed and constructed for the present invention, or known to a person of ordinary skill in the field of computer software technology. Examples of computer-readable recording media include: magnetic recording media (such as hard disks, floppy disks, and tapes); optical data storage media (such as CD-ROMs or DVD-ROMs); magnetically optimized media (such as optical floppy disks); and hardware devices (such as read-only memory (ROM), random access memory (RAM), flash memory, etc.) that are specially constructed to store and implement program instructions. Examples of program instructions include not only machine language codes formatted by a compiler, but also high-level language codes that can be implemented by a computer using an interpreter. The hardware device may be configured to be operated by one or more software modules to perform processing according to the present invention, or vice versa.

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

[0602] Therefore, the spirit of the present invention should not be limited to the above-described embodiments, and the full scope of the appended claims and their equivalents will fall within the scope and spirit of the present invention.

[0603] Industrial Applicability

[0604] The present invention can be used to encode or decode images.

Claims

1. A video decoding method, the method comprising: Get the block partition information of the current block; Derived first motion information of a first subblock of the current block and second motion information of a second subblock of the current block respectively; Generate a first prediction sample of the first sub-block and a second prediction sample of the second sub-block based on the first motion information and the second motion information respectively; Generating a prediction sample of the current block by a weighted sum of the first prediction sample and the second prediction sample; as well as Based on the value of sType, third motion information obtained using the first motion information of the first sub-block and the second motion information of the second sub-block is stored, wherein the block partition information is index information indicating an index of a table, wherein the table includes information indicating a plurality of predefined asymmetric partition shapes of the first sub-block and the second sub-block, and In which, in response to the value of sType being 2 and the first motion information and the second motion information jointly refer to the L1 reference picture in the same direction, in the absence of a process for searching for a reference picture having the same POC value in the L0 direction, the L1 motion information of the third motion information is set to be the same as the first motion information of the first sub-block or the second motion information of the second sub-block, the L0 motion vector of the L0 motion information of the third motion information is set to 0 for the horizontal and vertical directions, and the L0 reference picture index of the L0 motion information is set to a value of -1.

2. The video decoding method according to claim 1, in, The steps of respectively deriving first motion information of the first sub-block and second motion information of the second sub-block include: Obtain a first merge index of the first sub-block and a second merge index of the second sub-block respectively; Generate a merge candidate list; deriving first motion information of a first subblock by using the merge candidate list and a first merge index; and Second motion information of the second subblock is derived by using the merge candidate list and the second merge index.

3. The video decoding method according to claim 2, in, The merge candidate list is generated based on the current block.

4. The video decoding method according to claim 1, in, The block partition information indicates partition lines of a first sub-block and a second sub-block.

5. The video decoding method according to claim 4, in, The information indicating the plurality of predefined asymmetric partition shapes includes at least one of angle information and distance information of the partition lines.

6. The video decoding method according to claim 1, in, The asymmetric partition shape is any one of a triangle, a rectangle, a trapezoid and a pentagon.

7. A video encoding method, the method comprising: Determine the block partition structure of the current block; Derived first motion information of a first subblock of the current block and second motion information of a second subblock of the current block respectively; encoding block partition information based on the block partition structure; Encode a first merge index of the first sub-block and a second merge index of the second sub-block based on the first motion information and the second motion information, respectively; as well as Based on the value of sType, third motion information obtained using the first motion information of the first sub-block and the second motion information of the second sub-block is stored, wherein the block partition information is index information indicating an index of a table, wherein the table includes information indicating a plurality of predefined asymmetric partition shapes of the first sub-block and the second sub-block, and In which, in response to the value of sType being 2 and the first motion information and the second motion information jointly refer to the L1 reference picture, in the absence of a process for searching for a reference picture having the same POC value in the L0 direction, the L1 motion information of the third motion information is set to be the same as the first motion information of the first sub-block or the second motion information of the second sub-block, the L0 motion vector of the L0 motion information of the third motion information is set to 0 for the horizontal and vertical directions, and the L0 reference picture index of the L0 motion information is set to a value of -1.

8. The video encoding method according to claim 7, in, The steps of respectively encoding the first merge index and the second merge index include: Generate a merge candidate list; encoding a first merge index by using the merge candidate list and the first motion information; and A second merge index is encoded by using the merge candidate list and the second motion information.

9. The video encoding method according to claim 8, in, The merge candidate list is generated based on the current block.

10. The video encoding method according to claim 7, in, The block partition information indicates partition lines of a first sub-block and a second sub-block.

11. The video encoding method according to claim 10, in, The information indicating the plurality of predefined asymmetric partition shapes includes at least one of angle information and distance information of the partition lines.

12. The video encoding method according to claim 7, in, The asymmetric partition shape is any one of a triangle, a rectangle, a trapezoid and a pentagon.

13. A non-transitory computer-readable recording medium for storing a bit stream generated by a video encoding method, in, The video encoding method comprises: Determine the block partition structure of the current block; Derived first motion information of a first subblock of the current block and second motion information of a second subblock of the current block respectively; encoding block partition information based on the block partition structure; Encode a first merge index of the first sub-block and a second merge index of the second sub-block based on the first motion information and the second motion information, respectively; and Based on the value of sType, third motion information obtained using the first motion information of the first sub-block and the second motion information of the second sub-block is stored, wherein the block partition information is index information indicating an index of a table, wherein the table includes information indicating a plurality of predefined asymmetric partition shapes of the first sub-block and the second sub-block, and In which, in response to the value of sType being 2 and the first motion information and the second motion information jointly refer to the L1 reference picture, in the absence of a process for searching for a reference picture having the same POC value in the L0 direction, the L1 motion information of the third motion information is set to be the same as the first motion information of the first sub-block or the second motion information of the second sub-block, the L0 motion vector of the L0 motion information of the third motion information is set to 0 for the horizontal and vertical directions, and the L0 reference picture index of the L0 motion information is set to a value of -1.

Citation Information

Patent Citations

  • KR20190046704A