Image encoding / decoding method and device, and recording medium storing bit stream

By adopting flexible block partitioning strategies in image encoding/decoding, the problem of limited encoding efficiency in traditional technologies is solved, and more efficient image data compression and storage is achieved.

CN119031128APending Publication Date: 2024-11-26INTELLECTUAL DISCOVERY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411437318.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2018-06-27
Filing Date
2019-06-27
Publication Date
2024-11-26

AI Technical Summary

Technical Problem

The prior art has limited the cost of improving encoding efficiency in traditional video encoding/decoding due to the use of only quad-tree block structures, especially in the compression and storage of high-resolution and high-quality images.

Method used

Using the image encoding/decoding method based on the block structure, the current block is partitioned by selecting the appropriate partition scheme (quad-tree, horizontal binary tree, vertical binary tree, horizontal triple tree, vertical triple tree) and determining the partition scheme according to the boundary situation of the block , to improve compression efficiency.

Benefits of technology

Improve the compression efficiency of image encoding/decoding, and adapt to different block shapes and boundary conditions through flexible partitioning strategies, reducing storage and transmission costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119031128A_ABST
    Figure CN119031128A_ABST
Patent Text Reader

Abstract

In the present specification, an image encoding / decoding method and apparatus, and a recording medium storing a bitstream are disclosed. An image decoding method of the present invention comprises: decoding block partition information of a current block included in a current picture; determining a partitioning scheme of the current block according to the block partitioning information; and partitioning the current block using the determined partitioning scheme, in which the partitioning scheme is determined according to whether the current block includes a boundary of the current picture.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of a patent application with an application date of June 27, 2019, application number 201980043248.7, and invention name “Image encoding / decoding method and device and recording medium for storing bit stream”. Technical Field

[0002] The present invention relates to an image encoding / decoding method and device and a recording medium storing a bit stream. More specifically, the present invention relates to an image encoding / decoding method and device based on a block structure and a recording medium storing a bit stream. Background Art

[0003] Recently, in various application fields, the demand for high-resolution and high-quality images, such as high-definition (HD) images and ultra-high-definition (UHD) images, has increased. However, compared with conventional image data, higher-resolution and higher-quality image data has an increased amount of data. Therefore, when image data is transmitted by using a medium such as conventional wired and wireless broadband networks, or when image data is stored by using conventional storage media, the cost of transmission and storage increases. In order to solve these problems arising as the resolution and quality of image data increase, efficient image encoding / decoding technology is required for higher-resolution and higher-quality images.

[0004] The image compression technology includes various technologies, including: inter-frame prediction technology, which predicts the pixel value included in the current picture from the previous picture or the subsequent picture of the current picture; intra-frame prediction technology, which predicts the pixel value included in the current picture by using the pixel information in the current picture; transformation and quantization technology, which is used to compress the energy of the residual signal; entropy coding technology, which assigns short codes to values ​​with high occurrence frequency and assigns long codes to values ​​with low occurrence frequency, etc. Image data can be effectively compressed by using such image compression technology, and can be transmitted or stored.

[0005] In conventional video encoding / decoding, since only a quadtree block structure is used, there is a problem that there is a limitation in improving encoding efficiency. Summary of the invention

[0006] Technical issues An object of the present invention is to provide an image encoding / decoding method and apparatus capable of improving compression efficiency, and to provide a recording medium storing a bit stream generated by the method or apparatus.

[0007] Another object of the present invention is to provide an image encoding / decoding method and apparatus capable of improving compression efficiency by using block shapes having various aspect ratios (i.e., the ratio of horizontal to vertical), and to provide a recording medium storing a bit stream generated by the method or apparatus.

[0008] Another object of the present invention is to provide an image encoding / decoding method and device capable of improving compression efficiency by determining whether to use an adjacent block as a reference block of a current block based on encoding parameters of a current block and encoding parameters of an adjacent block, and to provide a recording medium for storing a bit stream generated by the method or device.

[0009] Technical Solution According to the present invention, an image decoding method includes: decoding block partition information of a current block included in a current picture; determining a partition scheme of the current block according to the block partition information; and partitioning the current block using the determined partition scheme, wherein the partition scheme is determined according to whether the current block includes a boundary of the current picture.

[0010] In the image decoding method, the partitioning scheme is any one selected from quadtree partitioning, horizontal binary tree partitioning, vertical binary tree partitioning, horizontal ternary tree partitioning and vertical ternary tree partitioning.

[0011] In the image decoding method, when the current block includes a right boundary of the current picture, the partitioning scheme is determined to be a vertical binary tree partitioning.

[0012] In the image decoding method, when the height of the current block exceeds the size of the maximum transform block in the current block, the partition scheme is determined to be any partition scheme except the vertical binary tree partition.

[0013] In the image decoding method, the size of the maximum transform block is a predefined value.

[0014] In the image decoding method, when the current block includes a lower boundary of the current picture, the partitioning scheme is determined to be a horizontal binary tree partitioning.

[0015] In the image decoding method, when the width of the current block exceeds the size of the maximum transform block in the current picture, the partition scheme is determined to be any partition scheme except the horizontal binary tree partition.

[0016] In the image decoding method, the size of the maximum transform block is a preset value.

[0017] In the image decoding method, when the current block includes at least a right boundary or an upper boundary of the current picture, the block partitioning scheme is determined to be any one scheme except the ternary tree partitioning scheme.

[0018] In the image decoding method, when the current block includes a right boundary and a lower boundary of the current picture, the partitioning scheme is determined to be quadtree partitioning.

[0019] According to the present invention, an image encoding method includes: determining a partition scheme of a current block included in a current picture; partitioning the current block using the determined partition scheme; and encoding block partition information of the current block, wherein the partition scheme is determined according to whether the current block includes a boundary of the current picture.

[0020] In the image encoding method, the partitioning scheme is any one selected from quadtree partitioning, horizontal binary tree partitioning, vertical binary tree partitioning, horizontal ternary tree partitioning and vertical ternary tree partitioning.

[0021] In the image encoding method, when the current block includes a right boundary of the current picture, the partition scheme is determined to be a vertical binary tree partition.

[0022] In the image encoding method, when the height of the current block exceeds the size of the maximum transform block in the current picture, the partitioning scheme is determined to be any one scheme except the vertical binary tree partitioning.

[0023] In the image encoding method, the size of the maximum transform block is a predefined value.

[0024] In the video encoding method, when the current block includes a lower boundary of the current picture, the partitioning scheme is determined to be a horizontal binary tree partitioning.

[0025] In the image encoding method, when the width of the current block exceeds the size of the maximum transform block in the current picture, the partitioning scheme is determined to be any one of the schemes except the horizontal binary tree partitioning.

[0026] In the image encoding method, the size of the maximum transform block is a preset value.

[0027] In the image encoding method, when the current block includes at least a right boundary or an upper boundary of the current picture, the partitioning scheme is determined to be any one scheme except the ternary tree partitioning.

[0028] In the image encoding method, when the current block includes a right boundary and a lower boundary of the current picture, the partitioning scheme is determined to be quadtree partitioning.

[0029] According to the present invention, there is provided a computer-readable recording medium storing a bit stream received by an image decoding device to reconstruct a current block, wherein the bit stream contains block partition information of the current block, the block partition information is used to determine a partition scheme of the current block, the partition scheme determined as the partition scheme of the current block is used to partition the current block, and the partition scheme is determined according to whether the current block includes a boundary of a current picture.

[0030] Beneficial Effects According to the present invention, an image encoding / decoding method and apparatus capable of improving compression efficiency can be provided, and a recording medium storing a bit stream generated by the method or apparatus can be provided.

[0031] In addition, according to the present invention, it is possible to provide an image encoding / decoding method and apparatus capable of improving compression efficiency by using block shapes having various aspect ratios, and to provide a recording medium storing a bit stream generated by the method or apparatus.

[0032] In addition, according to the present invention, an image encoding / decoding method and device can be provided that can improve compression efficiency by determining whether to use a neighboring block as a reference block of a current block based on encoding parameters of a current block and encoding parameters of a neighboring block, and a recording medium for storing a bit stream generated by the method or device can be provided. BRIEF DESCRIPTION OF THE DRAWINGS

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

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

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

[0036] Figure 4 is a diagram illustrating an example of intra prediction.

[0037] Figure 5 is a diagram illustrating an example of inter-frame prediction.

[0038] Figure 6 is a diagram illustrating an example of transformation and quantization.

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

[0040] Figures 8a to 8c is a flowchart illustrating an image encoding / decoding method according to an embodiment of the present invention; Fig. 9 and Fig.10 is a diagram illustrating a method of inserting a neighboring block adjacent to a current block into a candidate list according to an embodiment of the present invention; Fig.11 and Fig.12 is a diagram illustrating a method of inserting a neighboring block adjacent to a current block into a candidate list according to the length of a boundary between the current block and the neighboring block according to an embodiment of the present invention; Fig.13 and Fig.14 is a diagram illustrating a method for inserting neighboring blocks adjacent to a current block into a candidate list according to sizes of the neighboring blocks according to an embodiment of the present invention; Fig.15 and Fig.16 is a diagram illustrating a method for inserting neighboring blocks adjacent to a current block into a candidate list according to the depth of the neighboring blocks according to one embodiment of the present invention; Fig.17 and Fig.18 is a diagram illustrating a method of inserting neighboring blocks adjacent to a current block into a candidate list according to a partition tree type of the neighboring blocks according to an embodiment of the present invention; Fig.19 and Fig. 20 is a diagram illustrating a method for inserting neighboring blocks adjacent to a current block into a candidate list according to a block form of the neighboring blocks according to an embodiment of the present invention; Fig.21 is a diagram illustrating a method of inserting neighboring blocks into a candidate list in the order in which the neighboring blocks are encoded / decoded according to an embodiment of the present invention; Fig. 22 is a diagram illustrating a method of inserting a neighboring block into a candidate list according to the position of a neighboring block spaced a certain distance from the position of a current block according to an embodiment of the present invention; Fig.23 is a diagram illustrating a method of inserting a neighboring block into a candidate list according to a position of a neighboring block spaced apart from a position of at least one selected from a current picture, a sub-picture, a slice, a tile, and a partition by a specific distance according to an embodiment of the present invention; Fig.24 is a diagram illustrating boundaries of pictures, sub-pictures, slices, tiles, and blocks according to an embodiment of the present invention; Fig.25 is a diagram illustrating a block partitioning scheme according to an embodiment of the present invention. DETAILED DESCRIPTION

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

[0042] The terms "first", "second", etc. used in the specification may be used to describe various components, but the components should not be interpreted as being limited to these terms. These terms are only used to distinguish one component from other components. For example, without departing from the scope of the present invention, a "first" component may be named a "second" component, and a "second" component may also be similarly named a "first" component. The term "and / or" includes a combination of multiple items or any one of the multiple items.

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

[0044] 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 divided into multiple components to perform each function. If it does not depart from the essence of the present invention, the embodiment in which each component is combined and the embodiment in which a component is divided are also included in the scope of the present invention.

[0045] The terms used in this specification are only used to describe specific embodiments and are not intended to limit the present invention. Unless there is a significantly different meaning in the context, the expression used in the singular includes the expression in the plural form. In this specification, it will be understood that terms such as "including", "having" etc. are intended to indicate the presence of features, numbers, steps, actions, elements, parts or combinations thereof disclosed in the specification, and are not intended to exclude the possibility that one or more other features, numbers, steps, actions, elements, parts or combinations thereof may exist or may be added. In other words, when a particular element is referred to as "included", it does not exclude elements other than the corresponding elements, but may include other elements in embodiments of the present invention or in the scope of the present invention.

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

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

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

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

[0050] Hereinafter, a target image may be an encoding target image as an encoding target and / or a decoding target image as a decoding target. In addition, a target image may be an input image input to an encoding device, and an input image input to a decoding device. Here, the target image may have the same meaning as the current image.

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

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

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

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

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

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

[0057] When the variable i or j is used to represent a column, row, or index, the value of i may be an integer equal to or greater than 0, or an integer equal to or greater than 1. That is, the column, row, index, etc. may be counted from 0, or may be counted from 1.

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

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

[0060] 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 form. A block may refer to a unit. A current block may represent an encoding target block that becomes a target when encoding, or a decoding target block that becomes a target when 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.

[0061] Sample: It is the basic unit of a block. According to the bit depth (Bd), a sample can be represented as a number from 0 to 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.

[0062] Unit: may refer to a coding and decoding unit. When encoding and decoding an image, a unit may be a region generated by partitioning a single image. In addition, when a single image is partitioned into sub-division units during encoding or decoding, a unit may represent a sub-division unit. That is, an image may be partitioned into a plurality of units. When encoding and decoding an image, a predetermined process for each unit may be performed. A single unit may be partitioned into sub-units having a size smaller than that of the unit. 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.

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

[0064] When the size of the coding block is within a predetermined range, it can be divided using only quadtree partitioning. Here, the predetermined range may be defined as at least one of the maximum size and the minimum size of the coding block that can be divided using only quadtree partitioning. Information indicating the maximum / minimum size of the coding block that allows quadtree partitioning may be signaled through a bitstream, and the information may be signaled in at least one unit of a sequence, a picture parameter, a parallel block group, or a slice (fragment). Optionally, the maximum / minimum size of the coding block may be a fixed size predetermined in the encoder / decoder. For example, when the size of the coding block corresponds to 256×256 to 64×64, it is possible to divide using only quadtree partitioning. Optionally, when the size of the coding block is larger than the size of the maximum conversion block, it is possible to divide using only quadtree partitioning. Here, the block to be divided may be at least one of a coding block and a transform block. In this case, information indicating the division of the coding block (e.g., split_flag) may be a flag indicating whether quadtree partitioning is performed. When the size of the coding block falls within a predetermined range, it is possible to divide using only binary or ternary tree partitioning. In this case, the above description of the quadtree partition can be applied to the binary tree partition or the ternary tree partition in the same manner.

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

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

[0067] Reconstructed neighboring block: may represent a neighboring block that is adjacent to the current block and has been encoded or decoded in space / time. Here, the reconstructed neighboring block may represent a reconstructed neighboring unit. The reconstructed spatial neighboring block may be a block that is within the current picture and has been reconstructed by encoding or decoding or both encoding and decoding. The reconstructed temporal neighboring block is a block at a position corresponding to the current block of the current picture within the reference image or a neighboring block of the block.

[0068] Unit depth: can represent the degree of partitioning of a unit. In a tree structure, the highest node (root node) can correspond to the first unit that is not partitioned. In addition, the highest node can have a minimum depth value. In this case, the depth of the highest node can be level 0. A node with a depth of level 1 can represent a unit generated by partitioning the first unit once. A node with a depth of level 2 can represent a unit generated by partitioning the first unit twice. A node with a depth of level n can represent a unit generated by partitioning the first unit n times. A leaf node can be the lowest node and a node that cannot be further partitioned. The depth of a leaf node can be the maximum level. For example, the predefined value of the maximum level can be 3. The depth of the root node can be the lowest, and the depth of the leaf node can be the deepest. In addition, when a unit is represented as a tree structure, the level at which the unit exists can represent the unit depth.

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

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

[0071] An adaptive parameter set refers to a parameter set that can be shared and referenced by different pictures, sub-pictures, slices, tile groups, tiles, or partitions. In addition, a sub-picture, slice, tile group, tile, or partition in a picture can refer to different adaptive parameter sets to use information in different adaptive parameter sets.

[0072] Regarding the adaptation parameter sets, a sub-picture, a slice, a tile group, a tile, or a partition in a picture may refer to different adaptation parameter sets by using identifiers of the corresponding adaptation parameter sets.

[0073] Regarding the adaptation parameter sets, a slice, a tile group, a tile, or a partition in a sub-picture may refer to different adaptation parameter sets by using identifiers of the corresponding adaptation parameter sets.

[0074] Regarding the adaptation parameter sets, a tile or partition in a slice can refer to different adaptation parameter sets by using identifiers of the corresponding adaptation parameter sets.

[0075] Regarding the adaptation parameter sets, the partitions in a parallel block can refer to different adaptation parameter sets by using the identifiers of the corresponding adaptation parameter sets.

[0076] The parameter set or header of the sub-picture may include information about the adaptation parameter set identifier. Therefore, the adaptation parameter set corresponding to the adaptation parameter set identifier may be used in the sub-picture.

[0077] The parameter set or header of the tile may include an adaptation parameter set identifier so that an adaptation parameter set corresponding to the adaptation parameter set identifier may be used in the tile.

[0078] The header of the tile may include information about the adaptation parameter set identifier so that the adaptation parameter set corresponding to the adaptation parameter set identifier can be used in the tile.

[0079] A picture may be divided into one or more tile rows and one or more tile columns.

[0080] A sub-picture in a picture may be divided into one or more tile rows and one or more tile columns. A sub-picture may be a rectangular or square area in a picture and may include one or more CTUs. A sub-picture may include at least one tile, partition and / or slice.

[0081] A tile may be a rectangular area or a square area in a picture and may include one or more CTUs. A tile may be divided into one or more partitions.

[0082] A partition may refer to one or more CTU rows in a tile. A tile may be divided into one or more partitions, and each partition may have at least one CTU row. A tile that is not divided into two or more blocks may also represent a partition.

[0083] A slice may include one or more tiles in a picture and may include one or more partitions in a tile.

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

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

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

[0087] Prediction unit: may represent a basic unit when performing prediction such as inter prediction, intra prediction, inter compensation, intra compensation, and motion compensation. A single prediction unit may be partitioned into multiple partitions of smaller size, or may be partitioned into multiple prediction units of lower levels. Multiple partitions may be basic units when performing prediction or compensation. Partitions generated by splitting a prediction unit may also be prediction units.

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

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

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

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

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

[0093] 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 image" have the same meaning and may be interchangeable.

[0094] 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 an encoding / decoding target block 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.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[0119] 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 a residual block using a residual of the input block and the prediction block after generating the prediction block. The input image may be referred to as a current image as a current encoding target. The input block may be referred to as a current block as a current encoding target, or may be referred to as an encoding target block.

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

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

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

[0123] 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, depending on the determined mode, inter-picture prediction or motion compensation may be performed differently.

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

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

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

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

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

[0129] 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 thus, the size of the bitstream 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.

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

[0131] 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 partitioning, whether to perform binary tree partitioning, binary tree partition direction (horizontal or vertical), binary tree partition form (symmetric partitioning or asymmetric partitioning), whether the current coding unit is partitioned by ternary tree partitioning, the direction of ternary tree partitioning (horizontal or vertical), the type of ternary tree partitioning (symmetric type or asymmetric type), whether the current coding unit is partitioned by multi-type tree partitioning, the direction of multi-type tree partitioning direction (horizontal or vertical), type of multi-type tree partition (symmetric or asymmetric), tree (binary tree or ternary tree) structure of multi-type tree partition, prediction mode (intra-frame prediction or inter-frame prediction), luminance intra-frame prediction mode / direction, chrominance intra-frame prediction mode / direction, intra-frame partition information, inter-frame partition information, coding block partition flag, prediction block partition flag, transform block partition flag, reference sample filtering method, reference sample filter taps, reference sample filter coefficients, prediction block filtering method, prediction block filter taps, prediction block filter coefficients, prediction block boundary filtering method, prediction block boundary filter taps, prediction block boundary filter coefficients, intra-frame prediction mode, Inter prediction mode, motion information, motion vector, motion vector difference, reference picture index, inter prediction angle, inter prediction indicator, prediction list utilization flag, reference picture list, reference picture, motion vector predictor index, motion vector predictor candidate, motion vector candidate list, whether to use merge mode, merge index, merge candidate, merge candidate list, whether to use skip mode, interpolation filter type, interpolation filter tap, interpolation filter coefficient, motion vector size, representation accuracy of motion vector, transform type, transform size, information on whether the first (first) transform is used, information on whether the second transform is used, first transform index, second transform index , information on whether a residual signal exists, coding block pattern, coding block flag (CBF), quantization parameter, quantization parameter residual, quantization matrix, whether to apply an intra-frame loop filter, intra-frame loop filter coefficients, intra-frame loop filter taps, intra-frame loop filter shape / form, whether to apply a deblocking filter, deblocking filter coefficients, deblocking filter taps, deblocking filter strength, deblocking filter shape / form, whether to apply adaptive sample offset, adaptive sample offset value, adaptive sample offset category, adaptive sample offset type, whether to apply an adaptive loop filter, adaptive loop filter coefficients, adaptive loop filter taps, adaptive loop filter shape / form,Binarization / debinarization method, context model determination method, context model update method, whether to execute normal mode, whether to execute bypass mode, context binary bit, bypass binary bit, valid coefficient flag, last valid coefficient flag, encoding flag for unit of coefficient group, position of last valid coefficient, flag on whether the value of coefficient is greater than 1, flag on whether the value of coefficient is greater than 2, flag on whether the value of coefficient is greater than 3, information on remaining coefficient values, sign information, reconstructed luminance 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.

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

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

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

[0135] The reconstructed block may pass through the filter unit 180. The filter unit 180 may apply at least one of a deblocking filter, a sample adaptive offset (SAO), and an adaptive loop filter (ALF) to the reconstructed sample, the reconstructed block, or the reconstructed image. The filter unit 180 may be referred to as an in-loop filter.

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

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

[0138] The adaptive loop filter may perform filtering based on a comparison result of a filtered reconstructed image and an original image. Samples included in an image may be partitioned into predetermined groups, a filter to be applied to each group may be determined, and differential filtering may be performed on each group. Information on whether ALF is applied may be signaled by a coding unit (CU), and the form and coefficient of ALF to be applied to each block may vary.

[0139] The reconstructed block or the reconstructed image that has passed through the filter unit 180 may be stored in the reference picture buffer 190. The reconstructed block processed by the filter unit 180 may be a part of the reference image. That is, the reference image is a reconstructed image composed of the reconstructed blocks processed by the filter unit 180. The stored reference image may be used later in inter-frame prediction or motion compensation.

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

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

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

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

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

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

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

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

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

[0149] 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. When the inter mode is used, the motion compensation unit 250 may generate a prediction block by performing motion compensation on the current block, wherein the motion compensation uses a motion vector and a reference image stored in the reference picture buffer 270 .

[0150] The adder 225 can generate a reconstructed block by adding the reconstructed residual block to the prediction block. The filter unit 260 can apply at least one of a deblocking filter, a sample adaptive offset, and an adaptive loop filter to the reconstructed block or the reconstructed image. The filter unit 260 can output the reconstructed image. The reconstructed block or the reconstructed image can be stored in the reference picture buffer 270 and used when performing inter-frame prediction. The reconstructed block processed by the filter unit 260 can be a part of the reference image. That is, the reference image is a reconstructed image composed of the reconstructed blocks processed by the filter unit 260. The stored reference image can be used later in inter-frame prediction or motion compensation.

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

[0152] In order to efficiently partition an image, a coding unit (CU) may be used when encoding and decoding. A coding unit may be used as a basic unit when encoding / decoding an image. In addition, a coding unit may be used as a unit for distinguishing 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 transformation coefficient.

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

[0154] The partition structure may represent the distribution of coding units (CUs) within the LCU 310. Such distribution may be determined according to whether a single CU is partitioned into multiple (positive integers including 1, 2, 3, 4, 5, 6, 7, 8, 12, 16, 20, 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 multiple CUs. By recursive partitioning, at least one of the height and width of the CU after partitioning may be reduced compared to at least one of the height and width of the CU before partitioning. The partitioning of the CU may be recursively performed until a predefined depth or a predefined size. For example, the depth of the LCU may be 0, and the depth of the minimum coding unit (SCU) may be a predefined maximum depth. Here, as described above, the LCU may be a coding unit having a maximum coding unit size, and the SCU may be a coding unit having a minimum coding unit size. Partitioning starts from the LCU 310, and when the horizontal size or the vertical size or both the horizontal size and the vertical size of the CU are reduced by partitioning, the CU depth increases by 1. For example, for each depth, the size of the non-partitioned CU may be 2N×2N. In addition, in the case of a partitioned CU, a CU of size 2N×2N may be partitioned into four CUs of size N×N. As the depth increases by 1, the size of N may be halved.

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

[0156] For example, a CTU may have a size of 64×64, 128×128, 256×256, 512×512, etc., where the vertical size is equal to the horizontal size. In this case, the vertical size or the horizontal size of the CTU may be a positive integer, where the positive integer is a multiple of 2, 4, and 8 or a power of 2 (=2 n ). Optionally, the CTU may have a size of 128×64, 64×128, 256×64, 64×256, 512×64, 64×512, 256×128, 128×256, etc., where the vertical size is different from the horizontal size. Similarly, in this case, the vertical or horizontal size of the CTU may be a positive integer, where the positive integer is a multiple of 2, 4, and 8 or a power of 2 (=2 n )one of the.

[0157] For example, a CU may have a size of 4×4, 8×8, 16×16, 32×32, 64×64, 128×128, 256×256, 512×512, etc., where the vertical size is equal to the horizontal size. In this case, the vertical size or the horizontal size of the CU may be a positive integer, where the positive integer is a multiple of 2, 4, and 8 or a power of 2 (=2 n ). Alternatively, for example, a CU may have a size of 4×8, 8×4, 4×16, 16×4, 4×32, 32×4, 4×64, 64×4, 8×16, 16×8, 8×32, 32×8, 8×64, 64×8, 16×32, 32×16, 16×64, 64×16, 16×128, 128×16, 32×64, 64×32, 32×128, 128×32, 128×64, 64×128, 256×64, 64×256, 512×64, 64×512, 256×128, 128×256, or the like. Similarly, in this case, the vertical size or the horizontal size of the CU may be a positive integer, where the positive integer is a multiple of 2, 4, and 8, or a power of 2 (=2 n )one of the.

[0158] For example, the SCU may have a size of 2×2, 4×4, 8×8, 16×16, 32×32, 64×64, 64×64, 128×128, 256×256, 512×512, etc., where the vertical size is equal to the horizontal size. In this case, the vertical or horizontal size of the CTU may be a positive integer, where the positive integer is a multiple of 2, 4, and 8 or a power of 2 (=2 n )one of the. In addition, for example, a CTU may have a size such as 2×4, 4×2, 2×8, 8×2, 2×16, 16×2, 2×32, 32×2, 4×8, 8×4, 4×16, 16×4, 4×32, 32×4, 4×64, 64×4, 8×16, 16×8, 8×32, 32×8, 8×64, 64×8, 16×32, 32×16, 16×64, 64×16, 16×128, 128×16, 32×64, 64×32, 32×128, 128×32, 128×64, 64×128, 256×64, 64×256, 512×64, 64×512, 256×128, 128×256, etc., wherein the vertical size is different from the horizontal size. Similarly, in this case, the vertical size or the horizontal size of the CTU may be a positive integer, wherein the positive integer is a multiple of 2, 4, and 8 or a power of 2 (=2 n )one of the.

[0159] At least one of the CTU, CU, SCU, and sub-CU may have a size having a vertical to horizontal ratio or a horizontal to vertical ratio such as N:N, 1.5×N:N, 2×N:N, 2.5×N:N, 3×N:N, 3.5×N:N, 4×N:N, 4.5×N:N, 5×N:N, 5.5×N:N, 6×N:N, N:1.5×N, N:2×N, N:2.5×N, N:3×N, N:3.5×N, N:4×N, N:4.5×N, N:5×N, N:5.5×N, N:6×N, etc. Here, N may be a positive integer among 2, 4, 6, 8, 16, etc. A sub-CU may refer to a unit or a sub-block generated not by partitioning in a block structure but by partitioning a CU at least once in a process of encoding / decoding the CU.

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

[0161] For example, when a single coding unit is partitioned into four coding units, the horizontal size and vertical size of the four coding units partitioned may be half the size of the horizontal size and vertical size of the CU before being partitioned. In one embodiment, when a coding unit of size 32×32 is partitioned into four coding units, each of the four coding units partitioned may have a size of 16×16. When a single coding unit is partitioned into four coding units, it can be said that the coding unit can be partitioned into a quadtree form.

[0162] 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 partitioned vertically into two sub-coding units, each of the two sub-coding units may have a size of 16×32. For example, when a coding unit having a size of 8×32 is partitioned horizontally into two sub-coding units, each of the two sub-coding units may have a size of 8×16. When one coding unit is partitioned into two sub-coding units, the coding unit may be said to be partitioned into two or partitioned by a binary tree partition structure.

[0163] For example, when one parent coding unit is divided into two child coding units, the horizontal size or vertical size of each of the two child coding units has a ratio of 1 / K:(K-1) / K or (K-1) / K:1 / K with respect to the horizontal size or vertical size of the parent coding unit. Here, K may be a positive integer of 2, 3, 4, 5, 6, 7, 8, 16, 32, etc.

[0164] For example, when a 32×32 parent coding unit is vertically split into a ratio of 1:3, the resulting two child coding units may have sizes of 8×32 and 24×32, respectively.

[0165] On the other hand, when the 8×32 parent coding unit is horizontally split at a ratio of 1:3, the resulting two child coding units may have sizes of 8×8 and 8×24, respectively.

[0166] 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 vertically divided 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.

[0167] For example, when one parent coding unit is divided into three child coding units, the horizontal size or vertical size of the parent coding unit may be divided into a ratio of K:L:M (such as 1:2:1, 2:1:1, 1:1:2, 1:4:1, 4:1:1, 1:1:4, 1:3:2, 2:3:1, 1:6:1, 6:1:1, 1:1:6, 1:5:2, and 2:5:1). Here, each of K, L, and M may be a positive integer.

[0168] For example, when a 16×32 parent coding unit is horizontally split into a ratio of 1:6:1, the resulting three child coding units may have sizes of 16×4, 16×24, and 16×4, respectively, in order from the upper side.

[0169] Alternatively, for example, when a 32×32 parent coding unit is vertically split into a ratio of 6:1:1, the resulting three child coding units may have sizes of 24×32, 4×32, and 4×32, respectively, in sequence from the left.

[0170] Further optionally, for example, when the size of the coding unit is not a multiple of the sum (K+L+M) of K, L, and M, the coding unit may be divided according to a predetermined rule. For example, when M has a maximum value of the ratio of K:L:M, a positive integer n is added to M so that the size of the coding unit becomes a multiple of the sum (K+L+M+n) of K, L, and M+n. That is, the coding unit may be divided into a ratio of K:L:(M+n).

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

[0172] 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 the CTU according to a predetermined priority order.

[0173] 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 or ternary tree partition structure, or may not be further partitioned. Therefore, by preventing coding blocks obtained from binary 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.

[0174] For example, binary tree partitioning may be preferentially applied to CTU. Coding units that can no longer be divided by binary tree partitioning are referred to as leaf nodes of a binary tree. Coding units corresponding to leaf nodes of a binary tree may become root nodes of a quadtree or a ternary tree. That is, coding units corresponding to leaf nodes of a binary tree may be divided by quadtree partitioning or ternary tree partitioning, or may no longer be divided. When coding units corresponding to leaf nodes of a binary tree are divided by quadtree partitioning or ternary tree partitioning, the resulting sub-coding units are no longer divided by binary tree partitioning. Therefore, block partitioning may be performed efficiently and / or partition information may be sent using a signal.

[0175] For example, ternary tree partitioning may be preferentially applied to CTU. Coding units that can no longer be divided by ternary tree partitioning may be referred to as leaf nodes of the ternary tree. Coding units corresponding to leaf nodes of the ternary tree may become root nodes of a quadtree or a binary tree. That is, coding units corresponding to leaf nodes of the ternary tree may be further divided by quadtree partitioning or binary tree partitioning, or may no longer be divided. When coding units corresponding to leaf nodes of the ternary tree are divided by quadtree partitioning or binary tree partitioning, the resulting sub-coding units may no longer be divided by ternary tree partitioning. Therefore, block partitioning may be effectively performed and / or partition information may be sent with a signal.

[0176] For example, quadtree partitioning, ternary tree partitioning, and binary tree partitioning may be sequentially applied to the current CTU. Alternatively, ternary tree partitioning, binary tree partitioning, and quadtree partitioning may be sequentially applied to the current CTU.

[0177] For example, in quadtree partitioning, binary tree partitioning, and ternary tree partitioning to be applied to a CTU, partitioning that divides the vertical size or horizontal size into a symmetric ratio is first applied, and then partitioning that divides the vertical size or horizontal size into an asymmetric ratio is applied.

[0178] Alternatively, for example, when the CTU is divided by binary tree partitioning, the priority of the partitioning scheme may vary depending on whether the horizontal size or the vertical size is divided into a symmetric ratio or an asymmetric ratio.

[0179] Alternatively, for example, when the CTU is divided by ternary tree partitioning, the priority of the partitioning scheme may vary depending on whether the horizontal size or the vertical size is divided into a symmetric ratio or an asymmetric ratio or depending on whether two of the three segments of the horizontal size or the vertical size have a symmetric ratio or an asymmetric ratio.

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

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

[0182] As another example, there may be no priority between quadtree partitioning and ternary tree partitioning. That is, the coding units corresponding to the leaf nodes of the binary tree may be first divided by quadtree partitioning or ternary tree partitioning. Alternatively, the coding units generated by quadtree partitioning or ternary tree partitioning may be further divided by quadtree partitioning or ternary tree partitioning, or may no longer be divided.

[0183] As another example, there may be no priority between quadtree partitioning and binary tree partitioning. That is, the coding units corresponding to the leaf nodes of the ternary tree may be further divided by quadtree partitioning or binary tree partitioning. Alternatively, the coding units generated by quadtree partitioning or binary tree partitioning may be further divided by quadtree partitioning or binary tree partitioning, or may no longer be divided.

[0184] For example, there may be no priority between binary tree partitioning and ternary tree partitioning depending on whether the vertical size or the horizontal size is to be divided into a symmetric ratio or an asymmetric ratio.

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

[0186] In this case, the signaling order may be determined by a value preset in the encoder / decoder, or may be determined by a value signaled from the encoder to the decoder.

[0187] For example, 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.

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

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

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

[0191] In order to determine whether to split the coding unit corresponding to each node of the multi-type tree, at least one type of information selected from information indicating whether multi-type tree partitioning is applied, partition direction information, partition ratio information, and partition tree information may be signaled. In order to split the coding unit corresponding to each node of the multi-type tree, information indicating whether multi-type tree partitioning is applied, partition direction information, partition ratio information, and partition tree information may be sequentially signaled.

[0192] For example, in order to split a coding unit corresponding to each node of a multi-type tree, information indicating whether multi-type tree partitioning is applied, partition direction information, partition tree information, and partition ratio information may be sequentially signaled.

[0193] Alternatively, in order to split a coding unit corresponding to each node of a multi-type tree, information indicating whether multi-type tree partitioning is applied, partition ratio information, partition direction information, and partition tree information may be sequentially signaled.

[0194] When a coding unit corresponding to each node of a multi-type tree is divided by a multi-type tree partition, the coding unit may further include partition ratio information. The partition ratio information may indicate a ratio for the multi-type tree partition.

[0195] For example, in the case of binary tree partitioning, an example of the partition ratio indicated by the partition ratio information will be described below.

[0196] When the partition ratio information has a value of 1, the coding unit is divided by binary tree partitioning so that its horizontal size or vertical size is divided into a ratio of 1: 1. When the partition ratio information has a value of 2, the coding unit is divided by binary tree partitioning so that its horizontal size or vertical size is divided into a ratio of 1: 3. When the partition ratio information has a value of 3, the coding unit is divided by binary tree partitioning so that its horizontal size or vertical size is divided into a ratio of 1: 7. When the partition ratio information has a value of 4, the coding unit is divided by binary tree partitioning so that its horizontal size or vertical size is divided into a ratio of 1: 15.

[0197] In the case of binary tree partitioning, other examples of the partition ratio indicated by the partition ratio information will be described below.

[0198] When the partition ratio information has a value of 1, the coding unit is divided by binary tree partitioning so that its horizontal size or vertical size is divided into a ratio of 1: 1. When the partition ratio information has a value of 2, the coding unit is divided by binary tree partitioning so that its horizontal size or vertical size is divided into a ratio of 3: 1. When the partition ratio information has a value of 3, the coding unit is divided by binary tree partitioning so that its horizontal size or vertical size is divided into a ratio of 1: 3.

[0199] In the case of ternary tree partitioning, an example of a partition ratio indicated by the partition ratio information will be described below.

[0200] When the partition ratio information has a value of 1, the coding unit is divided by ternary tree partitioning so that its horizontal size or vertical size is divided into a ratio of 1:2:1. When the partition ratio information has a value of 2, the coding unit is divided by ternary tree partitioning so that its horizontal size or vertical size is divided into a ratio of 1:4:1. When the partition ratio information has a value of 3, the coding unit is divided by ternary tree partitioning so that its horizontal size or vertical size is divided into a ratio of 1:6:1. When the partition ratio information has a value of 4, the coding unit is divided by ternary tree partitioning so that its horizontal size or vertical size is divided into a ratio of 1:8:1.

[0201] In the case of ternary tree partitioning, other examples of the partition ratio indicated by the partition ratio information will be described below.

[0202] When the partition ratio information has a value of 1, the coding unit is divided by ternary tree partitioning so that its horizontal size or vertical size is divided into a ratio of 1:2:1. When the partition ratio information has a value of 2, the coding unit is divided by ternary tree partitioning so that its horizontal size or vertical size is divided into a ratio of 2:1:1. When the partition ratio information has a value of 3, the coding unit is divided by ternary tree partitioning so that its horizontal size or vertical size is divided into a ratio of 1:1:2. When the partition ratio information has a value of 4, the coding unit is divided by binary tree partitioning so that its horizontal size or vertical size is divided into a ratio of 1:3. That is, the partition ratio information of the ternary tree partition can be used to indicate the partition ratio information of the binary tree partition.

[0203] The partition ratio information may be a flag or an index having a predetermined length (for example, 1 bit) or may be an index having a variable length.

[0204] The relationship between the value of the partition ratio information and the partition ratio is not limited to the above example. When the partition ratio information has a specific value, it means that the coding unit is divided into a ratio of n:m or a ratio of n:m:r by binary tree partitioning or ternary tree partitioning. The ratio can be set differently.

[0205] Partitioning in the case where there is no priority between quadtree partitioning and ternary tree partitioning may also be referred to as multi-tree partitioning. That is, a coding unit corresponding to a leaf node of a binary tree may become a root node of a multi-type tree. In order to divide a coding unit corresponding to each node of a multi-type tree, at least one type of information selected from information indicating whether multi-type tree partitioning is applied, partition direction information, partition ratio information, and partition tree information may be transmitted by a signal.

[0206] Partitioning in the case where there is no priority between quadtree partitioning and ternary tree partitioning may also be referred to as multi-tree partitioning. That is, a coding unit corresponding to a leaf node of a binary tree may become a root node of a multi-type tree. In order to divide a coding unit corresponding to each node of a multi-type tree, at least one type of information selected from information indicating whether multi-type tree partitioning is applied, partition direction information, partition ratio information, and partition tree information may be transmitted by a signal.

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

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

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

[0210] The coding unit that is additionally divided M times by quadtree partitioning, binary tree partitioning and / or ternary tree partitioning can become a basic unit for encoding, prediction and transformation. That is, in order to perform prediction and / or transformation, the coding unit can be additionally divided M times. In this case, the coding unit that is additionally divided M times can be used only in the encoding / decoding process, but the coding unit may not be divided in the block structure. Therefore, the partition structure, partition information, etc. for further dividing the coding unit into prediction units and / or transformation units may not be inserted into the bitstream. Here, M is a positive integer, and is, for example, 1.

[0211] For example, the coding unit may be further divided into M times and N times for use in a prediction process and / or a transform process. For example, M and N are the same value or different values.

[0212] However, when the size of a coding unit (ie, a basic unit for partitioning) is larger than the size of a 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.

[0213] Here, at least one of the size of the coding unit and the size of the maximum transform block may represent a horizontal size, a vertical size, or an area. Here, at least one of the size of the coding unit and the size of the maximum transform block may represent depth information specifying the size of the coding unit or block. Alternatively, it may represent a ratio of the horizontal size to the vertical size. 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 greater 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 greater than the vertical size (height) of the maximum transform block, the coding unit may be horizontally divided into two equal parts.

[0214] When the size of the coding unit is larger than the size of the maximum transform block, the value of the coding block flag (CBF) of the coding unit may be determined as a first value according to at least one of the slice type and the partition information. Here, the first value may be 0, indicating that there is no transform coefficient or quantization level in the coding unit.

[0215] In this case, the slice type may be a P slice or a B slice. Here, the partition information may have a first value of 0 (or a second value of 1) indicating that the coding unit will not be split.

[0216] For example, when the current slice is a B slice, the size of the coding unit is 128×128, the size of the maximum transform block is 64×64, and the partition information is 0, a coded block flag (CBF) value of the coding unit may be determined to be 0.

[0217] For example, when the current slice is an I slice, the size of the coding unit is 128×128, the size of the maximum transform block is 64×64, and the partition information is 0, the CBF value of the coding unit may be determined to be 0.

[0218] For example, when the current slice is a P slice, the size of the coding unit is 64×128, the size of the maximum transform block is 64×64, and the partition information is 0, the CBF value of the coding unit may be determined to be 0.

[0219] For example, when the current slice is a P slice, the size of the coding unit is 64×32, the size of the maximum transform block is 32×16, and the partition information is 0, the CBF value of the coding unit may be determined to be 0.

[0220] For example, when the current slice is a B slice, the size of the coding unit is 128×128, the size of the maximum transform block is 32×32, and the partition information is 0, the size / partition information of the coding unit may be additionally entropy encoded / decoded.

[0221] For example, when the size / partition information of the coding unit has a first value of 0, the size of the coding unit may be determined to be 128×128, and the CBF value of the coding unit may be determined to be 0. For example, when the size / partition information of the coding unit has a second value of 1, the 128×128 parent coding unit is divided into four 64×64 child coding units through quadtree partitioning, and the CBF value of the coding unit may be determined to be 0. That is, when the horizontal size or the vertical size of the coding unit is four times the horizontal size or the vertical size of the maximum transformation block, the size / partition information of the coding unit may be further entropy encoded / decoded, and the size of the coding unit having a CBF value of 0 may be determined.

[0222] For example, when the current slice is a B slice, the size of the coding unit is 128×64, the size of the maximum transform block is 32×16, and the partition information is 0, the size / partition information of the coding unit may be further entropy encoded / decoded.

[0223] For example, when the size / partition information of the coding unit has a first value of 0, the size of the coding unit may be determined to be 128×64, and the CBF value of the coding unit may be determined to be 0. For example, when the size / partition information of the coding unit has a second value of 1, a 128×64 parent coding unit is split into four 64×32 child coding units through quadtree partitioning, and the CBF value of the coding unit may be determined to be 0.

[0224] When the size of the coding unit is larger than the size of the maximum transform block, the mode of the coding unit may be determined as a skip mode or an AMVP mode according to a slice type, wherein a coding block flag (CBF) has a first value and a motion vector difference is signaled. In this case, the slice type may be a P slice or a B slice.

[0225] For example, when the current slice is a B slice, the size of the coding unit is 128×128, the size of the maximum transform block is 64×64, and the partition information is 0, the mode of the coding unit may be determined as a skip mode.

[0226] For example, when the current slice is a P slice, the size of the coding unit is 64×128, the size of the maximum transform block is 64×64, and the partition information is 0, the mode of the coding unit may be determined as the AMVP mode in which the CBF value is 0.

[0227] For example, when the current slice is a B slice, the size of the coding unit is 128×128, the size of the maximum transform block is 32×32, and the partition information is 0, the size / partition information of the coding unit may be additionally entropy encoded / decoded.

[0228] For example, when the size / partition information of the coding unit has a first value of 0, the size of the coding unit may be determined to be 128×128, and the mode of the coding unit may be determined to be a skip mode. For example, when the size / partition information of the coding unit has a second value of 1, the 128×128 coding unit may be divided into four 64×64 coding units through quadtree partitioning, and the mode of the coding unit may be determined to be a skip mode.

[0229] For example, when the current slice is a P slice, the size of the coding unit is 128×64, the size of the maximum transform block is 32×16, and the partition information is 0, the size / partition information of the coding unit may be additionally entropy encoded / decoded.

[0230] For example, when the size / partition information of the coding unit has a first value of 0, the size of the coding unit may be determined to be 128×64, and the mode of the coding unit may be determined to be an AVMP mode with a CBF value of 0. For example, when the size / partition information of the coding unit has a second value of 1, the 128×64 coding unit is divided into four 64×32 coding units through quadtree partitioning, and the mode of the coding unit may be determined to be an AVMP mode with a CBF value of 0.

[0231] Here, at least one of the size of the coding unit and the size of the maximum transform block may be a value preset in the encoder / decoder, or may be a value signaled from the encoder to the decoder.

[0232] When the depth of the coding unit is 0 and the partition information is 0, the CBF value of the coding unit may be determined to be 1.

[0233] When the depth of the coding unit is 0 and the partition information is 0, the mode of the coding unit may be determined as a skip mode or an AVMP mode, in which a coded block flag (CBF) has a first value and a motion vector difference value is signaled.

[0234] In the above description, the coded block flag may include at least one of a coded block flag of a luminance signal and a coded block flag of a chrominance signal.

[0235] 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 parallel block group level, a parallel block level, etc. For example, the minimum size of a coding unit may be determined to be 4×4. For example, the maximum size of a transform block may be determined to be 64×64. For example, the minimum size of a transform block may be determined to be 4×4. Here, the maximum and / or minimum size information of a coding unit and the maximum and / or minimum size information of a transform block are values ​​that are signaled for intra-frame slices and inter-frame slices, or values ​​that are signaled regardless of the slice type.

[0236] The maximum and / or minimum size information of the coding unit may be signaled in association with the partition tree type of the current block. For example, when the partition tree type of the current coding unit is any one of a quadtree, a binary tree, and a ternary tree, the maximum and / or minimum size information of each tree-type coding unit may be signaled.

[0237] Here, maximum and / or minimum size information of a specific tree-type coding unit may be signaled in association with maximum and / or minimum size information of a general coding unit.

[0238] Here, maximum and / or minimum size information of a specific tree-type coding unit may be signaled in association with maximum and / or minimum size information of another specific tree-type coding unit.

[0239] Here, the maximum and / or minimum size information of a specific tree coding unit may be signaled in the form of a logarithmic value. For example, the exponent in the logarithm may be 2.

[0240] Here, maximum and / or minimum size information of each specific tree coding unit may be signaled for each of the luma component and the chroma component. In the following, a value represented by Y or luma represents information about a luma unit, and information represented by C or chroma represents information about a chroma unit.

[0241] For example, the difference between the minimum size of a quadtree coding unit and the minimum size of a universal coding unit may be signaled. For example, the difference between the minimum size of a quadtree coding unit and the minimum size of a universal coding unit may be signaled via slice_log2_diff_min_qt_min_cb_luma or slice_log2_diff_min_qt_min_cb_chroma. For example, the minimum size MinQtSizeY or MinQtSizeC of a quadtree coding unit may be derived from slice_log2_diff_min_qt_min_cb_luma or slice_log2_diff_min_qt_min_cb_chroma and the minimum size MinCbLog2SizeY of a universal coding unit. In the following, the case where a quadtree coding unit has a minimum size may be a case where the quadtree coding unit corresponds to a leaf node of a quadtree.

[0242] Optionally, for example, the difference between the maximum size of the binary tree coding unit and the minimum size of the quadtree coding unit may be signaled. For example, the difference between the maximum size of the binary tree coding unit and the minimum size of the quadtree coding unit may be signaled via slice_log2_diff_max_bt_min_qt_luma or slice_log2_diff_max_bt_min_qt_chroma. The maximum size MaxBtSizeY or MaxBtSizeC of the binary tree coding unit may be derived from slice_log2_diff_max_bt_min_qt_luma or slice_log2_diff_max_bt_min_qt_chroma and the minimum size MinQtLog2SizeY or MinQtLog2SizeC of the quadtree coding unit. On the other hand, the decoder may derive the minimum size MinBtSizeY or MinBtSizeC of the binary tree coding unit from the minimum size MinCbLog2SizeY of the general coding unit.

[0243] Optionally, for example, the difference between the maximum size of a ternary tree coding unit and the minimum size of a quadtree coding unit may be signaled. For example, the difference between the maximum size of a ternary tree coding unit and the minimum size of a quadtree coding unit may be signaled via slice_log2_diff_max_tt_min_qt_luma or slice_log2_diff_max_tt_min_qt_chroma. The maximum size (MaxTtSizeY or MaxTtSizeC) of a ternary tree coding unit may be derived from slice_log2_diff_max_tt_min_qt_luma or slice_log2_diff_max_tt_min_qt_chroma and the minimum size (MinQtLog2SizeY or MinQtLog2SizeC) of a quadtree coding unit. On the other hand, the decoder may derive the minimum size (MinTtSizeY or MinTtSizeC) of a ternary tree coding unit from the minimum size (MinCbLog2SizeY) of a general coding unit.

[0244] Information about the minimum size of the coding unit corresponding to the leaf node of the quadtree (quadtree minimum size) and / or information about the maximum depth of the multi-type tree from the root node to the leaf node (multi-type tree maximum depth) is 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 parallel block group level, a parallel block level, etc. Here, the information about the quadtree minimum size and / or the information about the multi-type tree maximum depth is determined as a value signaled for an intra-frame slice and an inter-frame slice, respectively, or is determined as a value signaled regardless of the slice type. The multi-type tree maximum depth information may be divided into a binary tree maximum depth information and a ternary tree maximum depth information, and may be signaled or determined at a higher level of the coding unit.

[0245] Here, the multi-type tree maximum depth information may be signaled in association with maximum size information and / or minimum size information of a general coding unit.

[0246] Here, the multi-type tree maximum depth information may be signaled in the form of a logarithmic value, for example, the exponent in the logarithm may be 2.

[0247] Here, the polytree maximum depth information may be signaled separately for the luma component and the chroma component. Hereinafter, a value represented by Y or luma represents information on a luma unit, and information represented by C or chroma represents information on a chroma unit.

[0248] Here, the multi-type tree maximum depth information may be signaled. For example, the multi-type tree maximum depth information may be signaled via slice_max_mtt_hierarchy_depth_luma or slice_max_mtt_hierarchy_depth_luma_chroma. The value of slice_max_mtt_hierarchy_depth_luma or slice_max_mtt_hierarchy_depth_luma_chroma may be in the range of 0 to the result value of the equation Ctblog2Sizey-MinCblog2SizeY. The decoder may derive the maximum depth (MaxMttDepthY or MaxMttDepthC) from slice_max_mtt_hierarchy_depth_luma or from slice_max_mtt_hierarchy_depth_luma_chroma.

[0249] 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. The value of the maximum size of the coding unit corresponding to each node of the binary tree (the maximum size of the binary tree) varies depending on the slice type. For example, when the slice type is an intra-frame slice, the maximum size of the binary tree may be 32×32. For example, when the slice type is an inter-frame slice, the maximum size of the binary tree may be 128×128. Information about the maximum size of the coding unit corresponding to each node of the ternary tree (ternary tree maximum size) may be determined based on the size of the coding unit and the difference information. 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 as the minimum size of the coding block.

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

[0251] For example, the binary tree maximum size and / or the ternary tree maximum size may be signaled or determined at the sequence level or the picture level. For example, the binary tree minimum size and / or the ternary tree minimum size may be signaled or determined at the sequence level or the picture level.

[0252] For example, the maximum binary tree depth and / or the maximum ternary tree depth may be signaled or determined at the sequence level, the picture level, or the slice level. For example, the minimum binary tree depth and / or the minimum ternary tree depth may be signaled or determined at the sequence level, the picture level, or the slice level.

[0253] Depending on the sizes and depth information of the above-mentioned various blocks, quadtree 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.

[0254] 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 quadtree partition information. Therefore, the quadtree partition information may be inferred from the second value.

[0255] 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 from the second value.

[0256] 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 by the binary tree or the ternary tree. 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 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.

[0257] Optionally, the binary tree partition or ternary tree partition may be limited based on the size of the virtual pipeline data unit (hereinafter, the pipeline buffer size). For example, when the coding unit is divided into sub-coding units that do not fit the pipeline buffer size by the 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 (eg, 64×64). For example, when the pipeline buffer size is 64×64, the following division may be limited.

[0258] - N×M (N and / or M is 128) ternary tree partitions for coding units - 128×N (N<=64) binary tree partitions in the horizontal direction for coding units - N×128 (N<=64) binary tree partitions in the vertical direction for coding units 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 binary tree partitioned and / or ternary tree partitioned. Therefore, the multi-type tree partition indication information may not be signaled, but the multi-type tree partition indication information may be inferred from the second value.

[0259] Optionally, only when at least one of vertical binary tree partitioning, horizontal binary tree partitioning, vertical ternary tree partitioning, and horizontal ternary tree partitioning is possible for a coding unit corresponding to a node of a multi-type tree, a multi-type tree partition indication information may be signaled. Otherwise, the coding unit may not be binary tree partitioned and / or ternary tree partitioned. Therefore, the multi-type tree partition indication information may not be signaled, but may be inferred from the second value.

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

[0261] 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 derived from a value indicating a possible partition tree structure.

[0262] When at least one of the vertical and horizontal dimensions of a cell or block is not a power of 2 (=2 n ), the unit or block can be encoded / decoded so that there is no residual signal.

[0263] For example, a coded block flag (CBF) of a unit or block may not be entropy encoded / decoded but may be inferred to be zero.

[0264] For example, a skip mode flag of a coding mode of a unit or a block may not be entropy encoded / decoded, and the coding mode of the unit or the block may be inferred to be a skip mode.

[0265] Therefore, it is not necessary that at least one of the vertical dimension and the horizontal dimension is not a power of 2 (=2 n ) blocks to perform transformation / inverse transformation. That is, at least one of the transformation matrix and the inverse transformation matrix in the form of 2 to the power of n may not be required.

[0266] When the current block includes a boundary of a picture, a sub-picture, a slice, a tile, or a partition, the current block may be implicitly partitioned. In the following description, the boundary may represent at least one of the boundaries of the picture, the sub-picture, the slice, the tile, and the partition. In this case, the boundary may represent at least one of the right boundary, the lower boundary, the upper boundary, and the left boundary of the picture, the sub-picture, the slice, the tile, and the partition. Here, implicit partitioning may represent a case where a specific block is partitioned by a specific partitioning method without a coding parameter being signaled.

[0267] The right border or the left border may represent a vertical border. The bottom border or the top border may represent a horizontal border.

[0268] When a boundary included in the current block is a vertical boundary or a horizontal boundary, the current block may be partitioned only vertically or horizontally. Implicit partitioning of the current block may be performed according to the size of the current block.

[0269] When implicit partitioning is performed, only specific partitioning may be performed, and only specific partition information may be entropy encoded / decoded. The specific partition is determined according to whether a boundary included in the current block is a vertical boundary or a horizontal boundary. The specific partition may be any one partition type selected from quadtree partitioning, horizontal binary tree partitioning, vertical binary tree partitioning, horizontal ternary tree partitioning, and vertical ternary tree partitioning.

[0270] For example, when the current block includes a vertical boundary, at least one of quadtree partitioning, vertical binary tree partitioning, and vertical ternary tree partitioning may be performed such that each block generated by partitioning of the current block does not extend across the vertical boundary.

[0271] For example, when the current block includes a horizontal boundary, at least one of quadtree partitioning, horizontal binary tree partitioning, and horizontal ternary tree partitioning may be performed such that each block generated by partitioning of the current block does not extend across the horizontal boundary.

[0272] For example, when the current block includes a right boundary, the partition of the current block can be limited so that only the vertical binary tree partition of the current block is possible. In this case, the vertical binary tree partition can be implicitly performed on the current block. In this case, the partition information about the vertical binary tree partition can be entropy encoded / decoded. In this case, the information about other types of partitions other than the binary tree partition may not be entropy encoded / decoded.

[0273] Specifically, when the current block includes a right boundary and the height of the current block exceeds the maximum transform block size, partitioning of the current block may be limited, thereby preventing vertical binary tree partitioning.

[0274] For example, when the current block includes a right boundary and the height of the current block exceeds 64 (where 64 is the maximum transform block size), partitioning of the current block may be limited, thereby preventing vertical binary tree partitioning.

[0275] For example, when the current block includes the right boundary but does not include the lower boundary, the partitioning of the current block may be restricted, thereby preventing horizontal binary tree partitioning.

[0276] For example, when the current block includes a lower boundary, the partitioning of the current block may be limited so that only horizontal binary tree partitioning is possible. In this case, horizontal binary tree partitioning may be implicitly performed on the current block. In this case, horizontal binary tree partitioning information about the current block may be entropy encoded / decoded. In this case, information about partitions of other types except horizontal binary tree partitioning may not be entropy encoded / decoded.

[0277] Specifically, when the current block includes a lower boundary, the partitioning of the current block may be limited, thereby preventing vertical binary tree partitioning.

[0278] In addition, when the current block includes a lower boundary and the width of the current block exceeds the maximum transform block size, partitioning of the current block may be limited, thereby preventing horizontal binary tree partitioning.

[0279] For example, when the current block includes a lower boundary and the width of the current block exceeds 64 (where 64 is the maximum transform block size), partitioning of the current block may be limited, thereby preventing horizontal binary tree partitioning.

[0280] For example, when the current block includes a right boundary, the partition of the current block may be limited so that only vertical ternary tree partitioning is allowed for the current block. In this case, vertical ternary tree partitioning may be implicitly performed on the current block. In this case, vertical ternary tree partitioning information about the current block may be entropy encoded / decoded. In this case, information about other types of partitions other than vertical ternary tree partitioning may not be entropy encoded / decoded.

[0281] For example, when the current block includes a lower boundary, the partition of the current block may be limited so that only horizontal ternary tree partitioning is allowed. In this case, horizontal ternary tree partitioning may be implicitly performed on the current block. In this case, horizontal ternary tree partition information about the current block may be entropy encoded / decoded. In this case, information about other types of partitions other than horizontal ternary tree partitioning may not be entropy encoded / decoded.

[0282] For example, when the current block includes at least a right boundary or an upper boundary, the partitioning of the current block may be limited, thereby preventing ternary tree partitioning.

[0283] For example, when the current block includes both the right boundary and the lower boundary, the partition of the current block may be limited so that only quadtree partitioning is allowed. In this case, quadtree partitioning may be implicitly performed on the current block. In this case, quadtree partition information about the current block may be entropy encoded / decoded. In this case, information about other types of partitions other than quadtree partitioning may not be entropy encoded / decoded.

[0284] When partitioning the current block, the partitioning of the current block may be limited so that the aspect ratio (horizontal size to vertical size) of each resulting sub-block is not a specific ratio. That is, the partitioning of the current block may be limited so that the aspect ratio (horizontal size to vertical size) of each resulting sub-block is equal to or less than a specific ratio. For example, the aspect ratio of the horizontal size and the vertical size may be 1:N. That is, the ratio of the vertical size to the horizontal size may be N:1. Here, N may be a positive integer such as 4, 5, 6, 7, 8, etc. Here, V may be determined based on at least one of the encoding parameters of the current block and the encoding parameters of the candidate block. In this case, N may be a value preset in the encoder / decoder or a value signaled from the encoder to the decoder.

[0285] Compared to a specific ratio, a ratio of each subblock resulting from partitioning of the current block increases, and partition information about the subblock may not be entropy encoded / decoded.

[0286] In order to determine the partition tree structure of the current block, the syntax described below may be determined.

[0287] For example, qtbtt_dual_tree_intra_flag may indicate that each CTU in an I slice is divided into 64×64 coding units, and each of the 64×64 coding units serves as a root node for luma and chroma components.

[0288] For example, qtbtt_dual_tree_intra_flag having a first value (e.g., 0) may indicate that each CTU is divided into 64×64 coding units and each 64×64 coding unit is used neither as a root node for a luma component nor as a root node for a chroma component, and qtbtt_dual_tree_intra_flag having a second value (e.g., 1) may indicate that each CTU is divided into 64×64 coding units and each 64×64 coding unit is used as a root node for a luma component and a root node for a chroma component.

[0289] When qtbtt_dual_tree_intra_flag has a first value (e.g., 0), the block partition structure of the luma component and the block partition structure of the chroma component may be the same. However, depending on the tree type of the chroma component, the block size of the luma component may be different from the block size of the chroma component. This case is referred to as a case where a single tree structure is used. The single tree type is identified from the expression "SINGLE_TREE".

[0290] When the slice type is an I slice and qtbtt_dual_tree_intra_flag has a second value (e.g., 1), the block partition structure of the luma component and the block partition structure of the chroma component derived from the 64×64 coding unit may be different from each other. This case is referred to as a case of using a dual tree structure. In the case of the dual tree structure, the tree type of the luma component may be identified from the expression “DUAL_TREE_LUMA”, and the tree type of the chroma component may be identified from the expression “DUAL_TREE_CHROMA”.

[0291] In the case of a single tree structure, the minimum block of the chrominance component may be set to a 2×2 block. In this case, for the chrominance component, blocks smaller than 2×2 blocks may not be used. That is, for the chrominance component, it is not allowed to divide a parent block larger than 2×2 blocks into child blocks smaller than 2×2 blocks.

[0292] In the case of a single tree structure, the minimum block of the chrominance component may be set to a 4×4 block. In this case, for the chrominance component, 2×2 blocks, 2×4 blocks, and 4×2 blocks may not be used. That is, partitioning a block larger than at least one of 2×2 blocks, 2×4 blocks, and 4×2 blocks into at least one of 2×2 blocks, 2×4 blocks, and 4×2 blocks may not be allowed.

[0293] In the case of a dual tree structure, the minimum block of the chrominance component may be set to a 4×4 block. In this case, for the chrominance component, 2×2 blocks, 2×4 blocks, and 4×2 blocks may not be used. That is, partitioning a block larger than at least one of 2×2 blocks, 2×4 blocks, and 4×2 blocks into at least one of 2×2 blocks, 2×4 blocks, and 4×2 blocks may not be allowed.

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

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

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

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

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

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

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

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

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

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

[0304] In the case of the planar mode, when generating a prediction block of the current block, according to the position of the prediction target sample in the prediction block, the sample value of the prediction target sample may be generated by using the weighted sum of the upper reference sample and the left reference sample of the current sample and the upper right reference sample and the lower left reference sample of the current block. In addition, in the case of the DC mode, when generating the prediction block of the current block, the average value of the upper reference sample and the left reference sample of the current block may be used. In addition, in the case of the angular mode, the prediction block may be generated by using the upper reference sample, the left reference sample, the upper right reference sample and / or the lower left reference sample of the current block. In order to generate the prediction sample value, interpolation of real number units may be performed.

[0305] 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 upper and / or left neighboring samples of the current block and upper and / or left neighboring samples of a 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 parameters of a 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, subsampling may be performed on the reconstruction block of the first color component and the neighboring samples of the corresponding reconstruction block. For example, when one sample of the second color component corresponds to four samples of the first color component, the four samples of the first color component may be subsampled to calculate one corresponding sample. In this case, parameter derivation of a linear model and intra prediction between color components may be performed based on the corresponding subsampled samples. Whether to perform intra prediction between color components and / or the range of a template may be signaled as an intra prediction mode.

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

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

[0308] The intra-frame prediction mode of the current block may be entropy encoded / decoded by predicting the intra-frame prediction mode of a block existing adjacent to the current block. When the intra-frame prediction mode of the current block is the same as that of the neighboring block, information that the intra-frame prediction mode of the current block is the same as that of the neighboring block may be signaled by using predetermined flag information. In addition, indicator information of the intra-frame prediction mode that is the same as the intra-frame prediction mode of the current block among the intra-frame prediction modes of multiple neighboring blocks may be signaled. When the intra-frame prediction mode of the current block is different from that of the neighboring block, the intra-frame prediction mode information of the current block may be entropy encoded / decoded by performing entropy encoding / decoding based on the intra-frame prediction mode of the neighboring block.

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

[0310] exist Figure 5 In , a rectangle can represent a picture. Figure 5 In 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).

[0311] An I picture may be encoded by intra prediction without requiring inter-picture prediction. A P picture may be encoded by inter-picture prediction using a reference picture existing in one direction (i.e., forward or backward) relative to the current block. A B picture may be encoded by inter-picture prediction using a reference picture existing in two directions (i.e., forward and backward) relative to the current block. When inter-picture prediction is used, the encoder may perform inter-picture prediction or motion compensation, and the decoder may perform corresponding motion compensation.

[0312] Hereinafter, embodiments of inter-picture prediction will be described in detail.

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

[0314] The motion information of the current block may be derived during inter-picture prediction by each of the encoding device 100 and the decoding device 200. The motion information of the current block may be derived by using the motion information of a reconstructed neighboring block, the motion information of a co-located block (also referred to as a col block or a co-located block), and / or the motion information of a block adjacent to the co-located block. The co-located block may represent a block in a previously reconstructed co-located picture (also referred to as a col picture or a co-located picture) that is spatially located at the same position as the current block. The co-located picture may be one of the one or more reference pictures included in the reference picture list.

[0315] 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, triangle partition mode, inter-intra combined prediction mode, affine mode, etc. Here, the merge mode may be referred to as motion merge mode.

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

[0317] The encoding device 100 may calculate a motion vector difference (MVD) between a motion vector of a current block and a motion vector candidate, and may perform entropy encoding on the motion vector difference (MVD). In addition, the encoding device 100 may perform entropy encoding on a motion vector candidate index and generate a bitstream. The motion vector candidate index may indicate the best motion vector candidate among the motion vector candidates included in the motion vector candidate list. The decoding device may perform entropy decoding on the motion vector candidate index included in the bitstream, and may select a motion vector candidate for 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 the motion vector of the decoding target block.

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

[0319] 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 according to the sum of the entropy-decoded MVD and the affine controlled motion vector candidate.

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

[0321] 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, a merge candidate list may be generated using motion information of reconstructed neighboring blocks and / or motion information of co-located blocks. 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).

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

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

[0324] 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 a signal can be referred to as a merge mode with a motion vector difference.

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

[0326] The subblock merge mode may indicate a mode for deriving motion information in units of subblocks of a coding block (CU). When the subblock merge mode is applied, the subblock merge candidate list may be generated using motion information of a subblock co-located with the current subblock in a reference image (subblock-based temporal merge candidates) and / or affine control point motion vector merge candidates.

[0327] The triangular partition mode may denote a mode of deriving motion information by partitioning the current block into diagonal directions, deriving each prediction sample using each of the derived motion information, and deriving the prediction sample of the current block by weighting each of the derived prediction samples.

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

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

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

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

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

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

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

[0335] The decoder performs entropy decoding on the bit stream to obtain quantized level coefficients. The quantized level coefficients can be arranged in a two-dimensional block form by reverse scanning. For reverse scanning, at least one of diagonal upper right scanning, vertical scanning, and horizontal scanning can be used.

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

[0337] Inverse mapping in the dynamic range can be performed for the luminance component reconstructed by intra-frame prediction or inter-frame prediction before in-loop filtering. The dynamic range can be divided into 16 equal segments, and the mapping function of each segment can be sent 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. In-loop filtering, reference picture storage and motion compensation are performed in the inverse mapping area, and the prediction block generated by inter-frame prediction is converted to the mapping area via mapping using the mapping function, and then used to generate a reconstructed block. However, since intra-frame prediction is performed in the mapping area, the prediction block generated via intra-frame prediction can be used to generate a reconstructed block without mapping / inverse mapping.

[0338] When the current block is a residual block of a chroma component, the residual block can be converted to an inverse mapping area by performing scaling on the chroma component of the mapping area. The availability of scaling can be signaled at the slice level or the parallel block group level. Scaling can be applied only when the mapping of the luminance component is available and the division of the luminance component and the division of the chroma component follow the same tree structure. Scaling can be performed based on the average value of the sample value of the luminance prediction block corresponding to the chroma block. In this case, when the current block uses inter-frame prediction, the luminance prediction block can represent the mapped luminance prediction block. The value required for scaling can be derived by using the index reference lookup table of the fragment to which the average value of the sample value of the luminance prediction block belongs. Finally, the residual block can be converted to an inverse mapping area by scaling the residual block using the derived value. Then, chroma component block recovery, intra-frame prediction, inter-frame prediction, in-loop filtering, and reference picture storage can be performed in the inverse mapping area.

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

[0340] 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 blocks in the reconstructed area. For example, the value of the block vector can be limited so that the prediction block of the current block is located in the 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.

[0341] Hereinafter, an image encoding / decoding method according to the present invention will be described based on the above contents.

[0342] Hereinafter, an embodiment of encoding / decoding a current block using encoding parameters of neighboring blocks will be described.

[0343] For example, in the above-mentioned block partition structure, at least one of the encoding parameters of the neighboring blocks may be used as at least one of the encoding parameters of the current block.

[0344] For example, at least one type of information of a neighboring block selected from unit partition information, whether to perform quadtree partitioning, whether to perform binary tree partitioning, a partition direction (vertical or horizontal) of binary tree partitioning, a partition type (symmetric or asymmetric) of binary tree partitioning, a partition ratio of binary tree partitioning, whether to perform ternary tree partitioning, a partition direction (vertical or horizontal) of ternary tree partitioning, a partition type (symmetric or asymmetric) of ternary tree partitioning, and a partition ratio of ternary tree partitioning may be used as at least one type of information of a current block selected from unit partition information, whether to perform quadtree partitioning, whether to perform binary tree partitioning, a partition direction (vertical or horizontal) of binary tree partitioning, a partition type (symmetric or asymmetric) of binary tree partitioning, a partition ratio of binary tree partitioning, whether to perform ternary tree partitioning, a partition direction (vertical or horizontal) of ternary tree partitioning, a partition type (symmetric or asymmetric) of ternary tree partitioning, and a partition ratio of ternary tree partitioning.

[0345] For example, in the above-mentioned block partition structure, at least one of the encoding parameters of the neighboring blocks may be used to derive at least one of the encoding parameters of the current block.

[0346] For example, at least one type of information about a neighboring block selected from unit partition information, whether to perform quadtree partitioning, whether to perform binary tree partitioning, a binary tree partition direction, a binary tree partition type, a partition ratio of binary tree partitioning, whether to perform ternary tree partitioning, a ternary tree partition direction, a ternary tree partition type, and a partition ratio of ternary tree partitioning can be used to derive at least one type of information about a current block selected from unit partition information, whether to perform quadtree partitioning, whether to perform binary tree partitioning, a partition direction (vertical or horizontal) of binary tree partitioning, a partition type (symmetric or asymmetric) of binary tree partitioning, a partition ratio of binary tree partitioning, whether to perform ternary tree partitioning, a partition direction (vertical or horizontal) of ternary tree partitioning, a partition type (symmetric or asymmetric) of ternary tree partitioning, and a partition ratio of ternary tree partitioning.

[0347] Here, the case of deriving at least one of the encoding parameters of the current block using at least one of the encoding parameters of the neighboring blocks may mean determining or deriving at least one of the encoding parameters of the current block using at least one of the encoding parameters of the neighboring blocks.

[0348] For example, in the above block partition structure, at least one of the coding parameters of a neighboring block may be used to drive at least one of the coding parameters of another neighboring block.

[0349] For example, at least one type of information about a neighboring block selected from unit partition information, whether to perform quadtree partitioning, whether to perform binary tree partitioning, a binary tree partition direction, a binary tree partition type, a partition ratio of binary tree partitioning, whether to perform ternary tree partitioning, a ternary tree partition direction, a ternary tree partition type, and a partition ratio of ternary tree partitioning may be used to derive at least one type of information about another neighboring block selected from unit partition information, whether to perform quadtree partitioning, whether to perform binary tree partitioning, a partition direction (vertical or horizontal) of binary tree partitioning, a partition type (symmetric or asymmetric) of binary tree partitioning, a partition ratio of binary tree partitioning, whether to perform ternary tree partitioning, a partition direction (vertical or horizontal) of ternary tree partitioning, a partition type (symmetric or asymmetric) of ternary tree partitioning, and a partition ratio of ternary tree partitioning.

[0350] Here, the case of using at least one of the encoding parameters of the neighboring block to derive at least one of the encoding parameters of another neighboring block may mean that at least one of the encoding parameters of the neighboring block is used to determine or derive at least one of the encoding parameters of another neighboring block.

[0351] For example, in the above-mentioned block partition structure, at least one of the encoding parameters of the neighboring blocks may be used in a process of performing intra prediction on the current block.

[0352] For example, in the process of performing intra-frame prediction on the current block, at least one type of information selected from the intra-frame prediction mode, intra-frame prediction direction, reference sample point filtering method, prediction block filtering method, prediction block filter taps and prediction block filter coefficients of the neighboring blocks can be used.

[0353] For example, in the above-mentioned block partition structure, at least one of the encoding parameters of the neighboring blocks may be used in a process of performing inter-frame prediction or motion compensation on the current block.

[0354] For example, at least one of the inter-frame prediction mode, motion information, motion vector, reference picture index, inter-frame prediction direction, inter-frame prediction indicator, reference picture list, motion vector predictor, motion vector candidate list, merge mode utilization information, merge candidate, merge candidate list, skip mode utilization information, interpolation filter type, interpolation filter taps, interpolation filter coefficients, motion vector size, and motion vector representation accuracy of neighboring blocks can be used to perform inter-frame prediction or motion compensation processing on the current block.

[0355] For example, in the above-mentioned block partition structure, at least one of the coding parameters of the neighboring blocks may be used in the process of performing transformation, inverse transformation, quantization or inverse quantization on the current block. Here, the transformation and inverse transformation may include at least one of the first transformation, the second transformation, the first inverse transformation and the second inverse transformation.

[0356] For example, at least one type of information selected from transform type, transform size, information about utilization of first transform, information about utilization of second transform, first transform index, second transform index, residual signal presence information, coding block mode, coding block flag, quantization parameter and quantization matrix may be used for transform, inverse transform, quantization or inverse quantization of the current block.

[0357] For example, in the above-mentioned block partition structure, at least one of the encoding parameters of the neighboring blocks may be used for entropy encoding / entropy decoding of the current block.

[0358] For example, at least one type of information about a neighboring block selected from unit partition information, whether quadtree partitioning is performed, whether binary tree partitioning is performed, binary tree partitioning direction, binary tree partitioning type, partition ratio of binary tree partitioning, whether ternary tree partitioning is performed, ternary tree partitioning direction, ternary tree partitioning type, and partition ratio of ternary tree partitioning can be used to entropy encode / decode at least one type of information of a current block selected from unit partition information, whether quadtree partitioning is performed, whether binary tree partitioning is performed, partition direction of binary tree partitioning (vertical or horizontal), partition type of binary tree partitioning (symmetric or asymmetric), partition ratio of binary tree partitioning, whether ternary tree partitioning is performed, partition direction of ternary tree partitioning (vertical or horizontal), partition type of ternary tree partitioning (symmetric or asymmetric), and partition ratio of ternary tree partitioning. Here, entropy encoding / decoding may include determining a binarization / debinarization method, determining a context model, updating a context model, executing a normal mode, and executing a bypass mode.

[0359] As another example, at least one of the encoding parameters of the neighboring blocks in the above block partition structure can be used to filter the current block using an in-loop filter, a deblocking filter, an adaptive sample offset, an adaptive in-loop filter, etc.

[0360] For example, information about neighboring blocks selected from information including whether to apply an in-loop filter, in-loop filter coefficients, in-loop filter taps, in-loop filter shape, in-loop filter type, whether to apply a deblocking filter, deblocking filter coefficients, deblocking filter taps, deblocking filter strength, deblocking filter shape, deblocking filter type, whether to apply an adaptive sample offset, an adaptive sample offset value, an adaptive sample offset category, an adaptive sample offset type, whether to apply an adaptive in-loop filter, adaptive in-loop filter coefficients, adaptive in-loop filter taps, adaptive in-loop filter shape and adaptive in-loop filter type can be used for filtering of the current block (such as deblocking filtering, adaptive sample offset filtering, adaptive in-loop filtering, etc.).

[0361] As another example, at least one of the encoding parameters of the neighboring blocks in the above-mentioned block partition structure can be used for intra-frame prediction of the current block, inter-frame prediction or motion compensation of the current block, entropy encoding / entropy decoding of the current block, and filtering the current block using an intra-loop filter, a deblocking filter, an adaptive sample offset, an adaptive in-loop filter, etc.

[0362] For example, in the above-mentioned block partition structure, at least one of the coding parameters of the luminance signal block can be used as at least one of the coding parameters of the chrominance signal block. For example, in the above-mentioned block partition structure, at least one of the coding parameters of the luminance signal block can be used to derive at least one of the coding parameters of the chrominance signal block. As another example, at least one of the coding parameters of the luminance signal block in the above-mentioned block partition structure can be used for intra-frame prediction of the chrominance signal block, inter-frame prediction or motion compensation of the chrominance signal block, entropy encoding / entropy decoding of the chrominance signal block, and filtering of the chrominance signal block using an intra-frame loop filter, a deblocking filter, an adaptive sample offset, an adaptive loop filter, etc.

[0363] For example, in the above-mentioned block partition structure, at least one coding parameter of the Cb / Cr signal block may be used as at least one coding parameter of the Cr / Cb signal block. For example, in the above-mentioned block partition structure, at least one coding parameter of the Cb / Cr signal block may be used to derive at least one coding parameter of the Cr / Cb signal block. As another example, at least one of the coding parameters of the Cb / Cr signal block in the above-mentioned block partition structure may be used for intra-frame prediction of the Cr / Cb signal block, inter-frame prediction or motion compensation of the Cr / Cb signal block, entropy encoding / entropy decoding of the Cr / Cb signal block, and filtering of the Cr / Cb signal block using an in-loop filter, a deblocking filter, an adaptive sample offset, an adaptive in-loop filter, etc.

[0364] For each block generated by block partitioning based on the block partition structure, at least one of the encoding parameters and information described below may be entropy encoded / decoded. In addition, a method indicated by the information described below may be performed according to at least one piece of information entropy encoded / decoded and / or at least one of a block size and a block shape.

[0365] For example, the motion information may include at least one piece of information selected from a motion vector, a reference picture index, an inter-frame prediction indicator, skip mode utilization information (skip_flag), merge mode utilization information (merge_flag), merge index information (merge_index) and motion vector resolution information, overlapped block motion compensation information, local illumination compensation information, affine motion compensation information, decoder-side motion vector derivation information and bidirectional optical flow information.

[0366] The motion vector resolution information may be information indicating whether a specific resolution is used for at least one of a motion vector and a motion vector difference. Here, the resolution may indicate accuracy. In addition, the specific resolution may be set to any one unit selected from an integer pixel unit, a 1 / 2-pel unit, a 1 / 4-pel unit, a 1 / 8-pel unit, a 1 / 16-pel unit, a 1 / 32-pel unit, and a 1 / 64-pel unit.

[0367] The overlapped block motion compensation information may be information indicating whether to calculate a weighted sum of prediction blocks of the current block by additionally using motion vectors of neighboring blocks spatially adjacent to the current block when performing motion compensation of the current block.

[0368] The local illumination compensation information may be information indicating whether at least one of a weight value and an offset value is applied when generating a prediction block of a current block. Here, the weight value and the offset value may be values ​​calculated using information about a reference block.

[0369] The affine motion compensation information may be information indicating whether an affine motion model is used when performing motion compensation on the current block. Here, the affine motion model may be a model that divides a block into a plurality of sub-blocks using a plurality of parameters and calculates a motion vector of each sub-block using a representative motion vector.

[0370] The decoder-side motion vector derivation information may be information indicating whether a motion vector required for motion compensation is derived at the decoder side. Depending on the decoder-side motion vector derivation information, entropy encoding / decoding may not be performed on the information about the motion vector. When the decoder-side motion vector derivation information indicates that the decoder derives and uses a motion vector, entropy encoding / decoding may be performed on the information about the merge mode. That is, the decoder-side motion vector derivation information may indicate whether the decoder uses the merge mode.

[0371] The bidirectional optical flow information may be information indicating whether motion compensation is performed by refining the motion vector on a pixel basis or on a sub-block basis. Depending on the bidirectional optical flow information, entropy encoding / decoding may not be performed on a motion vector per pixel or a motion vector per sub-block. Here, motion vector refinement may refer to a process of changing a motion vector value from a block-based motion vector to a pixel-based motion vector or a sub-block-based motion vector.

[0372] When an image is divided into prediction units (PUs), transform units (TUs), prediction blocks (PBs), or transform blocks (TBs), units or blocks may be generated according to at least one embodiment associated with a coding unit.

[0373] Hereinafter, a method of determining a reference block of a current block in the above-mentioned block structure will be described.

[0374] The image may be encoded / decoded according to at least one or a combination of the embodiments described below. By effectively determining the reference block of the current block in the image encoding / decoding process using the embodiments described below, the encoding efficiency of the image encoder and the decoding efficiency of the image decoder may be improved.

[0375] In addition, a block to be described later may represent a unit, and a candidate list to be described later may represent a candidate set including at least one candidate.

[0376] Here, in one or more of the image encoding / decoding processing steps including inter-frame prediction, intra-frame prediction, transformation, inverse transformation, quantization, dequantization, entropy encoding, entropy decoding and in-loop filtering, a reference block of the current block can be determined.

[0377] Figures 8a to 8c is a flowchart illustrating an image encoding / decoding method according to an embodiment of the present invention.

[0378] Reference Figure 8a The image encoding / decoding method according to the present invention includes: step S810, dividing the current picture into a plurality of blocks; step S820, inserting the neighboring blocks adjacent to the current block into a candidate list for encoding / decoding the current block; and step S830, determining the neighboring blocks in the candidate list as reference blocks for encoding / decoding the current block. Figure 8a The current block in may represent a decoding target subblock of one of the subblocks generated by block partitioning.

[0379] In order to divide the current picture into multiple sub-blocks, you can use the above reference Figure 3 At least one or a combination of the embodiments described regarding block partition structure and partition method.

[0380] exist Figure 8b and Figure 8c In the present invention, the current block may refer to a currently decoded / decoded target block included in the current picture and divided into a plurality of sub-blocks.

[0381] Reference Figure 8b , a method in which a decoding device divides a current picture into a plurality of sub-blocks will be described.

[0382] The block partitioning method according to the present invention includes: decoding block partition information about a current block included in a current picture (S811a); determining a partition scheme of the current block using the block partition information (S812a), and partitioning the current block using the determined partition scheme (S813a).

[0383] The partition scheme is determined according to whether the current block includes the boundary of the current picture.

[0384] Reference Figure 8c , a method in which an encoding device divides a current picture into a plurality of sub-blocks will be described.

[0385] The block partitioning method according to the present invention includes: a step of determining a partition scheme of a current block included in a current picture (S811b); a step of partitioning the current block using the determined partition scheme (S812b); and a step of encoding block partition information about the current block (S812c).

[0386] For example, the partition scheme is determined according to whether the current block includes the boundary of the current picture.

[0387] The reference block of the current block may be selected from a candidate list including adjacent blocks or block information of adjacent blocks. Here, in one or more steps of the image encoding / decoding processing steps including inter-frame prediction, intra-frame prediction, transform, inverse transform, quantization, inverse quantization, entropy encoding, entropy decoding, and in-loop filtering, the current block may be encoded / decoded using the determined reference block.

[0388] The reference block may represent at least one piece of block information of the reference block. That is, at least one of the image encoding / decoding processes may be performed on the current block using the determined block information of the reference block. Here, the block information of the reference block may be determined as the block information of the current block. The reference block may represent at least one piece of block information of the reference block.

[0389] Here, the neighboring block of the current block means one of the spatial neighboring blocks including the upper neighboring block adjacent to the upper boundary of the current block, the upper left neighboring block adjacent to the upper left corner of the current block, the upper right neighboring block adjacent to the upper right corner of the current block, the left neighboring block adjacent to the left boundary of the current block, and the lower left neighboring block adjacent to the lower left corner of the current block. In addition, the neighboring block may be at least one of the spatial neighboring blocks adjacent to the boundary of the current block. The neighboring block refers to a block located outside the boundary of the CTU to which the current block belongs, and specifically refers to one of the spatial neighboring blocks adjacent to the boundary of the current block. The neighboring block refers to at least one of the spatial neighboring blocks including one or more samples located outside the current block and adjacent to a specific sample position in the current block. The neighboring block refers to a block located outside the boundary of the CTU to which the current block belongs, and refers to one of the spatial neighboring blocks including one or more samples located outside the current block and adjacent to a specific sample position in the current block. That is, the neighboring block may refer to a neighboring block adjacent to the current block in space / time, and may refer to a reconstructed neighboring block.

[0390] The neighboring block may represent at least one piece of block information of the neighboring block. That is, including the neighboring block in the candidate list may represent that the block information of the neighboring block is included in the candidate list. Therefore, the neighboring block mentioned below may be used as a term referring to at least one piece of block information of the neighboring block.

[0391] That is, a block may be indicated as a candidate of a block itself, or may be indicated as a candidate of a piece of information about a block. In the embodiments described below, for convenience, block information and corresponding blocks are collectively referred to as blocks.

[0392] The block information may mean at least one of information about a neighboring block, information about a reference block, and information about a current block.

[0393] The block information may include at least one of the encoding parameters of the block. For example, the block information represents information used in at least one process selected from inter-frame prediction, intra-frame prediction, transform, inverse transform, quantization, inverse quantization, entropy coding, entropy decoding and in-loop filtering. Specifically, the block information refers to any one or combination of the following parameters: block size, block depth, block partition information, block form (square or non-square), whether to perform quadtree partitioning, whether to perform binary tree partitioning, binary tree partition direction (horizontal or vertical), binary tree partition type (symmetric or asymmetric), prediction mode (intra-frame or inter-frame), luminance intra-frame prediction mode / direction, chrominance intra-frame prediction mode / direction, intra-frame prediction partition information, inter-frame prediction partition information, coding block partition flag, prediction block partition flag, transform block partition flag, reference sample filter tap. Reference sample filter coefficient, prediction block filter tap, prediction block filter coefficient, prediction block boundary filter tap, prediction block boundary filter coefficient, motion vector (motion vector of at least one of L0, L1, L2, L3, etc.), motion vector difference (motion vector difference of at least one of L0, L1, L2, L3, etc.), direction of inter prediction (unidirectional or bidirectional), reference picture index (reference picture index of at least one of L0, L1, L2, L3, etc.), inter prediction indicator, prediction list utilization information (whether used), reference picture list, motion vector prediction index, motion vector prediction candidate, motion vector candidate list, merge mode information (whether used), merge index, merge candidate, merge candidate list, skip mode information (whether used), interpolation filter type, interpolation filter tap, interpolation filter coefficient, motion vector size, motion vector precision degree (integer samples, 1 / 2 samples, 1 / 4 samples, 1 / 8 samples, 1 / 16 samples, 1 / 32 samples, etc.), transform type, transform size, first transform utilization information (whether used), second transform utilization information (whether used), first transform index, second transform index, residual signal existence information (whether exists), coding block mode, coding block flag, coding parameter, residual quantization parameter, quantization matrix, in-frame loop filter application information (whether applied), in-frame loop filter coefficient, in-frame loop filter tap, in-frame loop filter shape / form, deblocking filter application information (whether applied), deblocking filter coefficient, deblocking filter tap, deblocking filter strength, deblocking filter shape / form, adaptive sample offset (SAO) application information (whether applied), adaptive sample offset value, adaptive sample offset category, adaptive sample offset type,Adaptive loop filter (ALF) application information (whether applied), adaptive loop filter coefficients, adaptive loop filter taps, adaptive loop filter shape / form, binarization / debinarization method, context model decision method, context model update method, normal mode utilization information (whether used), bypass mode utilization flag, context binary bit, bypass binary bit, valid coefficient flag, last valid coefficient flag, encoding flag according to each coefficient group, position of the last valid flag, flag indicating whether the coefficient value is greater than 1, flag indicating whether the coefficient value is greater than 2, flag indicating whether the coefficient value is greater than 3, remaining coefficient value information, sign information, reconstruction Luma samples, reconstructed chroma samples, residual luma samples, residual chroma samples, luma transform coefficients, chroma transform coefficients, luma quantization levels, chroma quantization levels, transform coefficient level scanning method, size of the motion vector search area at the decoder side, shape of the motion vector search area at the decoder side, motion vector search frequency at the decoder side, CTU size, minimum block size, maximum block size, maximum block depth, minimum block depth, slice identification information, slice partition information, parallel block identification information, parallel block type, parallel block partition information, bit depth of input samples, bit depth of reconstructed samples, bit depth of residual samples, bit depth of transform coefficients, and bit depth of quantization levels.

[0394] For example, when entropy encoding / decoding quadtree partition information, a context model may be determined by comparing a depth value of a current block with a depth value of a neighboring block.

[0395] As another example, when entropy encoding / decoding information on whether to split the current coding unit, the context model may be determined by comparing the height and / or width of the current block with the height and / or width of each neighboring block.

[0396] As another example, when entropy encoding / decoding information on whether to skip decoding of a current coding unit, a context model may be determined in consideration of information on whether to skip decoding of a neighboring block.

[0397] As another example, when entropy encoding / decoding prediction mode information of a current coding unit, a context model may be determined considering prediction modes of neighboring blocks.

[0398] As another example, when entropy encoding / decoding information on whether intra block copy (IBC) is performed on a current coding unit, a context model may be determined considering information on whether IBC is performed on a neighboring block.

[0399] As another example, when entropy encoding / decoding information on whether a sub-block based merge mode will be performed on a current coding unit, the context model may be determined by considering information on whether a neighboring block has undergone the sub-block based merge mode and affine mode.

[0400] As yet another example, when entropy encoding / decoding information on whether to perform an affine mode on a current coding unit, a context model may be determined considering whether a neighboring block has undergone a merge mode based on a sub-block and information on the affine merge mode.

[0401] First, step S820 of inserting the neighboring blocks into the candidate list will be described in detail.

[0402] At least one neighboring block (up to V neighboring blocks) that is spatially / temporally adjacent to the current block may be inserted into the candidate list of the current block. At least one (up to V) piece of block information of a neighboring block that is spatially / temporally adjacent to the current block may be inserted into the candidate list of the current block.

[0403] Here, V may be 0 or any positive integer. V may be determined based on at least one of the encoding parameters of the current block and the encoding parameters of the candidate block. In addition, V may be a value preset in the encoder / decoder or a value signaled from the encoder to the decoder.

[0404] When the neighboring block is included in the same picture (picture) as the current block, a sub-picture in the same picture, a slice in the same picture, a tile in the same picture, a partition in the same picture, or a CTU in the same picture, the neighboring block is referred to as a spatial neighboring block that is spatially adjacent to the current block. When the neighboring block is included in a different picture from the current block, a slice in a different picture, a tile in a different picture, or a CTU in a different picture, the neighboring block is referred to as a temporal neighboring block that is temporally adjacent to the current block.

[0405] In the following, reference will be made to Figures 9 to 23 An embodiment of inserting the above-mentioned spatial neighboring block or temporal neighboring block into the candidate list is described in detail. The encoder or decoder can add the spatial neighboring block or temporal neighboring block of the current block to the candidate list of the current block or insert the spatial neighboring block or temporal neighboring block of the current block into the candidate list of the current block by using at least one or at least one combination of the methods described below.

[0406] Fig. 9 and Fig.10 is a diagram illustrating a method of inserting a neighboring block adjacent to a current block into a candidate list according to an embodiment of the present invention.

[0407] At least one neighboring block (up to V neighboring blocks) adjacent to the current block may be inserted into the candidate list of the current block. Here, V may be 0 or any positive integer. In this case, the neighboring block being adjacent to the current block may mean that at least one of a boundary and a vertex of the current block contacts at least one of a boundary and a vertex of the neighboring block.

[0408] Here, a block located within a distance corresponding to the vertical size of the current block from the upper end position of the current block may be referred to as a neighboring block adjacent to the current block. Here, a block located within a distance corresponding to the horizontal size of the current block from the left end position of the current block may be referred to as a neighboring block adjacent to the current block.

[0409] Neighboring blocks adjacent to the boundary of the current block may be preferentially inserted into the candidate list, and then neighboring blocks adjacent to the vertices of the current block may be inserted into the candidate list. Neighboring blocks adjacent to the vertices of the current block may be preferentially inserted into the candidate list, and then neighboring blocks adjacent to the boundary of the current block may be inserted into the candidate list.

[0410] A neighboring block adjacent to the left boundary of the current block may be preferentially inserted into the candidate list, and a neighboring block adjacent to the upper boundary of the current block may be subsequently inserted into the candidate list. A neighboring block adjacent to the upper boundary of the current block may be preferentially inserted into the candidate list, and a neighboring block adjacent to the left boundary of the current block may be subsequently inserted into the candidate list.

[0411] Even when there is at least one block between the current block and the neighboring block, the neighboring block may be represented as being adjacent to the current block. Fig. 9 , blocks E, F, H, I, K, L, N, and R can be represented as adjacent to the current block.

[0412] because Fig. 9 and Fig.10 The gray block in is adjacent to the current block X, so Fig. 9 and Fig.10 The gray blocks in represent neighboring blocks that can be inserted into the candidate list. Here, blocks B, C, and D may be child blocks generated by ternary tree partitioning of the parent node, blocks E, F, and G may be child blocks generated by horizontal ternary tree partitioning of the parent block, blocks P and Q may be child blocks generated by horizontal binary tree partitioning of the parent block, blocks R and S may be child blocks generated by vertical binary tree partitioning of the parent block, blocks H, I, J, and K may be child blocks generated by quadtree partitioning of the parent block, and blocks L, M, N, and O may be child blocks generated by quadtree partitioning of the parent block. This block partitioning example is generally used in subsequent figures.

[0413] In this instance, Fig. 9 The candidate list in the example of may be configured to include at least one of blocks A, B, C, D, and E adjacent to the current block X. Fig.10 In the example, the candidate list is configured to include at least one block of neighboring blocks A, B, C, D, G, J, M, O, P, Q and S to the current block X.

[0414] Fig.11 and Fig.12is a diagram illustrating a method of inserting a neighboring block adjacent to a current block into a candidate list according to a length of a boundary between the current block and the neighboring block according to an embodiment of the present invention.

[0415] Among the neighboring blocks that are in contact with the current block, up to V neighboring blocks can be inserted into the candidate list of the current block. Among the neighboring blocks that are in contact with the current block through a horizontal boundary or vertical boundary length equal to or greater than N or more, up to V neighboring blocks can be inserted into the candidate list of the current block.

[0416] When there is no neighboring block that contacts the current block with a boundary length equal to or greater than N among the neighboring blocks of the current block, N is replaced with NK, and the neighboring blocks that meet the changed condition can be used to construct the candidate list of the current block. Here, K can represent a positive integer greater than zero. That is, among the neighboring blocks that contact the current block with a boundary length of NK or greater and less than N, a maximum of V neighboring blocks can be inserted into the candidate list of the current block.

[0417] For example, N can be expressed as 2 raised to the power of n (=2 n ) is a positive integer (such as 2, 4, 8, 16, etc.). Optionally, N can be determined according to at least one of the encoding parameters of the current block and the encoding parameters of the candidate block. In addition, N can be a value preset in the encoder / decoder or a value sent from the encoder to the decoder by signaling.

[0418] For example, neighboring blocks that are in contact with the current block may be preferentially inserted into the candidate list in the order of decreasing boundary length. For example, neighboring blocks that are in contact with the current block may be preferentially inserted into the candidate list in the order of increasing boundary length.

[0419] Among neighboring blocks that contact the current block with a boundary length ranging from N to M, up to V neighboring blocks may be inserted into the candidate list of the current block. Here, each of M and N may be expressed as 2 to the power of n (=2 n ) is a positive integer (such as 2, 4, 8, 16, etc.).

[0420] exist Fig.11 In the figure, because each of the gray blocks is in contact with the current block X and has a boundary length of N or more between the current block and the corresponding neighboring block, the gray blocks represent neighboring blocks that can be inserted into the candidate list. For example, block X is a 32×32-sized block, block A represents a 16×16-sized block, blocks B and D are 4×16-sized blocks, block C is an 8×16-sized block, blocks E and F are 16×4-sized blocks, block F is a 16×8-sized block, blocks H, I, J, K, L, M, N, and O are 8×8-sized blocks, blocks P and Q are 16×8-sized blocks, and blocks R and S are 8×16-sized blocks. These block size examples are generally used in subsequent figures of the accompanying drawings.

[0421] For example, in Fig.11 In the example of , a neighboring block having a boundary length of 8 or more in contact with the current block may be included in the candidate list. In this case, the candidate list of the current block X is configured to include at least one of blocks C, G, M, O, P, and Q.

[0422] exist Fig.12 In the example, since each of the gray blocks is in contact with the current block X and has a boundary length of N or more between the current block and the corresponding neighboring block, the gray blocks represent neighboring blocks that can be inserted into the candidate list. For example, neighboring blocks with a boundary length of 16 or more that are in contact with the current block may be included in the candidate list. In this case, the candidate list is configured to include block G.

[0423] Fig.13 and Fig.14 is a diagram illustrating a method of inserting neighboring blocks adjacent to a current block into a candidate list according to sizes of the neighboring blocks according to an embodiment of the present invention.

[0424] According to the size of each neighboring block, a maximum of V neighboring blocks among all neighboring blocks of the current block may be inserted into the candidate list of the current block. Hereinafter, the size of a block may represent at least one of a horizontal size, a vertical size, and an area.

[0425] For example, up to V neighboring blocks of size M×N or larger may be inserted into the candidate list of the current block. As another example, up to V neighboring blocks of size M×N or smaller may be inserted into the candidate list of the current block.

[0426] As another example, a maximum of V neighboring blocks having sizes ranging from M×N to P×Q may be inserted into the candidate list of the current block. Here, P may represent the horizontal size of the block, Q may represent the vertical size of the block, and each of P and Q may be a positive integer.

[0427] As yet another example, when at least one of the horizontal size and the vertical size of a specific neighboring block is greater than M or N, the neighboring block may be inserted into the candidate list.

[0428] As yet another example, a maximum of V neighboring blocks among all neighboring blocks of the current block having an area equal to or greater than the product of M and N may be inserted into the candidate list of the current block. As yet another example, a maximum of V neighboring blocks among all neighboring blocks of the current block having an area equal to or less than the product of M and N may be inserted into the candidate list of the current block. As yet another example, a maximum of V neighboring blocks among all neighboring blocks of the current block having an area ranging from the product of M and N to the product of P and Q may be inserted into the candidate list of the current block.

[0429] Here, M may represent the horizontal size of the block, N may represent the vertical size of the block, and each of M and N may be a positive integer. In addition, M and N may be the same value or different values. At least one of M and N may be determined according to at least one of the encoding parameters of the current block and the encoding parameters of the candidate block. In addition, at least one of M and N may be a value preset in the encoder / decoder or a value sent by a signal from the encoder to the decoder.

[0430] For example, neighboring blocks adjacent to the current block may be preferentially inserted into the candidate list in the order of decreasing block size. Alternatively, neighboring blocks adjacent to the current block may be preferentially inserted into the candidate list in the order of increasing block size.

[0431] As yet another example, when the size of a specific neighboring block is equal to or larger than the current block, the neighboring block may be inserted into the candidate list. Alternatively, when the size of a specific neighboring block is equal to or smaller than the current block, the neighboring block may be inserted into the candidate list.

[0432] exist Fig.13 In the example, since the gray block has a size equal to or larger than the size of M×N, the gray block indicates a neighboring block that can be inserted into the candidate list. For example, when a specific neighboring block has a size of 16×8 or a size of 8×16 and the neighboring block can be inserted into the candidate list, the candidate list of the current block X is configured to include at least one of blocks A, C, P, Q, and S.

[0433] exist Fig.14 In the example, the gray block indicates a neighboring block that can be inserted into the candidate list because it has an area equal to or greater than the product of M and N (M×N). For example, when a specific neighboring block has an area of ​​128 (=16×8) or (=8×16), the neighboring block can be inserted into the candidate list, and the candidate list of the current block X is configured to include at least one of blocks A, C, F, P, Q, R, and S.

[0434] Fig.15 and Fig.16 is a diagram illustrating a method of inserting a neighboring block adjacent to a current block into a candidate list according to depths of the neighboring blocks according to an embodiment of the present invention.

[0435] According to the depth of each neighboring block, at most V neighboring blocks among all neighboring blocks of the current block may be inserted into the candidate list of the current block.

[0436] For example, at most V neighboring blocks having a depth equal to or greater than K among the neighboring blocks may be inserted into the candidate list of the current block. Alternatively, at most V neighboring blocks having a depth equal to or less than K among the neighboring blocks may be inserted into the candidate list of the current block.

[0437] Alternatively, at most V neighboring blocks of all neighboring blocks of the current block whose depths are in the range of K to L may be inserted into the candidate list of the current block. Here, L may be 0 or any positive integer.

[0438] Here, K may be 0 or any positive integer. K may be determined based on at least one of the encoding parameters of the current block and the encoding parameters of the candidate block. In addition, K may be a value preset in the encoder / decoder or a value sent by a signal from the encoder to the decoder.

[0439] For example, neighboring blocks adjacent to the current block may be preferentially inserted into the candidate list in the order of decreasing partition depth. Alternatively, neighboring blocks adjacent to the current block may be preferentially inserted into the candidate list in the order of increasing partition depth.

[0440] As yet another example, when a particular neighboring block has a depth equal to or greater than the depth of the current block, the neighboring block may be inserted into the candidate list.As yet another example, when a particular neighboring block has a depth equal to or less than the depth of the current block, the neighboring block may be inserted into the candidate list.

[0441] exist Fig.15 , because it has a depth equal to or greater than K, the gray block is a neighboring block that can be inserted into the candidate list. For example, the current block X has a depth of 1, block A has a depth of 2, and blocks B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, and S have a depth of 3. These block depth examples are generally applicable to subsequent figures of the accompanying drawings. For example, when a particular neighboring block has a depth equal to or greater than 3 and the neighboring block can be inserted into the candidate list, the candidate list of the current block X is configured to include at least one of blocks B, C, D, E, F, G, J, K, M, O, P, Q, and S.

[0442] exist Fig.16 In the example, since the gray block has a depth equal to or less than K, the gray block is a neighboring block that can be inserted into the candidate list. For example, when a specific neighboring block has a depth equal to or less than 2 and the neighboring block can be inserted into the candidate list, the candidate list of the current block X is configured to include block A.

[0443] Fig.17 and Fig.18 is a diagram illustrating a method of inserting a neighboring block adjacent to a current block into a candidate list according to a partition type of the neighboring block according to an embodiment of the present invention.

[0444] According to the partition type of each neighboring block, at most V neighboring blocks among all neighboring blocks of the current block may be inserted into the candidate list of the current block.

[0445] For example, at least one of the quadtree blocks generated by the quadtree partition in the neighboring blocks of the current block may be inserted into the candidate list of the current block. Alternatively, at least one of the binary tree blocks generated by the binary tree partition in the neighboring blocks of the current block may be inserted into the candidate list of the current block. Alternatively, at least one of the ternary tree blocks generated by the ternary tree partition in the neighboring blocks of the current block may be inserted into the candidate list of the current block.

[0446] Here, the binary tree partition may refer to an asymmetric binary tree partition in which nodes have different sizes and a symmetric binary tree partition in which nodes have the same size. In addition, the ternary tree partition may refer to an asymmetric ternary tree partition in which the upper block and the lower block on both sides of the middle block have different sizes or the left block and the right block on both sides of the middle block have different sizes, and a symmetric ternary tree partition in which the upper block and the lower block have the same size or the left block and the right block have the same size.

[0447] Among the neighboring blocks adjacent to the current block, the neighboring blocks of the quadtree partition, the neighboring blocks of the binary tree partition, and the neighboring blocks of the ternary tree partition can be sequentially inserted into the candidate list in this order. Alternatively, among the neighboring blocks of the current block, the neighboring blocks generated by the ternary tree partition, the neighboring blocks generated by the binary tree partition, and the neighboring blocks generated by the quadtree partition can be sequentially inserted into the candidate list in this order.

[0448] Alternatively, when the partition type of a specific neighboring block is the same as the partition type of the current block, the neighboring block may be inserted into the candidate list. Alternatively, when the partition type of a specific neighboring block is different from the partition type of the current block, the neighboring block may be inserted into the candidate list.

[0449] Fig.17 The state that the gray block can be inserted into the candidate list because the gray block is a neighboring block with a binary tree partition type is shown. For example, blocks X, A, H, I, J, K, L, M, N, and O are quadtree blocks, blocks B, C, D, E, F, and G are ternary tree blocks, and blocks P, Q, R, and S are binary tree blocks. These block partition type examples are generally used in subsequent figures of the accompanying drawings. For example, when a specific neighboring block is a ternary tree partition block, the neighboring block can be inserted into the candidate list. Therefore, the candidate list of the current block X is configured to include at least one of blocks B, C, D, E, F, and G.

[0450] Fig.18 1 shows a state in which the gray block can be inserted into the candidate list because the gray block is a neighboring block having the same partition type as the current block. For example, when the current block X is a quadtree block, the quadtree neighboring block can be inserted into the candidate list. Therefore, the candidate list of the current block X is configured to include at least one of blocks A, J, K, M, and O.

[0451] Fig.19 and Fig. 20 is a diagram illustrating a method of inserting neighboring blocks adjacent to a current block into a candidate list according to a block form of the neighboring blocks according to an embodiment of the present invention.

[0452] According to the block form of each neighboring block, at most V neighboring blocks among all neighboring blocks of the current block may be inserted into the candidate list of the current block.

[0453] For example, at least one neighboring block in a square form among the neighboring blocks of the current block may be inserted into the candidate list of the current block. Alternatively, at least one neighboring block in a non-square form (rectangular form) among the neighboring blocks of the current block may be inserted into the candidate list of the current block.

[0454] Among the neighboring blocks of the current block, square neighboring blocks are preferentially inserted into the candidate list, and then non-square neighboring blocks are inserted into the candidate list. Among the neighboring blocks of the current block, non-square neighboring blocks are preferentially inserted into the candidate list, and then square neighboring blocks are inserted into the candidate list.

[0455] Alternatively, when the block form of the specific neighboring block is the same as that of the current block, the neighboring block may be inserted into the candidate list. Further optionally, when the block form of the specific neighboring block is different from that of the current block, the neighboring block may be inserted into the candidate list.

[0456] Fig.19 The gray block is shown as a state in which the gray block can be inserted into the candidate list because the gray block is a neighboring block having a non-square block form. For example, when a specific neighboring block has a non-square block form, the neighboring block can be inserted into the candidate list. Therefore, the candidate list of the current block X is configured to include at least one of blocks B, C, D, G, Q, and S.

[0457] Fig. 20 1 shows a state in which the gray block can be inserted into the candidate list because the gray block is a neighboring block having the same block form as the current block. For example, when the current block X is a square block, the neighboring block having the square block form can be inserted into the candidate list. Therefore, the candidate list of the current block X is configured to include at least one of blocks A, J, K, M, and O.

[0458] When there is a neighboring block that contacts the current block at one or more boundaries or at one or more vertices, the neighboring block may be inserted into the candidate list according to at least one of a relative boundary length of the neighboring block, a relative block size of the neighboring block, and a relative block depth of the neighboring block.

[0459] For example, when there are a first neighboring block having a boundary length of M and a second neighboring block having a boundary length of N, M and N are compared, and a specific neighboring block may be inserted into the candidate list according to the comparison result.

[0460] For example, when there is a first neighboring block with a boundary length of 4 and a second neighboring block with a boundary length of 8, the second neighboring block with a relatively long boundary length (i.e., 8) may be inserted into the candidate list. For example, when there is a first neighboring block with a boundary length of 16 and a second neighboring block with a boundary length of 4, the second neighboring block with a relatively short boundary length (i.e., 4) may be inserted into the candidate list.

[0461] Optionally, when there is a first neighboring block of size N×M and a second neighboring block of size P×Q, the sizes of the two neighboring blocks are compared, and only the specific neighboring block can be inserted into the candidate list according to the comparison result. In this case, N, M, P and Q can each be the same positive integer or different positive integers.

[0462] Alternatively, when there are a first neighboring block having a size of 8×8 and a second neighboring block having a size of 16×16, the second neighboring block having a relatively large size (ie, 16×16) may be inserted into the candidate list.

[0463] Further optionally, when there is a first neighboring block having a block depth M and a second neighboring block having a block depth N, M and N are compared, and a specific neighboring block therein may be inserted into the candidate list according to the comparison result.

[0464] For example, when there are a first neighboring block having a block depth of 0 and a second neighboring block having a block depth of 2, the first neighboring block having a relatively shallow depth of 0 may be inserted into the candidate list.

[0465] Fig.21 is a diagram illustrating a method of inserting neighboring blocks into a candidate list in an encoding / decoding order according to an embodiment of the present invention.

[0466] The earliest at most V neighboring blocks among all neighboring blocks of the current block may be inserted into the candidate list of the current block according to the order in which the neighboring blocks are encoded / decoded. Here, the encoding / decoding order is at least one of a horizontal priority order, a vertical priority order, a zigzag order, a zigzag order, an upper right diagonal order, a lower left diagonal order, a raster order, a depth priority order, and a size priority order.

[0467] exist Fig.21 In the figure, the gray blocks are neighboring blocks that can be inserted into the candidate list in the order of encoding / decoding. For example, when the neighboring blocks are encoded / decoded in the order of A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, and S, a maximum of Z neighboring blocks starting with block A can be inserted into the candidate list in the order. Fig.21 A case where Z is 4 is shown. In this case, the candidate list of the current block X is configured to include blocks A, B, C, and D.

[0468] Fig. 22 is a diagram illustrating a method of inserting a neighboring block into a candidate list according to the position of the neighboring block spaced a certain distance from the position of the current block according to one embodiment of the present invention.

[0469] Among the neighboring blocks located at a specific distance from the current block, at most V neighboring blocks can be inserted into the candidate list of the current block. That is, when there are multiple blocks between the current block and the specific neighboring block, at most V neighboring blocks that meet specific conditions can be inserted into the candidate list of the current block.

[0470] One or more blocks located at a horizontal distance of -K×M, +K×M and a vertical distance of at least one of -1×N and +1×N from a specific position of the current block may be determined as neighboring blocks, and the neighboring blocks may be inserted into a candidate list. Blocks located at positions spaced apart from at least one specific position of the current block by a horizontal distance of -K×M or +K×M and a vertical distance of -1×N or +1×N may be determined as neighboring blocks, and the neighboring blocks may be inserted into a candidate list.

[0471] In addition, among the neighboring blocks located at the above-mentioned positions, a block included in a specific area relative to the current block may be inserted into the candidate list of the current block. In this case, the specific area may be an area preset in the encoder / decoder, or may be an area sent from the encoder to the decoder using a signal.

[0472] That is, M and N may refer to relative distances to specific locations in the current block. The specific position in the current block may be the (0,0) position, the (width-1,0) position, the (width,0) position, the (0,height-1) position, the (0,height) position, the (-1,-1) position, the (-1,0) position, the (0,-1) position, the (width-1,-1) position, the (width,-1) position, the (-1,height-1) position, the (-1,height) position, the (width / 2-1,0) position, the (width / 2,0) position, the (width / 2+1,0) position, the (0,height / 2-1) position, the (0,height / 2) position, the (0,height / 2+1) position, the (width / 2-1,-1) position, the (width / 2,-1) position, the (width / 2+1,-1) position, the (-1,height / 2-1) position, the (-1,height / 2) position, and the (-1,height / 2+1) position.

[0473] Here, M may represent a horizontal distance based on a sample point, N may represent a vertical distance based on a sample point, and each of M and N may be a positive integer. In addition, M and N may be the same value or different values. At least one of M and N may be determined according to at least one of a coding parameter of a current block and a coding parameter of a candidate block. In addition, at least one of M and N may be a value preset in an encoder / decoder or a value signaled from an encoder to a decoder.

[0474] Here, the maximum value of the absolute value of M may be MaxM, and the maximum value of the absolute value of N may be MaxN. The absolute value of M and the absolute value of N may be determined to be less than or equal to K or L times the size of the CTU.

[0475] Here, at least one of MaxM and MaxN may be a positive integer. At least one of MaxM and MaxN may be determined according to at least one of the encoding parameters of the current block and the encoding parameters of the candidate block. In addition, at least one of MaxM and MaxN may be a value preset in the encoder / decoder or a value sent by a signal from the encoder to the decoder.

[0476] Here, at least one of K and L may be 0 or any positive integer. At least one of K and L may be determined according to at least one of the encoding parameters of the current block and the encoding parameters of the candidate block. In addition, at least one of K and L may be a value preset in the encoder / decoder or a value signaled from the encoder to the decoder.

[0477] When blocks located at positions spaced apart by at least one of a horizontal distance of -K×M or +K×M and a vertical distance of -1×N or +1×N exist in at least one of a picture, a sub-picture, a slice, a tile, a partition, a CTU boundary, a CTU row, and a CTU column, or exist across a boundary of at least one of a picture, a sub-picture, a slice, a tile, a partition, a CTU, a CTU row, and a CTU column, the neighboring blocks at the corresponding position may not be inserted into the candidate list.

[0478] When there is no at least one of the neighboring blocks directly contacting the current block, a neighboring block located at a specific distance from the position of the current block may be inserted into the candidate list.

[0479] When a neighboring block located at a specific distance from the position of the current block is inserted into the candidate list, the neighboring block may be inserted into the candidate list according to a specific scanning order. Here, the specific scanning order is at least one of a horizontal priority order, a vertical priority order, a zigzag order, a zigzag order, an upper right diagonal order, a lower left diagonal order, a raster order, a depth priority order, and a size priority order. In addition, the neighboring blocks may be inserted into the candidate list in an order of increasing distance from the current block.

[0480] exist Fig. 22 In , the gray block represents a neighboring block that can be inserted into the candidate list because it is located at a specific distance from the current block. Fig. 22 The portion indicated by the diagonal line in may represent at least one of a picture, a sub-picture, a slice, a tile, a partition, a CTU boundary, a CTU row, and a CTU column.

[0481] like Fig. 22 As shown in the example of , when the current block X is a 16×16 block and M and N are each 16, each neighboring block that does not extend beyond the boundary of the picture, sub-picture, slice, tile, partition, CTU, CTU row, and CTU column is inserted into the candidate list. That is, the candidate list of the current block X is configured to include at least one of blocks A0, A1, A3, A6, A7, A8, B0, B1, C0, C1, D0, D1, D2, D3, D4, D5, D6, E0, E1, E2, F0, F1, F2, G0, G1, G2, G3, G4, and G5. Therefore, the neighboring blocks existing at the relative position to the position of the current block can be inserted into the candidate list of the current block.

[0482] The situation that the specific block exists at the boundary of at least one of a picture, a sub-picture, a slice, a parallel block, a partition, a CTU boundary, a CTU row, and a CTU column may indicate that the specific block belongs to at least one of a picture, a sub-picture, a slice, a parallel block, a partition, a CTU boundary, a CTU row, and a CTU column that are different from the picture, sub-picture, a slice, a parallel block, a partition, a CTU boundary, a CTU row, and a CTU column to which the current block belongs, respectively, and may specifically indicate that the specific block exists at the boundary of at least one of a picture, a sub-picture, a slice, a parallel block, a partition, a CTU boundary, a CTU row, and a CTU column. That is, this indicates that the specific block exists in at least one of a picture, a sub-picture, a slice, a parallel block, a partition, a CTU boundary, a CTU row, and a CTU column located above the current block or on the left side of the current block.

[0483] The case where the specific block extends beyond the boundary of at least one of a picture, a sub-picture, a slice, a tile, a partition, a CTU boundary, a CTU row, and a CTU column may indicate that the specific block belongs to at least one of a picture, a sub-picture, a slice, a tile, a partition, a CTU boundary, a CTU row, and a CTU column that are different from the picture, sub-picture, a slice, a tile, a partition, a CTU boundary, a CTU row, and a CTU column to which the current block belongs, respectively, and may specifically indicate that the specific block exists in at least one of a picture, a sub-picture, a slice, a tile, a partition, a CTU boundary, a CTU row, and a CTU column. That is, this indicates that the specific block exists in at least one of a picture, a sub-picture, a slice, a tile, a partition, a CTU boundary, a CTU row, and a CTU column located above the current block or on the left side of the current block.

[0484] Fig.23 2 is a diagram illustrating a method of inserting a neighboring block into a candidate list according to a position of a neighboring block located a specific distance from a position of at least one selected from a current picture, a sub-picture, a slice, a tile, and a partition according to an embodiment of the present invention.

[0485] Among neighboring blocks located at a specific distance from the position of the current picture, sub-picture, slice, tile, partition, CTU boundary, CTU row, and CTU column, up to V neighboring blocks may be inserted into the candidate list of the current block. That is, when there are multiple blocks between the current block and a specific neighboring block, up to V neighboring blocks among the neighboring blocks may be inserted into the candidate list of the current block.

[0486] A block located at a position at least one of a horizontal distance K×M and a vertical distance 1×N from a specific position of a current picture, a sub-picture, a slice, a tile, a partition, a CTU boundary, a CTU row, or a CTU column is determined as a neighboring block of the current block, and the neighboring block may be inserted into the candidate list. A block located at a position at least one of a horizontal distance K×M and a vertical distance L×N spaced from a specific position of at least one of the current picture, a sub-picture, a slice, a tile, a partition, a CTU boundary, a CTU row, and a CTU column may be determined as a neighboring block, and the neighboring block may be inserted into the candidate list.

[0487] In addition, among the neighboring blocks located at the above-mentioned positions, a block included in a specific area relative to the current block may be inserted into the candidate list of the current block. In this case, the specific area may be an area preset in the encoder / decoder, or may be an area sent from the encoder to the decoder using a signal.

[0488] M and N may be absolute distances from a specific position of at least one of a current picture, a current sub-picture, a current slice, a current tile, a current partition, a current CTU boundary, a current CTU row, and a current CTU column. The specific position of at least one of the current picture, the current sub-picture, the current slice, the current tile, the current partition, the current CTU boundary, the current CTU row, and the current CTU column may be defined as a (0,0) position.

[0489] Here, M may represent a horizontal distance based on a sample point, N may represent a vertical distance based on a sample point, and each of M and N may be a positive integer such as 2, 4, 8, 16, 32, etc. (i.e., 2 to the power of n). In addition, M and N may be the same value or different values. At least one of M and N may be determined according to at least one of a coding parameter of a current block and a coding parameter of a candidate block. In addition, at least one of M and N may be a value preset in an encoder / decoder or a value signaled from an encoder to a decoder.

[0490] Here, at least one of K and L may be 0 or any positive integer. At least one of K and L may be determined according to at least one of the encoding parameters of the current block and the encoding parameters of the candidate block. In addition, at least one of K and L may be a value preset in the encoder / decoder or a value signaled from the encoder to the decoder.

[0491] When there is no at least one of the neighboring blocks directly contacting the current block, the neighboring blocks located at a specific distance from the location of the current picture, sub-picture, slice, tile, partition, CTU boundary, CTU row, and CTU column may be inserted into the candidate list.

[0492] When a neighboring block located at a specific distance from the position of the current picture, sub-picture, slice, tile, partition, CTU boundary, CTU row or CTU column is inserted into the candidate list, the neighboring block is inserted in a specific scanning order. Here, the specific scanning order may be at least one of a horizontal priority order, a vertical priority order, a zigzag order, a zigzag order, an upper right diagonal order, a lower left diagonal order, a raster order, a depth priority order and a size priority order. In addition, the candidate blocks may be inserted into the candidate list in the order of increasing distance from the neighboring block to the current block.

[0493] exist Fig.23 In FIG. 4 , since the gray block is located at a specific distance from the position of the current picture, the gray block represents a neighboring block that can be inserted into the candidate list.

[0494] exist Fig. 22 In the example of , the specific position of the current picture is the (0,0) position, the current block X is a 16×16 block, K and L are positive integers including 0, and M and N are each 16. In this case, a neighboring block located at a position (K×M, L×N) relative to the position (0,0) of the current picture may be inserted into the candidate list. Therefore, the candidate list of the current block X is configured to include at least one of blocks 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, and 23. In the position (K×M, L×N), K of the x coordinate and L of the y coordinate may be the same value or may be different values. Therefore, a neighboring block existing in an absolute position based on the position of at least one of the current picture, sub-picture, slice, tile, partition, CTU boundary, CTU row, and CTU column may be inserted into the candidate list of the current block.

[0495] According to the relationship between the coding parameters of the current block and the coding parameters of the neighboring blocks, at most V neighboring blocks among all the neighboring blocks of the current block may be inserted into the candidate list of the current block.

[0496] When at least one of the encoding parameters of the current block is identical to at least one of the encoding parameters of a neighboring block adjacent to the current block, a maximum of V blocks of the neighboring blocks may be inserted into the candidate list of the current block.

[0497] For example, between the current block and a specific neighboring block, when the prediction mode is the same, when the intra-frame luminance prediction mode / direction is the same, when the intra-frame chrominance prediction mode / direction is the same, when the motion vector is the same, when the motion vector difference is the same, when the reference picture list is the same, when the reference picture index is the same, when the reference picture is the same, when the inter-frame prediction direction (inter-frame prediction indicator, prediction list utilization flag) is the same, when the merge mode utilization information is the same, when the skip mode utilization information is the same, when the motion vector prediction index is the same, when the merge index is the same, when the motion vector representation accuracy is the same, when the transform size is the same, when the first transform utilization information is the same, when the second transform utilization information is the same, when the first transform index is the same, when the second transform index is the same, when the residual signal existence information is the same, or when the quantization parameter is the same, the neighboring block can be inserted into the candidate list.

[0498] When at least one of the encoding parameters of the current block is similar to at least one of the encoding parameters of a neighboring block adjacent to the current block, a maximum of V blocks of the neighboring blocks may be inserted into the candidate list of the current block.

[0499] For example, when the difference between the intra-frame brightness prediction mode / direction of the current block and the intra-frame brightness prediction mode / direction of the neighboring block is equal to or less than T, when the difference between the motion vector of the current block and the motion vector of the neighboring block is equal to or less than T, when the difference between the motion vector difference of the current block and the motion vector difference of the neighboring block is equal to or less than T, or when the difference between the reference picture index of the current block and the reference picture index of the neighboring block is equal to or less than T, the neighboring block may be inserted into the candidate list. Here, T may be an integer.

[0500] For example, when the reference picture lists between the current block and the neighboring block are different but the reference pictures are the same, or when the reference picture indexes between the current block and the neighboring block are different but the reference pictures are the same, the neighboring block may be inserted into the candidate list.

[0501] For example, identifiers of encoding parameters of neighboring blocks to be included in the candidate list are entropy encoded / decoded, and the neighboring blocks may be inserted into the candidate list according to similarity between the encoding parameters.

[0502] For example, identifiers of coding parameters of neighboring blocks to be included in the candidate list are entropy encoded, and neighboring blocks having the same value as the coding parameter, neighboring blocks having a value greater than the value of the coding parameter, or neighboring blocks having a value less than the value of the coding parameter can be inserted into the candidate list.

[0503] For example, identifiers of coding parameters of neighboring blocks to be included in the candidate list are entropy decoded, and neighboring blocks having the same value as the coding parameter, neighboring blocks having a value greater than the value of the coding parameter, or neighboring blocks having a value less than the value of the coding parameter can be inserted into the candidate list.

[0504] As another example, a co-located block, which is a block existing in a reference picture and located at the same spatial position as the current block, may be inserted into the candidate list as a neighboring block.

[0505] For example, at least one of the neighboring blocks of the reference picture of the current picture in the picture other than the picture to which the current block belongs may be inserted into the candidate list. At least one of the neighboring blocks of the reference picture is called a temporal neighboring block.

[0506] The neighboring block may mean a block located at the same spatial position as the current block among blocks within the reference picture, or may mean a block adjacent to a block located at the same spatial position as the current block among blocks within the reference picture.

[0507] Hereinafter, step S830 of selecting and determining a reference block for encoding / decoding the current block from among the neighboring blocks included in the candidate list will be described in detail.

[0508] Before selecting and determining the reference block to be used to encode / decode the current block from the neighboring blocks in the candidate list, the candidate list may be modified using at least one or a combination of the methods described below. When a combination of the methods described below is used, the methods are performed in a specific order to modify the candidate list.

[0509] Each neighboring block included in the candidate list is referred to as a candidate, and information about each neighboring block included in the candidate list is also referred to as a candidate. Each block included in the candidate list is referred to as a candidate, and information about each block included in the candidate list is also referred to as a candidate.

[0510] The candidates in the candidate list are sorted in a specific order. The sorting may be performed based on at least one of the encoding parameters of the current block and the encoding parameters of the candidates.

[0511] The sorting may be performed such that the value of the encoding parameter of the current block and the value of the candidate encoding parameter are arranged in ascending order. The sorting may be performed such that the value of the encoding parameter of the current block and the value of the candidate encoding parameter are arranged in descending order.

[0512] The encoder sorts the candidates in the candidate list in the order of high probability that the candidates in the candidate list are determined to be reference blocks, and assigns candidate indexes of short codeword lengths to the candidates with high probability, thereby improving encoding efficiency.

[0513] In this case, the encoder or decoder may limit the size of the candidate list to a maximum value of U. Here, U may be 0 or any positive integer. U may be determined based on at least one of the encoding parameters of the current block and the encoding parameters of the candidate block. In addition, U may be a value preset in the encoder / decoder or a value signaled from the encoder to the decoder.

[0514] For example, when there are more than U candidates in the candidate list, the excessive candidates may be eliminated from the candidate list. The candidates to be eliminated may be determined according to a specific sorting order of the candidates in the candidate list.

[0515] The encoder or decoder may eliminate up to U candidates from the candidate list. Here, U may be 0 or any positive integer. U may be determined based on at least one of the encoding parameters of the current block and the encoding parameters of the candidate block. In addition, U may be a value preset in the encoder / decoder or a value signaled from the encoder to the decoder.

[0516] When at least two candidates are repeated in the candidate list, at least one of the repeated candidates may be removed from the candidate list. At this time, the candidate with a higher ranking in the candidate list among the repeated candidates may remain in the candidate list, and other candidates with a lower ranking may be removed from the candidate list. Here, when at least one of the encoding parameters of the candidates overlaps, these parameters may be referred to as repeated candidates.

[0517] The encoder or decoder may add up to U candidates to the candidate list. Here, U may be 0 or any positive integer. U may be determined based on at least one of the encoding parameters of the current block and the encoding parameters of the candidate block. In addition, U may be a value preset in the encoder / decoder or a value signaled from the encoder to the decoder.

[0518] Candidates are added to the candidate list until the number of candidates in the candidate list reaches the maximum number. In this case, duplicate candidates can be added to the candidate list.

[0519] When the encoder or decoder adds a candidate to the candidate list, at least one or a combination of the embodiments of step S820 may be used.

[0520] The encoder or decoder may determine a maximum of W neighboring blocks (candidates) included in the candidate list as the reference block of the current block. The encoder or decoder may determine a maximum of W pieces of block information (candidates) of neighboring blocks included in the candidate list as information about the reference block of the current block.

[0521] Here, W may be 0 or any positive integer. W may be determined based on at least one of the encoding parameters of the current block and the encoding parameters of the candidate block. In addition, W may be a value preset in the encoder / decoder or a value signaled from the encoder to the decoder.

[0522] For example, an encoder or decoder may determine up to W candidates in a candidate list as reference blocks for a current block so as to encode / decode the current block when the current block is predicted using a triangle partitioning mode. For example, W may be 2. When the size of the current block is 8×8 or larger, the current block may be encoded / decoded using a triangle partitioning mode. The triangle partitioning mode may be an example of a merge mode. The candidate list for encoding / decoding the current block may refer to a merge candidate list. Information indicating whether the current block will be decoded using a triangle partitioning mode may be signaled at the coding unit level.

[0523] In the case of encoding / decoding the current block using the triangle partitioning mode, the current block is divided into two triangle regions. In this case, the partition direction information for dividing the current block into the two triangle regions can be encoded / decoded. In order to decode each of the two triangle regions, a neighboring block for encoding / decoding the corresponding triangle region can be selected from the candidate list.

[0524] The index of the corresponding triangular area can be encoded / decoded to derive motion information of each triangular area. For example, when the current block is divided into a first area and a second area, a first index for encoding / decoding the first area and a second index for encoding / decoding the second area can be encoded / decoded. When two pieces of information about a reference block of the current block are determined, the information indicated by the first index can be information about the first reference block of the current block, and the information indicated by the second index can be information about the second reference block of the current block.

[0525] The encoder or decoder may select the first neighboring block and the second neighboring block from the candidate list of the current block by using the first index and the second index. In this case, the first region and the second region may share a candidate list derived based on the current block that has not yet been divided. The encoder or decoder may encode / decode the first region using information of the selected first neighboring block, and may encode / decode the second region using information of the selected second neighboring block.

[0526] In the above-mentioned triangle partitioning mode, the current block is divided in the diagonal direction, and prediction is performed on each region. However, the triangle partitioning mode can also represent the operation described below.

[0527] When the current block is encoded / decoded in the triangular partition mode, the first neighboring block and the second neighboring block may be selected from a single candidate list based on the first index and the second index of the current block. The encoder or decoder may derive the first prediction block of the current block using information of the first neighboring block, and derive the second prediction block of the current block using information of the second neighboring block.

[0528] The encoder or decoder can generate a final prediction block of the current block by calculating the weighted sum of the first prediction block and the second prediction block. In this case, the weighted sum of the prediction blocks can be performed by weighting the first region of the first prediction block and weighting the second region of the second prediction block.

[0529] The first neighboring block may represent the first reference block of the current block, and the second neighboring block may represent the second reference block of the current block. Information of the first neighboring block may represent information of the first reference block of the current block, and information of the second neighboring block may represent information of the second reference block of the current block.

[0530] The encoder or the decoder may encode / decode the current block using at least one of the determined reference blocks. The encoder or the decoder may encode / decode the current block using at least one piece of block information of the determined reference blocks.

[0531] At least one piece of block information of the determined reference blocks may be determined as information of the current block. At least one piece of block information of at least one reference block among the determined reference blocks may be determined as block information of the current block.

[0532] Hereinafter, a method by which an encoder or decoder determines a specific neighboring block in a candidate list as a reference block will be described. The encoder or decoder may determine a candidate in a candidate list as a reference block using at least one or at least one combination of the methods described below.

[0533] For example, the encoder or decoder may determine the Yth candidate in the candidate list as the reference block. Here, Y may be 0 or any positive integer. Y may be determined based on at least one of the encoding parameters of the current block and the encoding parameters of the candidate block. In addition, Y may be a value preset in the encoder / decoder or a value signaled from the encoder to the decoder.

[0534] Since the Yth candidate in the candidate list can be identified by the encoder / decoder, the candidate index of the specified reference block may not be entropy encoded / decoded. The sorting of the candidates in the candidate list may be performed according to the above-described embodiment of the method for storing the candidates in the candidate list to determine the Yth candidate.

[0535] As another example, the encoder or decoder may reduce or shorten the candidate list so that a maximum of Y candidates remain in the candidate list and the Y candidates are determined as reference blocks. Here, Y may be 0 or any positive integer. Y may be determined based on at least one of the encoding parameters of the current block and the encoding parameters of the candidate block. In addition, Y may be a value preset in the encoder / decoder or a value signaled from the encoder to the decoder.

[0536] For example, the encoder or the decoder may determine Y candidates as reference blocks by leaving only Y candidates having the highest probability of being selected as reference blocks among the candidates in the candidate list.

[0537] In this case, since Y candidates in the candidate list can be identified by the encoder / decoder, the candidate index of the designated reference block may not be entropy encoded / decoded.

[0538] Optionally, the encoder or decoder may determine the reference block by entropy encoding / decoding a candidate index indicating a specific candidate in the candidate list. Here, the candidate index may be a value to which the position, order, etc. of the specific candidate in the candidate list is mapped. The encoder or decoder may encode / decode the current block using the determined reference block (or at least one piece of block information of the determined reference block).

[0539] That is, the encoder may encode the current block using a reference block selected from the candidates in the candidate list (or at least one piece of block information of the reference block), and entropy encode the candidate index of the reference block. On the other hand, the decoder may entropy decode the candidate index of the reference block, and use the candidate indicated by the candidate index among the candidates in the candidate list as the reference block (or at least one piece of block information of the reference block) to decode the current block.

[0540] For example, when the candidate list consists of {A, B, C, D, E, F}, the index of the candidate in the candidate list may be assigned {0, 1, 2, 3, 4, 5}. When the candidate index is 2, candidate C is determined as the reference block. In addition, when the candidate index is 1, candidate B is determined as the block information of the reference block.

[0541] The encoder or decoder may perform entropy encoding / decoding on a maximum of Y candidate indexes. When entropy encoding / decoding is performed on a plurality of candidate indexes, a plurality of reference blocks indicated by the plurality of candidate indexes may be used to encode / decode the current block, respectively.

[0542] Here, Y may be 0 or any positive integer. Y may be determined based on at least one of the encoding parameters of the current block and the encoding parameters of the candidate block. In addition, Y may be a value preset in the encoder / decoder or a value signaled from the encoder to the decoder.

[0543] That is, the encoder can encode the current block using the determined Y reference blocks in the candidates in the candidate list, and can entropy encode the Y candidate indexes of the Y reference blocks. On the other hand, the decoder can entropy decode the Y candidate indexes of the Y reference blocks, and can use the Y reference blocks indicated by the Y candidate indexes in the candidates in the candidate list to decode the current block.

[0544] Fig.24 is a diagram illustrating boundaries of a picture, a sub-picture, a slice, a tile, and a block according to an embodiment of the present invention.

[0545] Fig.24 1 shows the boundaries of pictures, sub-pictures, stripes, tiles and blocks according to one embodiment of the present invention. Fig.24 , (a) shows a case where a right boundary and a bottom boundary exist in the current block, (b) shows a case where a bottom boundary exists in the current block, and (c) shows a case where a right boundary exists in the current block.

[0546] Fig.25 is a diagram illustrating a block partitioning scheme according to one embodiment of the present invention.

[0547] Fig.25 FIG. 2 shows a block partitioning scheme according to an embodiment of the present invention. Fig.25 , (a) shows vertical binary tree partitioning, (b) shows horizontal binary tree partitioning, (c) shows vertical ternary tree partitioning, and (d) shows horizontal ternary tree partitioning.

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

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

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

[0551] The above embodiment may be performed on each of a luminance signal and a chrominance signal, or may be performed identically on the luminance signal and the chrominance signal.

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

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

[0554] 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 4×4 or larger, the above embodiment may be applied. For example, when the size of the current block is 16×16 or larger, 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.

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

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

[0557] In the reference picture list construction process and the reference picture list modification process, at least one of the reference picture sets is used, and the reference picture sets are formed into one or more reference picture lists of reference picture lists L0, L1, L2, and L3.

[0558] When calculating the boundary strength during deblocking filtering, one or more motion vectors of the current block (at least one motion vector and at most N motion vectors) may be used. Here, N may be a positive integer equal to or greater than 1. N may be 1, 2, 3, 4, etc.

[0559] Even when the precision of the motion vector is 16-pel unit, 8-pel unit, 4-pel unit, integer-pel unit, 1 / 2-pel unit, 1 / 4-pel unit, 1 / 8-pel unit, 1 / 16-pel unit, 1 / 32-pel unit, or 1 / 64-pel unit, the above embodiment can be used. In the encoding / decoding process of the current block, the pixel unit (precision) of the motion vector can be adaptively selected from the above pixel units.

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

[0561] At least one of the syntax elements for adaptive in-loop filtering entropy encoded by the encoder and entropy decoded by the decoder may undergo at least one process selected from binarization, debinarization, and entropy encoding / decoding. Here, for binarization / debinarization and entropy encoding / decoding, at least one of the following techniques may be used, including: a signed 0th order Exp_Golomb binarization / debinarization method (se(v)), a signed kth order Exp_Golomb binarization / debinarization method (sek(v)), a 0th order Exp_Golomb for unsigned positive integers (ue(v)), a kth order Exp_Golomb binarization / debinarization method for unsigned positive integers (uek(v)), a fixed length degree binarization / debinarization method (f(n)), truncated Rice binarization / debinarization method or truncated unary binarization / debinarization method (tu(v)), truncated binary binarization / debinarization method (tb(v)), context adaptive arithmetic coding / decoding method (ae(v)), byte-based bit string (b(8)), binarization / debinarization method for signed integers (i(n)), binarization / debinarization method for unsigned positive integers (u(n)) and unary binarization / debinarization method.

[0562] The present invention is not limited to the case where the current block is encoded / decoded according to only one specific embodiment among the above embodiments, but covers the case where the current block is encoded / decoded using any combination of the above embodiments.

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

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

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

[0566] The embodiments of the present invention may 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 ordinary technicians 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.

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

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

[0569] Industrial Applicability The present invention can be used to encode or decode images.

Claims

1. An image decoding method, comprising: decoding block partition information of a current block included in a current picture; Determine the partitioning scheme of the current block according to the block partitioning information; as well as Partition the current block using the partitioning scheme, The partitioning scheme is determined according to whether the current block includes the boundary of the current picture. The partitioning scheme is any one of quadtree partitioning, horizontal binary tree partitioning, vertical binary tree partitioning, horizontal ternary tree partitioning, and vertical ternary tree partitioning. Wherein, when the current block includes the right boundary of the current picture and the height of the current block exceeds a predefined value, the partitioning scheme is determined to be any partitioning scheme except the vertical binary tree partitioning scheme, and The division ratio of the horizontal ternary tree partition and the vertical ternary tree partition is 1:2:

1.

2. The method according to claim 1, wherein: When the current block includes a lower boundary of the current picture and the width of the current block exceeds a predefined value, the partition scheme is determined to be any one of the partition schemes except the horizontal binary tree partition.

3. An image encoding method, comprising: determining a partitioning scheme for a current block included in a current picture; Partition the current block using the partitioning scheme; as well as encoding block partition information of a current block indicating a partition scheme of the current block, The partitioning scheme is determined according to whether the current block includes the boundary of the current picture. The partitioning scheme is any one of quadtree partitioning, horizontal binary tree partitioning, vertical binary tree partitioning, horizontal ternary tree partitioning, and vertical ternary tree partitioning. Wherein, when the current block includes the right boundary of the current picture and the height of the current block exceeds a predefined value, the partitioning scheme is determined to be any partitioning scheme except the vertical binary tree partitioning scheme, and The division ratio of the horizontal ternary tree partition and the vertical ternary tree partition is 1:2:

1.

4. The method according to claim 3, wherein: When the current block includes a lower boundary of the current picture and the width of the current block exceeds a predefined value, the partition scheme is determined to be any one of the partition schemes except the horizontal binary tree partition.

5. A non-transitory computer-readable medium storing a bitstream generated by an encoding device, the encoding device being configured to perform an encoding method, the encoding method comprising: determining a partitioning scheme for a current block included in a current picture; Partition the current block using the partitioning scheme; as well as encoding block partition information of a current block indicating a partition scheme of the current block, The partitioning scheme is determined according to whether the current block includes the boundary of the current picture. The partitioning scheme is any one of quadtree partitioning, horizontal binary tree partitioning, vertical binary tree partitioning, horizontal ternary tree partitioning, and vertical ternary tree partitioning. Wherein, when the current block includes the right boundary of the current picture and the height of the current block exceeds a predefined value, the partitioning scheme is determined to be any partitioning scheme except the vertical binary tree partitioning scheme, and The division ratio of the horizontal ternary tree partition and the vertical ternary tree partition is 1:2:1.