Image encoding / decoding method and recording medium storing bit stream

By decoding motion information to refine details during image encoding/decoding and reconstructing the current block and neighboring blocks, the throughput limitation problem in existing technologies is solved, achieving more efficient image data transmission and storage.

CN119299669APending Publication Date: 2025-01-10ELECTRONICS & TELECOMM RES INST +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411598638.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2019-03-04
Filing Date
2019-06-28
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

Existing image encoding/decoding technologies encode/decode the current block after encoding/decoding neighboring blocks, resulting in limited throughput and failing to effectively improve the transmission and storage efficiency of image data.

Method used

By decoding information about whether motion information refinement is performed in the bitstream, the first and second motion information of the current block are obtained, and the current block and its neighboring blocks are reconstructed using this information, reducing the dependence on neighboring blocks, thereby performing the encoding/decoding of the current block before completing the encoding/decoding of neighboring blocks.

Benefits of technology

It improves the throughput of image encoding/decoding, reduces dependence on neighboring blocks, and enhances the processing efficiency of the encoder/decoder.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119299669A_ABST
    Figure CN119299669A_ABST
Patent Text Reader

Abstract

An image encoding / decoding method and a recording medium storing a bitstream are provided. The image decoding method of the present disclosure comprises the steps of: decoding information on whether to perform motion information correction from a bitstream, obtaining second motion information on first motion information of a current block based on the information, and restoring at least one neighboring block storing the current block and the current block by using at least one of the first motion information and the second motion information.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of an invention patent application with an application date of June 28, 2019, application number “201980044126.X” and title “Image encoding / decoding method and device for throughput enhancement and recording medium for storing bitstream”. Technical Field

[0002] The present invention relates to an image encoding / decoding method and apparatus and a recording medium storing a bit stream. More specifically, the present invention relates to an image encoding / decoding method and apparatus for improving throughput 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, image data with higher resolution and quality has an increasing amount of data. Therefore, when image data is transmitted by using a medium such as a conventional wired and wireless broadband network, or when image data is stored by using a conventional storage medium, the cost of transmission and storage increases. In order to solve these problems arising as the resolution and quality of image data increase, efficient image encoding / decoding technology is required for higher resolution and higher quality images.

[0004] The image compression technology includes various technologies, including: an inter-frame prediction technology for predicting pixel values ​​included in the current picture from previous or subsequent pictures of the current picture; an intra-frame prediction technology for predicting pixel values ​​included in the current picture by using pixel information in the current picture; a transform and quantization technology for compressing the energy of a residual signal; an entropy coding technology for assigning short codes to values ​​with high occurrence frequencies and assigning long codes to values ​​with low occurrence frequencies, etc. By using such image compression technology, image data can be effectively compressed, and the image data can be transmitted or stored.

[0005] In conventional image encoding / decoding, motion estimation and refinement as well as intra prediction for a current block are performed after encoding / decoding of neighboring blocks are completed, and thus, improving throughput may be limited. Summary of the invention

[0006] Technical issues

[0007] An object of the present invention is to provide an image encoding / decoding method and device, wherein the method and device can improve throughput.

[0008] In addition, another object of the present invention is to provide a method and a device for minimizing the dependency on neighboring blocks and the current block so that encoding / decoding of the current block is performed before encoding / decoding of the neighboring blocks is completed, so as to improve the throughput of the encoder / decoder.

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

[0010] Technical Solution

[0011] According to the present invention, there is provided an image decoding method, comprising: decoding information about whether to perform motion information refinement from a bit stream; obtaining second motion information for first motion information about a current block based on the information; and reconstructing the current block and at least one of the neighboring blocks of the current block by using at least one of the first motion information and the second motion information.

[0012] According to one embodiment, the information on whether to perform motion information refinement is signaled through a parameter set or at least one of a video parameter set, a sequence parameter set, a sub-picture parameter set, a picture parameter set, an adaptation parameter set, a slice header, a tile header and a brick header.

[0013] According to one embodiment, the first motion information is initial motion information about the current block, and the second motion information is information obtained by performing refinement on the first motion information.

[0014] According to one embodiment, the second motion information is obtained by partitioning the current block into at least one sub-block and performing motion information refinement on the at least one sub-block when the current block is equal to or larger than a predetermined block size.

[0015] According to one embodiment, the second motion information is obtained by partitioning the current block into at least one subblock and performing motion information refinement on the at least one subblock when at least one of a width and a height of the current block is equal to or greater than a predetermined block size.

[0016] According to one embodiment, the predetermined block size is 16.

[0017] According to one embodiment, initial motion information about the current block is used as initial motion information of the sub-block.

[0018] According to one embodiment, a second motion vector is obtained by using pixel values ​​indicated by a candidate motion vector in an area within the LO reference picture for the current block and using pixel values ​​indicated by a vector opposite to the candidate motion vector in an area within the L1 reference picture for the current block.

[0019] According to one embodiment, the first motion information about the current block is used to perform at least one of the following operations: predicting the spatial motion vector of the neighboring block of the current block and determining the boundary strength of the deblocking filter.

[0020] According to one embodiment, the second motion information about the current block is used to predict the motion information of the co-located block of the neighboring block of the current block.

[0021] Furthermore, according to the present invention, there is provided an image encoding method, comprising: determining whether to perform motion information refinement; and encoding information on whether to perform motion information refinement based on the determination.

[0022] According to one embodiment, information on whether to perform motion information refinement is signaled via a parameter set or at least one of a video parameter set, a sequence parameter set, a sub-picture parameter set, a picture parameter set, an adaptation parameter set, a slice header, a tile header, and a partition header.

[0023] In addition, according to the present invention, there is provided an image decoding device, wherein the device decodes information about whether to perform motion information refinement from a bit stream; obtains second motion information for first motion information about a current block based on the information; and reconstructs the current block and at least one of the neighboring blocks of the current block by using at least one of the first motion information and the second motion information.

[0024] According to one embodiment, said information on whether to perform motion information refinement is signaled via a parameter set or at least one of a video parameter set, a sequence parameter set, a sub-picture parameter set, a picture parameter set, an adaptation parameter set, a slice header, a tile header and a partition header.

[0025] According to one embodiment, the first motion information is initial motion information about the current block, and the second motion information is information obtained by performing refinement on the first motion information.

[0026] According to one embodiment, the second motion information is obtained by partitioning the current block into at least one sub-block and performing motion information refinement on the at least one sub-block when the current block is equal to or larger than a predetermined block size.

[0027] According to one embodiment, the second motion information is obtained by partitioning the current block into at least one subblock and performing motion information refinement on the at least one subblock when at least one of a width and a height of the current block is equal to or greater than a predetermined block size.

[0028] According to one embodiment, the predetermined block size is 16.

[0029] According to one embodiment, initial motion information about the current block is used as initial motion information about the sub-block.

[0030] Furthermore, according to the present invention, there is provided a computer-readable non-transitory recording medium storing video data used in an image decoding method, wherein the image data includes information about whether to perform motion information refinement, and in the image decoding method, the information about whether to perform motion information refinement is used to obtain second motion information for first motion information about a current block, and at least one of the first motion information and the second motion information is used to reconstruct at least one of the current block and a neighboring block of the current block.

[0031] Beneficial Effects

[0032] According to the present invention, there is provided an image encoding / decoding method and apparatus, thereby improving throughput.

[0033] In addition, according to the present invention, a method and apparatus are provided for minimizing the dependency on neighboring blocks and the current block, so that encoding / decoding of the current block is performed before encoding / decoding of the neighboring blocks is completed, thereby improving the throughput of the encoder / decoder.

[0034] In addition, according to the present invention, there is provided a recording medium storing a bit stream generated by the image encoding / decoding method and apparatus of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

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

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

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

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

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

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

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

[0042] Figure 8is a flowchart illustrating an image encoding / decoding method and apparatus and a recording medium storing a bit stream according to an embodiment of the present invention.

[0043] Figure 9a is a diagram illustrating prediction of motion information about a current block according to an exemplary embodiment of the present invention.

[0044] Figure 9b is a diagram illustrating prediction of motion information about a current block according to another embodiment of the present invention.

[0045] Fig.10 is a diagram illustrating filling a reference area according to an embodiment of the present invention.

[0046] Fig.11 is a diagram illustrating adjusting the length of an interpolation filter according to an embodiment of the present invention.

[0047] Fig.12a 2 is a diagram illustrating an operation when a motion vector candidate exceeds a minimum motion vector range when performing motion information refinement according to an embodiment of the present invention.

[0048] Figure 12b is a diagram illustrating an operation when a motion vector candidate exceeds a limit in MCTS when performing motion information refinement according to an embodiment of the present invention.

[0049] Figures 13a to 13c are diagrams respectively illustrating encoding of a current block according to embodiments of the present invention.

[0050] Fig.14 is a diagram of a flowchart of generating a merge candidate list according to an embodiment of the present invention.

[0051] Figures 15a to 15c 2 are diagrams respectively illustrating merge candidate lists generated according to embodiments of the present invention.

[0052] Fig.16 is a diagram illustrating positions of neighboring blocks that are not used when predicting motion information about respective blocks in an encoder according to an exemplary embodiment.

[0053] Fig.17a and 17b are diagrams respectively illustrating designated virtual encoding areas according to embodiments of the present invention.

[0054] Fig.18 2 is a diagram illustrating performing decoding on a parallel PU including two subblocks by using intra prediction according to an embodiment of the present invention.

[0055] Fig.192 is a diagram illustrating performing decoding on a parallel PU including three subblocks by using intra prediction according to an embodiment of the present invention.

[0056] Fig. 20 2 is a diagram illustrating decoding performed on a parallel PU including three subblocks by using intra prediction according to another embodiment of the present invention.

[0057] Fig.21 is a diagram illustrating a flowchart of an image decoding method according to an embodiment of the present invention.

[0058] Fig. 22 is a diagram illustrating a flowchart of an image encoding method according to an embodiment of the present invention. DETAILED DESCRIPTION

[0059] Various modifications may be made to the present invention, and there are various embodiments of the present invention, and examples of various embodiments of the present invention will now be provided and described in detail with reference to the accompanying drawings. However, although the exemplary embodiments may be interpreted as including all modifications, equivalents or alternative forms within the technical concept and technical scope of the present invention, the present invention is not limited thereto. Similar reference numerals refer to the same or similar functions in various aspects. In the accompanying drawings, the shapes and sizes of the elements may be exaggerated for clarity. In the following detailed description of the present invention, reference is made to the accompanying drawings that illustrate specific embodiments in which the present invention may be implemented by way of illustration. 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 without departing from the spirit and scope of the present disclosure, the position or arrangement of each element within each disclosed embodiment may be modified. Therefore, the following detailed description should not be understood in a limiting sense, and the scope of the present disclosure is limited only by the appended claims (in the case of appropriate interpretation, together with the full range of equivalent forms claimed by the claims).

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

[0061] It will be understood that, in this specification, when an element is merely referred to as being “connected to” or “coupled to” another element rather than being “directly connected to” or “directly coupled to” the other element, the element may be “directly connected to” or “directly coupled to” the other element, or connected to or coupled to the other element with other elements between the element and the other element. Conversely, it should be understood that when an element is referred to as being “directly coupled to” or “directly coupled to” another element, there are no intervening elements.

[0062] In addition, the components shown in the embodiments of the present invention are shown independently to present characteristic functions different from each other. Therefore, this does not mean that each component is composed of a component unit of separate hardware or software. In other words, for convenience, each component includes each of the enumerated components. Therefore, at least two components in each component can be combined to form a component, or a component can be divided into a plurality of components for performing each function. Without departing 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.

[0063] The terms used in this specification are only used to describe specific embodiments, and are not intended to limit the present invention. Unless the expression used in the singular has a significantly different meaning in the context, it includes plural expressions. In this specification, it will be understood that terms such as "including ... ", "having ... ", etc. are intended to indicate that there are features, quantities, 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, quantities, 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", the elements other than the corresponding elements are not excluded, but additional elements may be included in embodiments of the present invention or in the scope of the present invention.

[0064] In addition, some components may not be indispensable components for performing the necessary functions of the present invention, but optional components that only improve their performance. The present invention can be implemented by only including the indispensable components for implementing the essence of the present invention and excluding the components used when improving performance. The structure that only includes the indispensable components and excludes the optional components used when only improving performance is also included in the scope of the present invention.

[0065] Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings. When describing the exemplary embodiments of the present invention, well-known functions or structures may unnecessarily obscure the understanding of the present invention, and therefore they will not be described in detail. 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.

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

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

[0068] Hereinafter, a target image may be an encoding target image as a target of encoding and / or a decoding target image as a target of decoding. 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.

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

[0070] Hereinafter, the target block may be an encoding target block as a target of encoding and / or a decoding target block as a target of decoding. 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.

[0071] Hereinafter, the terms "block" and "unit" may be used as the same meaning and replaced with each other. Alternatively, a "block" may refer to a specific unit.

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

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

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

[0075] 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 columns, rows, indexes, etc. may be counted from 0 or 1.

[0076] Description of terms

[0077] Encoder: This refers to a device that performs encoding. In other words, it refers to an encoding device.

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

[0079] Block: is an M×N sample array. Here, M and N may represent positive integers, and a block may represent a sample array in a two-dimensional form. A block may refer to a unit. A current block may represent an encoding target block that becomes a target at the time of encoding, or a decoding target block that becomes a target at the time of decoding. In addition, the current block may be at least one of a coding block, a prediction block, a residual block, and a transform block.

[0080] Sample: It is a basic unit constituting a block. According to the bit depth (Bd), the sample can be expressed as a value from 0 to 2Bd-1. In the present invention, the sample can be used as the meaning of a pixel. That is, the sample, pel, and pixel can have the same meaning as each other.

[0081] 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 may be performed for each unit. 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 the unit may be a two-dimensional geometric figure, such as a square shape, a rectangular shape, a trapezoidal shape, a triangular shape, a pentagonal shape, and the like. Also, the unit information may include at least one of a unit type indicating a coding unit, a prediction unit, a transformation unit, etc., and a unit size, a unit depth, an order of encoding and decoding of the unit, and the like.

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

[0083] 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 transmitted by signaling through a bitstream, and the information may be transmitted by signaling 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 may be divided using only quadtree partitioning. Optionally, when the size of the coding block is larger than the size of the maximum conversion block, it may be divided 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 may be divided using only binary tree partitioning 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.

[0084] Coding tree block: may be used as a term for designating any one of a Y coding tree block, a Cb coding tree block, and a Cr coding tree block.

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

[0086] Reconstructed neighboring block: may refer to 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 refer to 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.

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

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

[0089] Parameter set: corresponds to header information in the configuration within the bitstream. At least one of a video parameter set, a sequence parameter set, a picture parameter set, and an 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 a tile header information. The term "tile group" may mean a group of tiles and has the same meaning as a slice.

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

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

[0092] Prediction mode: may be information indicating a mode of encoding / decoding using intra-frame prediction or a mode of encoding / decoding using inter-frame prediction.

[0093] Prediction unit: may represent a basic unit when performing prediction (such as inter-frame prediction, intra-frame prediction, inter-frame compensation, intra-frame compensation, and motion compensation). A single prediction unit 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.

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

[0095] 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 available reference picture lists, including LC (List Combination), L0 (List 0), L1 (List 1), L2 (List 2), L3 (List 3).

[0096] The inter prediction indicator may refer to the direction of inter prediction (unidirectional prediction, bidirectional prediction, etc.) of the current block. 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.

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

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

[0099] A reference picture may refer to a reference picture that is referenced by a specific block for the purpose of performing inter-frame prediction or motion compensation on the specific block. Alternatively, a reference picture may be a picture including a reference block that is 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 replaced with each other.

[0100] A motion vector may be a two-dimensional vector used for inter-frame prediction or motion compensation. A motion vector may represent an offset between a coding / 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.

[0101] The search range may be a two-dimensional area 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.

[0102] The motion vector candidate may refer to a prediction candidate block or a motion vector of the prediction candidate block when predicting a motion vector. In addition, the motion vector candidate may be included in a motion vector candidate list.

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

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

[0105] The motion information may represent information including at least one of the following items: 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.

[0106] The merge candidate list may mean a list consisting of one or more merge candidates.

[0107] The merge candidate may represent a spatial merge candidate, a temporal merge candidate, a combined merge candidate, a combined bi-predictive 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.

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

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

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

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

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

[0113] Scan: may refer to a method of ordering coefficients within a cell, block, or matrix. For example, an operation of changing a two-dimensional matrix of coefficients to a one-dimensional matrix may be called a scan, and an operation of changing a one-dimensional matrix of coefficients to a two-dimensional matrix may be called a scan or an inverse scan.

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

[0115] 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 for which dequantization will be performed 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.

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

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

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

[0119] Default matrix: may represent a predetermined quantization matrix preliminarily defined in an encoder or decoder.

[0120] Non-default matrix: may represent a quantization matrix that is not initially defined in the encoder or decoder but is signaled by the user.

[0121] Statistical value: The statistical value for at least one of the variables, coding parameters, constant values, etc. having calculable specific values ​​can be one or more of the average value, total 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.

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

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

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

[0125] The encoding device 100 may perform encoding on the input image by using an intra mode or an inter mode or both the intra mode and the 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 be switched to the intra mode. Alternatively, when the inter mode is used as a prediction mode, the switch 115 may be switched to the inter mode. Here, the intra mode may represent an intra prediction mode, and the inter mode may represent an inter prediction mode. The encoding device 100 may generate a prediction block for an input block of the input image. In addition, the encoding device 100 may encode the residual block using the residual of the input block and the prediction block after generating the prediction block. The input image may be referred to as a current image as a current encoding target. The input block may be referred to as a current block as a current encoding target, or may be referred to as an encoding target block.

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

[0127] When the prediction mode is the inter-frame mode, the motion prediction unit 111 may retrieve the area that best matches the input block from the reference 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 of the reference image is performed, the reference image may be stored in the reference picture buffer 190.

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

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

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

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

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

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

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

[0135] When entropy coding is applied, symbols are represented so that a smaller number of bits are allocated to symbols with a high probability of generation, and a larger number of bits are allocated to symbols with a low probability of generation, and therefore, the size of the bit stream for the symbol to be encoded can be reduced. The entropy coding unit 150 may use a coding method for entropy coding such as exponential Golomb, context adaptive variable length coding (CAVLC), context adaptive binary arithmetic coding (CABAC), etc. For example, the entropy coding unit 150 may perform entropy coding by using a variable length coding / code (VLC) table. In addition, the entropy coding unit 150 may derive a binarization method of a target symbol and a probability model of a target symbol / binary bit, and perform arithmetic coding by using the derived binarization method and context model.

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

[0137] The coding parameters may include information such as syntax elements (flags, indexes, etc.) that are encoded in the encoder and transmitted to the decoder by signaling, as well as information derived when performing encoding or decoding. The coding parameters may represent information required when encoding or decoding an image. For example, at least one value or combination of the following items may be included in the coding parameters: unit / block size, unit / block depth, unit / block partition information, unit / block shape, unit / block partition structure, whether to perform quadtree partitioning, whether to perform binary tree partitioning, binary tree partition direction (horizontal or vertical), binary tree partition form (symmetric partitioning or asymmetric partitioning), whether the current coding unit is partitioned by ternary tree partitioning, the direction of ternary tree partitioning (horizontal or vertical), the type of ternary tree partitioning (symmetric type or asymmetric type), whether the current coding unit is partitioned by multi-type tree partitioning, the direction of multi-type tree partitioning direction (horizontal or vertical), type of multi-type tree partitions (symmetric or asymmetric) and tree (binary tree or ternary tree) structure of multi-type tree partitions, 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, frame 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 primary (first) transform is used, information on whether secondary transform is used, primary transform index, secondary transform index, residual Information on whether a difference signal exists, coding block pattern, coding block flag (CBF), quantization parameter, quantization parameter residual, quantization matrix, whether to apply an in-loop filter, in-loop filter coefficients, in-loop filter taps, in-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 an adaptive sample point offset, adaptive sample point offset value, adaptive sample point offset category, adaptive sample point 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 value, sign information, reconstructed luminance sample, reconstructed chrominance sample, residual luminance sample, residual chrominance sample, luminance transform coefficient, chrominance transform coefficient, quantized luminance level, quantized chrominance level, transform coefficient level scanning method, size of motion vector search area at decoder side , the shape of the motion vector search area at the decoder side, the number of motion vector searches at the decoder side, information about the CTU size, information about the minimum block size, information about the maximum block size, information about the maximum block depth, information about the minimum block depth, image display / output order, slice identification information, slice type, slice partition information, parallel block identification information, parallel block type, parallel block partition information, parallel block group identification information, parallel block group type, parallel block group partition information picture type, 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. ,

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

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

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

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

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

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

[0144] 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 through a coding unit (CU), and the form and coefficient of ALF to be applied to each block may vary.

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

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

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

[0148] Reference Figure 2 , the decoding device 200 may include an entropy decoding unit 210, an inverse quantization unit 220, an inverse transform unit 230, an intra-frame prediction unit 240, a motion compensation unit 250, an adder 225, a filter unit 260 and a reference picture buffer 270.

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

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

[0151] The decoding device 200 can obtain a reconstructed residual block by decoding the input bit stream and generate a prediction block. When the reconstructed residual block and the prediction block are obtained, the decoding device 200 can generate a reconstructed block that becomes a decoding target by adding the reconstructed residual block to the prediction block. The decoding target block may be referred to as a current block.

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

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

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

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

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

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

[0158] 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 multiple lower-level cells is schematically shown.

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

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

[0161] The partition structure may indicate the distribution of coding units (CUs) within the LCU 310. Such distribution may be determined according to whether a single CU is partitioned into a plurality of (positive integers equal to or greater than 2, including 2, 4, 8, 16, etc.) CUs. The horizontal size and vertical size of the CU generated by partitioning may be half of the horizontal size and vertical size of the CU before partitioning, respectively, or may have sizes smaller than the horizontal size and vertical size before partitioning according to the number of partitioning. The CU may be recursively partitioned into a plurality of CUs. By recursive partitioning, at least one of the height and width of the CU after partitioning may be reduced compared to at least one of the height and width of the CU before partitioning. The partitioning of the CU may be recursively performed until a predefined depth or a predefined size. For example, the depth of the LCU may be 0, and the depth of the smallest 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 as the horizontal size or vertical size or both the horizontal size and the vertical size of the CU decrease through 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.

[0162] In addition, information on whether a CU is partitioned may be indicated by using 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.

[0163] Reference Figure 3 , an LCU with a depth of 0 may be a 64×64 block. 0 may be the minimum depth. An SCU with a depth of 3 may be an 8×8 block. 3 may be the maximum depth. A CU with a block of 32×32 and a block of 16×16 may be represented as depth 1 and depth 2, respectively.

[0164] For example, when a single coding unit is partitioned into four coding units, the horizontal size and vertical size of the four coding units partitioned may be half the horizontal size and vertical size of the CU before being partitioned. In one embodiment, when a coding unit of size 32×32 is partitioned into four coding units, the size of each of the four coding units partitioned may be 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.

[0165] For example, when one coding unit is partitioned into two sub-coding units, the horizontal size or vertical size (width or height) of each of the two sub-coding units may be half of the horizontal size or vertical size of the original coding unit. For example, when a coding unit of size 32×32 is partitioned vertically into two sub-coding units, each of the two sub-coding units may have a size of 16×32. For example, when a coding unit of size 8×32 is partitioned horizontally into two sub-coding units, each of the two sub-coding units may have a size of 8×16. When one coding unit is partitioned into two sub-coding units, the coding unit may be said to be partitioned into two, or partitioned according to a binary tree partition structure.

[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 partitioned vertically into three sub-coding units, the three sub-coding units may have sizes of 8×32, 16×32, and 8×32, respectively, in order from the left sub-coding unit to the right sub-coding unit. When one coding unit is partitioned into three sub-coding units, the coding unit may be said to be partitioned into three sub-coding units or partitioned according to a ternary tree partition structure.

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

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

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

[0170] There may be no priority between binary tree partitioning and ternary tree partitioning. That is, the coding unit corresponding to the leaf node of the quadtree may be further partitioned by any 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 be further partitioned by the binary tree partitioning or the ternary tree partitioning, or may not be further partitioned.

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

[0172] The multi-type tree partition indication information having a first value (eg, "1") may indicate that the current coding unit will be subjected to 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 be subjected to multi-type tree partitioning.

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

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

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

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

[0177] 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 be firstly subjected to binary tree partitioning, and then the coding unit corresponding to the leaf node of the binary tree may be set as the root node for 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.

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

[0179] However, when the size of the coding unit (i.e., the basic unit for partitioning) is larger than the size of the maximum transform block, the coding unit may be recursively partitioned until the size of the coding unit is reduced to be equal to or smaller than the size of the maximum transform block. For example, when the size of the coding unit is 64×64 and when the size of the maximum transform block is 32×32, the coding unit may be partitioned into four 32×32 blocks for transforming. For example, when the size of the coding unit is 32×64 and the size of the maximum transform block is 32×32, the coding unit may be partitioned into two 32×32 blocks for transforming. In this case, the partitioning of the coding unit for transforming is not separately signaled, and the partitioning of the coding unit for transforming may be determined by comparison between the horizontal size or vertical size of the coding unit and the horizontal size or vertical size of the maximum transform block. For example, when the horizontal size (width) of the coding unit is larger than the horizontal size (width) of the maximum transform block, the coding unit may be vertically divided into two equal parts. For example, when the vertical size (length) of the coding unit is larger than the vertical size (length) of the maximum transform block, the coding unit may be horizontally divided into two equal parts.

[0180] Information of the maximum and / or minimum size of the coding unit and information of the maximum and / or minimum size of the transform block may be signaled or determined at a higher level of the coding unit. The higher level may be, for example, a sequence level, a picture level, a slice level, a tile group level, a tile block level, etc. For example, the minimum size of the coding unit may be determined as 4×4. For example, the maximum size of the transform block may be determined as 64×64. For example, the minimum size of the transform block may be determined as 4×4.

[0181] Information of the minimum size of the coding unit corresponding to the leaf node of the quadtree (quadtree minimum size) and / or information of the maximum depth of the multi-type tree from the root node to the leaf node (maximum tree depth of the multi-type tree) may be signaled or determined at a higher level of the coding unit. For example, the higher level may be a sequence level, a picture level, a slice level, a tile group level, a tile level, etc. Information of the minimum size of the quadtree and / or information of the maximum depth of the multi-type tree may be signaled or determined for each of the intra-picture slice and the inter-picture slice.

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

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

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

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

[0186] For example, when the size (horizontal size and vertical size) of the coding unit corresponding to the node of the multi-type tree is greater than the maximum size (horizontal size and vertical size) of the binary tree and / or the maximum size (horizontal size and vertical size) of the ternary tree, the coding unit may not be partitioned into two or three partitions. Therefore, the multi-type tree partition indication information may not be transmitted by a signal, but may be derived from the second value.

[0187] Optionally, when the size (horizontal size and vertical size) of the coding unit corresponding to the node of the multi-type tree is the same as the maximum size (horizontal size and vertical size) of the binary tree and / or is twice as large as the maximum size (horizontal size and vertical size) of the ternary tree, the coding unit may not be further partitioned into two or three partitions. Therefore, the multi-type tree partition indication information may not be transmitted 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 according to the binary tree partition structure and / or the ternary tree partition structure, a coding unit smaller than the minimum size of the binary tree and / or the minimum size of the ternary tree is generated.

[0188] 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 into 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 (e.g., 64×64). For example, when the pipeline buffer size is 64×64, the following division may be limited.

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

[0190] - 128×N (N<=64) binary tree partitions along the horizontal direction for the coding unit

[0191] - N×128 (N<=64) binary tree partitions along the vertical direction for the coding unit

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

[0193] Optionally, the multi-type tree partition indication information can be transmitted by signal only when at least one of the vertical binary tree partition, the horizontal binary tree partition, the vertical ternary tree partition, and the horizontal ternary tree partition is feasible for the coding unit corresponding to the node of the multi-type tree. Otherwise, the coding unit may not be partitioned into two or three partitions. Therefore, the multi-type tree partition indication information may not be transmitted by signal, but may be derived from the second value.

[0194] Optionally, only when both vertical binary tree partitioning and horizontal binary tree partitioning or both vertical ternary tree partitioning and horizontal ternary tree partitioning are feasible for the coding unit corresponding to the node of the multi-type tree, the partition direction information can be transmitted by signal. Otherwise, the partition direction information may not be transmitted by signal, but may be derived from the value indicating the possible partition direction.

[0195] 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 feasible for the coding tree corresponding to the node of the multi-type tree. Otherwise, the partition tree information may not be signaled, but may be derived from a value indicating a possible partition tree structure.

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

[0197] Figure 4 The arrows from the center to the outside in may represent the prediction direction of the intra prediction mode.

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

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

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

[0201] Regardless of the block size, the number of intra-frame prediction modes can be fixed to N. Optionally, 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.

[0202] The intra prediction mode may be a non-angle mode or an angle mode. The non-angle mode may be a DC mode or a planar mode, and the angle mode may be a prediction mode having a specific direction or angle. The intra prediction mode may be represented by at least one of a mode number, a mode value, a mode number, a mode angle, and a mode direction. The number of intra prediction modes may be M, which is greater than 1, including non-angle modes and angle modes. In order to perform intra prediction on a current block, a step of determining whether a sample included in a reconstructed neighboring block can be used as a reference sample of the current block may be performed. When there are samples that cannot be used as reference samples of the current block, a value obtained by copying or interpolating at least one sample value of the samples included in the reconstructed neighboring block, or performing both copying and interpolation, may be used to replace the unavailable sample value of the sample, and thus the replaced sample value is used as the reference sample of the current block.

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

[0204] As in Figure 7 As shown in , at least one of the reference sample line 0 to the reference sample line 3 can be used for intra prediction of the current block. Figure 7 In the example, the samples of fragment A and fragment F may be filled with the samples of the closest fragment B and fragment E, respectively, instead of being retrieved from the reconstructed neighboring blocks. Index information indicating the reference sample line to be used for intra prediction of the current block may be transmitted by signal. 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 transmitted by signal. 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.

[0205] When intra prediction is performed, a filter may be applied to at least one of a reference sample and a prediction sample based on an intra prediction mode and a current block size.

[0206] In the case of the planar mode, when generating the prediction block of the current block, according to the position of the prediction target sample in the prediction block, the sample value of the prediction target sample 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 units may be performed.

[0207] In the case of intra prediction between color components, a prediction block of a second color component of a current block 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 adjacent samples and / or left adjacent samples of the current block and upper adjacent samples and / or left adjacent samples of a reconstruction block of the first color component corresponding thereto. For example, the sample value of the first color component with 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 with the minimum value among the samples in the template and the sample value of the second color component corresponding thereto may be used to derive the parameters of the linear model. When the parameters of the linear model are derived, the corresponding reconstruction block may be applied to the linear model to generate a prediction block of the current block. Depending on the video format, subsampling may be performed on the reconstruction block of the first color component and the adjacent 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.

[0208] The current block may be partitioned into two or four sub-blocks in the horizontal direction or the vertical direction. The partitioned sub-blocks may be sequentially reconstructed. That is, intra prediction may be performed on the sub-block to generate a sub-prediction block. In addition, inverse quantization and / or inverse transformation may be performed on the sub-block to generate a sub-residual block. The reconstructed sub-block may be generated by adding the sub-prediction block to the sub-residual block. The reconstructed sub-block may be used as a reference sample for intra prediction of the sub-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 transmitted by a signal. Intra prediction based on sub-blocks may be limited to being performed only when reference sample line 0 is used. When subblock-based intra prediction is performed, filtering for a prediction block, which will be described later, may not be performed.

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

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

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

[0212] exist Figure 5 In , a rectangle can represent a picture. Figure 5In FIG. 1 , the arrow indicates the prediction direction. According to the encoding type of the picture, the picture can be classified into an intra picture (I picture), a predicted picture (P picture) and a bi-predicted picture (B picture).

[0213] 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 predefined 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.

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

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

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

[0217] The derivation method of motion information may differ 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.

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

[0219] The encoding device 100 may calculate a motion vector difference (MVD) between a motion vector of a current block and a motion vector candidate, and may perform entropy coding on the motion vector difference (MVD). In addition, the encoding device 100 may perform entropy coding on a motion vector candidate index and generate a bitstream. The motion vector candidate index may indicate the best motion vector candidate among the motion vector candidates included in the motion vector candidate list. The decoding device may perform entropy decoding on the motion vector candidate index included in the bitstream, and may select a motion vector candidate of a decoding target block from the motion vector candidates included in the motion vector candidate list by using the entropy-decoded motion vector candidate index. In addition, the decoding device 200 may add the entropy-decoded MVD to the motion vector candidate extracted by entropy decoding, thereby deriving a motion vector of the decoding target block.

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

[0221] In addition, the encoding device 100 calculates a motion vector difference (MVD) between a motion vector in the current block and a candidate motion vector based on an affine model, and performs entropy encoding on the MVD. The decoding device 200 derives a motion vector based on each sub-block by deriving an affine controlled motion vector of a decoding target block through the sum of the entropy-decoded MVD and the affine controlled motion vector candidate.

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

[0223] Another example of a method of deriving motion information of a current block may be a merge mode. The merge mode may indicate a method of merging motions of a plurality of blocks. The merge mode may indicate a mode of deriving motion information of a current block from motion information of a neighboring block. When the merge mode is applied, the motion information of the reconstructed neighboring block and / or the motion information of the co-located block may be used to generate a merge candidate list. The motion information may include at least one of a motion vector, a reference picture index, and an inter-picture prediction indicator. The prediction indicator may indicate unidirectional prediction (L0 prediction or L1 prediction) or bidirectional prediction (L0 prediction and L1 prediction).

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

[0225] The encoding device 100 may generate a bitstream by performing entropy encoding on at least one of a merge flag and a merge index, and may transmit the bitstream to the decoding device 200 using a signal. The merge flag may be information indicating whether a merge mode is performed for each block, and the merge index may be information indicating which neighboring block 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 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.

[0226] In addition, the encoding device 100 performs entropy encoding on the correction information for correcting the motion vector in the motion information of the merge candidate, and transmits it to the decoding device 200 by signal. The decoding device 200 may correct the motion vector of the merge candidate selected by the merge index based on the correction information. Here, the correction information may include at least one of information on whether to perform correction, correction direction information, and correction size information. As described above, the prediction mode that corrects the motion vector of the merge candidate based on the correction information transmitted by the signal may be referred to as a merge mode with a motion vector difference.

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

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

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

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

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

[0232] The decoding apparatus 200 may use the optical flow to compensate for the prediction samples derived through the inter-frame prediction.

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

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

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

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

[0237] The decoder entropy decodes the bit stream to obtain quantization level coefficients. The quantization level coefficients may be arranged in a two-dimensional block form by inverse scanning. For the inverse scanning, at least one of diagonal upper right scanning, vertical scanning, and horizontal scanning may be used.

[0238] The quantization level coefficients may then be inverse quantized, followed by a secondary inverse transform as required, and finally a primary inverse transform as required to produce a reconstructed residual signal.

[0239] 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 for each segment can be transmitted by a signal. The mapping function can be transmitted by 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 a mapping area via mapping using a 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.

[0240] 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 transmitted by signaling at the slice level or the parallel block group level. Scaling can be applied only when the mapping for 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 referring to the lookup table using the index 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 the inverse mapping area by scaling the residual block using the derived value. Then, chroma component block recovery, intra-frame prediction, inter-frame prediction, in-loop filtering, and reference picture storage can be performed in the inverse mapping area.

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

[0242] The prediction block of the current block may be generated based on a block vector indicating the displacement between the current block and the reference block in the current picture. In this way, the prediction mode for generating the prediction block with reference to the current picture is called an intra-block copy (IBC) mode. The IBC mode may be applied to M×N (M<=64, N<=64) coding units. The IBC mode may include a skip mode, a merge mode, an AMVP mode, and the like. In the case of a skip mode or a merge mode, a merge candidate list is constructed, and a merge index is transmitted with a signal so that a merge candidate can be specified. The block vector of the specified merge candidate may be used as the block vector of the current block. The merge candidate list may include at least one of a spatial candidate, a history-based candidate, a candidate based on an average of two candidates, and a zero merge candidate. In the case of the AMVP mode, a difference block vector may be transmitted 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. An index about the neighboring block to be used may be transmitted with a signal. The prediction block in the IBC mode is included in the current CTU or the left CTU and is limited to a block in a reconstructed area. For example, the value of the block vector may be limited so that the prediction block of the current block is located in the region of three 64×64 blocks preceding the 64×64 block to which the current block belongs in the encoding / decoding order. By limiting the value of the block vector in this way, the memory consumption and device complexity of the implementation according to the IBC mode can be reduced.

[0243] The present invention relates to an image encoding / decoding method and apparatus on a per-block basis and a recording medium storing a bit stream, and image encoding / decoding may be performed according to at least one of the embodiments to be described below.

[0244] The image encoding / decoding method and apparatus and the recording medium storing a bit stream of the present disclosure can encode / decode a plurality of blocks in parallel, or encode / decode a current block before completing encoding / decoding of adjacent blocks.

[0245] Here, encoding / decoding may refer to at least one of intra prediction, inter prediction, motion compensation, transform, inverse transform, quantization, inverse quantization, entropy encoding / decoding, deblocking filtering, adaptive sample offset, and filtering in-loop filtering. In addition, encoding / decoding may refer to the process of encoding / decoding.

[0246] In addition, in the example of the present invention to be described later, a block or CU (coding unit) may be configured with luminance pixels of an M×N size within the current picture and corresponding chrominance pixels of an M×N size or less, and may be a unit in an encoder / decoder that performs intra-frame or inter-frame prediction methods, motion vector prediction, transformation and quantization, and entropy encoding / decoding.

[0247] In an example to be described later, a block or a CU is described based on a luma block, and the present invention can be similarly applied to a chroma block.

[0248] In an example to be described later, an embodiment of partial information about a block is shown, but is not limited thereto. At least one of a specific embodiment and a combination of embodiments of at least one piece of information about a block may be applied to at least one of encoding / decoding a current block.

[0249] In addition, in the examples to be described later, various examples of partial information about a block are shown in the information about the block, but are not limited thereto. In the information about the block, a specific embodiment of at least one piece of information about the block and a combination of embodiments can be applied to at least one of encoding / decoding the current block.

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

[0251] In addition, the information about the block may include at least one encoding parameter. In addition, the information about the block may include at least one piece of information for inter-frame prediction, intra-frame prediction, transformation, inverse transformation, quantization, inverse quantization, entropy coding / decoding, and in-loop filtering. In other words, the information about the block may represent at least one value of the following items or a combination of the following items: block size, block depth, block partition information, block shape (square or non-square), whether to perform partitioning in the form of a quadtree, whether to perform partitioning in the form of a binary tree, partition direction in the form of a binary tree (horizontal or vertical), partition shape in the form of a binary tree (symmetric or asymmetric partition), prediction mode (intra-frame prediction or inter-frame prediction), intra-frame brightness prediction mode / angle. Intra-frame chroma prediction mode / angle, intra-frame partition information, inter-frame 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.), inter-frame prediction angle (inter-frame prediction angle of at least one of unidirectional prediction and bidirectional prediction), reference image index (reference image index of at least one of L0, L1, L2, L3, etc.), inter-frame prediction indicator, prediction flag utilization flag, reference image list, motion vector prediction index, motion vector prediction candidate, motion vector candidate list, whether to use merge mode, merge candidate, merge candidate, merge candidate list, whether to use skip mode, interpolation filter type, interpolation filter tap, interpolation filter coefficient, size of motion vector, motion vector representation accuracy (motion vector representation unit, such as,integer samples, 1 / 2 samples, 1 / 2 samples, 1 / 8 samples, 1 / 16 samples, 1 / 32 samples, etc.), transform type, transform size, information on whether to use primary transform, information on whether to use secondary transform, primary transform index, secondary transform index, information on whether there is a residual signal, coding block mode, coding block flag, quantization parameter, residual quantization parameter, quantization matrix, whether to apply in-loop filter, in-loop filter coefficient, in-loop filter tap, in-loop filter graph / shape, whether to apply deblocking filter, deblocking filter coefficient, deblocking filter tap, deblocking filter strength, deblocking filter graph / shape, whether to apply adaptive sample offset, adaptive sample offset value, adaptive sample offset category, adaptive sample offset type, whether to apply adaptive loop filter, adaptive loop filter coefficient, adaptive loop filter tap, adaptive loop filter graph / shape, binarization / debinarization method, context model determination method, context model update method, whether to execute normal mode, whether to execute b bypass mode, upper Below binary bit, bypass binary bit, significant coefficient flag, last significant coefficient flag, coefficient group unit coding flag, last significant coefficient position, flag on whether the coefficient value is greater than 1, flag on whether the coefficient value is greater than 2, flag on whether the coefficient value is greater than 3, information on residual coefficient value, sign information, reconstructed luma sample, reconstructed chroma sample, residual luma sample, residual chroma sample, luma transform coefficient, chroma transform coefficient, luma quantization level, chroma quantization level, transform coefficient scanning method, size of decoder side search area for motion vector, shape of decoder side search area for motion vector, number of decoder side searches for motion vector, information on CTU size, information on minimum block size, information on maximum block size, information on maximum block depth, information on minimum block depth, slice identification information, slice partition information, parallel block identification information, parallel block type, parallel block partition information, input sample bit depth, reconstructed sample bit depth, residual sample bit depth, transform coefficient bit depth and quantization level bit depth. ,

[0252] Figure 8 is a flowchart illustrating an image encoding / decoding method and apparatus and a recording medium storing a bit stream according to an embodiment of the present invention.

[0253] The image encoding / decoding method and device of the present disclosure can perform the following steps: load information about neighboring blocks and encode / decode the current block; store motion information about the current block; perform motion information refinement on the current block; and / or store the refined motion information about the current block.

[0254] Hereinafter, the steps of loading information about neighboring blocks will be described.

[0255] The image encoding / decoding method and device disclosed herein can load information about neighboring blocks. The loaded information about neighboring blocks can be used for inter-frame prediction, intra-frame prediction, transformation, motion information prediction, inverse transformation, quantization, inverse quantization, entropy encoding / decoding, deblocking, in-loop filtering, etc. in encoding / decoding the current block.

[0256] Hereinafter, encoding / decoding of the current block will be described.

[0257] The image encoding / decoding method and apparatus disclosed herein may encode / decode the current block. Here, at least one of the encoding / decoding steps may be performed on the current block by using information about neighboring blocks. Here, encoding / decoding the current block may include at least one of inter-frame prediction, intra-frame prediction, transformation, motion information prediction, inverse transformation, quantization, inverse quantization, entropy encoding / decoding, deblocking, and loop filtering of the current block.

[0258] When performing motion information prediction on the current block, the motion information about the neighboring blocks can be used by considering the motion information about the neighboring blocks as the motion information before refinement (unrefined motion information), or as a fixed value predefined in the encoder / decoder, or as motion information derived by the encoder / decoder in a predefined manner.

[0259] Here, motion information prediction may refer to at least one of the steps (such as motion vector prediction, merge candidate list generation, motion vector candidate list generation, etc.) for encoding / decoding the current block by using motion information about spatially or temporally adjacent positions for which encoding / decoding has been completed.

[0260] In addition, the neighboring block may mean a block including motion information, wherein the motion information may be used for motion information prediction by using a position predefined in an encoder / decoder or by using a method predefined in an encoder / decoder.

[0261] In addition, fixed motion information predefined in the encoder / decoder may be defined as a vector of (0,0), or a scaled vector at a position associated with time, or defined as unavailable motion information.

[0262] In an example, when the method of motion information refinement is used for a neighboring block or a current block, motion information about the neighboring block may be used for motion information prediction by using motion information before refinement. In other words, motion information about the neighboring block may be used for motion information prediction of the current block by determining the motion information about the neighboring block as motion information before refinement.

[0263] At least one of the methods of performing motion information refinement may represent a method of deriving new motion information by using spatially adjacent pixels that have been reconstructed by a decoder, temporally adjacent pixels included in a reference picture, or by using a plurality of pieces of decoded motion information, and generating reconstructed pixels by using the derived motion information. Here, at least one piece of new motion information may be derived by performing a partitioning operation into sub-blocks using the decoded motion information.

[0264] Figure 9a 2 is a diagram illustrating prediction of motion information about a current block according to an embodiment of the present invention.

[0265] Reference Figure 9a , even if DMVR (decoder-side motion vector refinement) is performed on the neighboring block A, motion information prediction for the current block C can be performed by using motion information about the neighboring block stored before DMVR is performed (or unrefined motion information) and / or motion information after refinement (or refined motion information). DMVR is an example of motion information refinement, and indicates a mode of autonomously refining derived motion information.

[0266] In an example, when the position of a neighboring block is included in the same predetermined unit as the current block, motion information about the neighboring block may be used for motion information prediction of the current block by considering the motion information about the neighboring block as motion information before refinement, fixed motion information predefined in an encoder / decoder, or unavailable motion information.

[0267] Here, the predetermined unit may be a predetermined size predefined in the encoder / decoder, or may be the size of the size of the unit signaled through a header or a parameter set. In addition, the predetermined unit may be at least one of a picture, a sub-picture, a partition, a tile group, a tile, a slice, and a slice segment.

[0268] The picture may be partitioned into at least one row of tiles and at least one column of tiles.

[0269] The picture may be partitioned into at least one sub-picture configured with at least one row of tiles and at least one column of tiles. A sub-picture is an area within the picture having a square or non-square shape and may include at least one CTU. In addition, at least one tile / block / strip may be included in one sub-picture.

[0270] A tile is an area having a square or non-square shape within a picture and may include at least one CTU. In addition, a tile may be partitioned into at least one partition.

[0271] A partition may represent at least one row of CTUs within a tile. A tile may be partitioned into at least one partition, and each partition may include at least one row of CTUs. A tile that is not partitioned into at least two blocks may represent a partition.

[0272] The slice may include at least one tile within the picture, and at least one partition may be included within the tile.

[0273] In another example, when the position of the neighboring block is included in the same prediction area or transform area or the same CTU area as the current block, the motion information about the neighboring block may be used for motion information prediction of the current block by considering the motion information about the neighboring block as motion information before refinement, fixed motion information predefined in the encoder / decoder, or unavailable motion information.

[0274] In another example, when the position of the neighboring block is included in the same row of CTU as the current block, the motion information about the neighboring block is used for motion information prediction of the current block by considering the motion information about the neighboring block as motion information before refinement, fixed motion information predefined in the encoder / decoder, or unavailable motion information.

[0275] In another example, when the position of the neighboring block corresponds to the upper side adjacent to the current block, the motion information about the neighboring block may be used for motion information prediction of the current block by considering the motion information about the neighboring block as motion information before refinement, fixed motion information predefined in the encoder / decoder, or unavailable motion information.

[0276] In another example, when the position of the neighboring block corresponds to the left side adjacent to the current block, the motion information about the neighboring block may be used for motion information prediction of the current block by considering the motion information about the neighboring block as motion information before refinement, fixed motion information predefined in the encoder / decoder, or unavailable motion information.

[0277] In another example, when the position of the neighboring block corresponds to a block that is immediately preceding and adjacent to the current block in the encoding / decoding order, the motion information about the neighboring block may be used for motion information prediction of the current block by considering the motion information about the neighboring block as motion information before refinement, fixed motion information predefined in the encoder / decoder, or unavailable motion information.

[0278] In another example, when the position of the neighboring block is included in the same maximum CU size, maximum prediction area, maximum transform area, or the same predefined pipeline buffer size in the encoder / decoder as the size of the current block, the motion information about the neighboring block is used for motion information prediction of the current block by considering the motion information about the neighboring block as motion information before refinement, fixed motion information predefined in the encoder / decoder, or unavailable motion information.

[0279] In another example, when the position of the neighboring block is included in the same parent node as the current block within the block tree structure, the motion information about the neighboring block may be used for motion information prediction of the current block by considering the motion information about the neighboring block as motion information before refinement, fixed motion information predefined in the encoder / decoder, or unavailable motion information.

[0280] When motion information prediction is performed on the current block, among the motion information about the neighboring blocks, the motion information before refinement or the motion information after refinement may be selectively used for encoding / decoding the current block according to the purpose. In addition, both the motion information before refinement and the motion information after refinement may be used for encoding / decoding the current block, or information obtained by combining the motion information before refinement and the motion information after refinement may be used for encoding / decoding the current block.

[0281] In an example, when motion information prediction about a current block is performed by using motion information about a block in a spatially corresponding base layer or a lower layer using scalability, the motion information before refinement is selectively scaled and the result is used for motion information prediction of the current block, or the motion information after refinement is scaled and the result is used for motion information prediction of the current block. In this article, which piece of motion information is to be used may be signaled by including it in a parameter set or header information (VPS, SPS, PPS, slice header, parallel block header, etc.).

[0282] In another example, when OBMC (Overlapped Block Motion Compensation) is used for the current block and whether the motion information about the neighboring block is the same as the motion information about the current block is determined, the refined motion information about the neighboring block may be used to encode / decode the current block. By using this operation, it may be determined whether to perform additional motion compensation or OBMC on the current block. Here, which piece of motion information will be used may be signaled by including it in a parameter set or header information (VPS, SPS, PPS, slice header, parallel block header, etc.).

[0283] When motion information prediction is performed on the current block, motion information before refinement about the neighboring blocks included in the specific area may be used, or motion information after refinement about the neighboring blocks included in the specific area may be selectively used. Here, in order to determine whether the motion information before refinement or the motion information after refinement is used for the current block, by using a flag indicating which piece of information is stored in the internal memory, the external memory, or the line buffer, or by using mode information indicating that the neighboring block is a block for performing motion information refinement, it is determined whether the motion information before refinement or the motion information after refinement is used for the current block, and the determined information is used for motion information prediction of the current block.

[0284] In the example, Figure 9b 1 is a diagram showing another example of the present invention and showing motion information prediction for a current block. Figure 9b As shown in the example of , when motion information prediction is performed on the current block C, motion information about the upper neighboring block is included in the line buffer, so the motion information after refinement can be used, and motion information about the left block is included in the internal memory, so the motion information before refinement can be selectively used.

[0285] In another example, whether to use the motion information before refinement or the motion information after refinement may be determined according to the predefined area. In the example, for the motion information about the upper neighboring block, the motion information after refinement may be set to be used for encoding / decoding the current block, and for the motion information about the left block, the motion information before refinement may be set to be used for encoding / decoding the current block. Here, a flag indicating which piece of information stored in the internal memory, the external memory, or the line buffer is to be used may not be signaled.

[0286] When motion information prediction is performed on the current block and spatial motion information prediction is performed, even when motion information prediction is performed by using motion information before refinement, temporal motion information about the current block may be derived by using motion information after refinement when temporal motion information prediction is performed. Therefore, in the motion information list predicted for the current block, motion information before refinement and motion information after refinement may exist.

[0287] In an example, when a motion vector candidate list is generated or a merge candidate list is generated, and the maximum number of motion vector candidates or merge candidates is N, while configuring the list by using motion information before refinement through spatial motion information prediction, temporal motion information may be generated by performing temporal motion information prediction when the number of available motion information is less than N to consider the time difference of motion information at a specific position of a previously encoded / decoded picture. Here, for motion information about a specific position of a previous picture, motion information after refinement may be used. Therefore, the predicted temporal motion information finally derived may represent motion information after refinement. Here, N may be a positive integer.

[0288] In another example, when generating a motion vector candidate list or generating a merge candidate list, even when deriving scaled temporal motion information or additional merge candidates, the refined motion information may be used.

[0289] When entropy encoding / decoding a picture and deriving statistical information from previously encoded / decoded information by using motion information such as motion information or motion vector difference, motion information after refinement or motion information before refinement may be selectively used, or both of them may be used. Here, which method will be used may be signaled by including it in a parameter set or header information (VPS, SPS, PPS, slice header, parallel block header, etc.). Alternatively, information obtained by combining motion information after refinement and motion information before refinement may be used.

[0290] In an example, the magnitude of the absolute value of the motion vector included in the motion information before refinement and the motion vector included in the motion information after refinement may be regarded as a motion vector residual value, and it may be used to calculate statistical information. The derived statistical information may be used to entropy encode / decode the current picture, derive global motion information, derive motion within an object, etc.

[0291] In another example, statistical information about motion vectors may be calculated by using only motion information before refinement or motion information after refinement. The derived statistical information may be used to entropy encode / decode the current picture, derive global motion information, derive motion within an object, etc.

[0292] In another example, the motion information before refinement or the motion information after refinement may be used for transcoding.

[0293] When encoding / decoding a current block, motion information before and / or after refinement about a neighboring block adjacent to the current block may be used.

[0294] In an example, in at least one of inter prediction, motion compensation, transform, inverse transform, quantization, inverse quantization, entropy encoding / decoding, deblocking filtering, adaptive sample offset, and adaptive loop filtering of a current block, motion information before refinement about a neighboring block adjacent to the current block may be used.

[0295] For example, the spatial motion vector may be predicted by using motion information before refinement about neighboring blocks adjacent to the current block. Alternatively, the boundary strength in deblocking filtering may be determined by using motion information before refinement about neighboring blocks adjacent to the current block.

[0296] In another example, in at least one of inter prediction, motion compensation, transform, inverse transform, quantization, inverse quantization, entropy encoding / decoding, deblocking filtering, adaptive sample offset, and adaptive loop filtering of the current block, refined motion information about a neighboring block adjacent to the current block may be used.

[0297] For example, the motion information about the current block may be determined by using the refined motion information about the neighboring block temporally adjacent to the current block. Here, the refined motion information about the neighboring block temporally adjacent to the current block may represent the motion information of the col block about the current block.

[0298] Alternatively, the boundary strength in the deblocking filtering may be determined by using refined motion information about neighboring blocks adjacent to the current block.

[0299] In another example, in at least one of the processes of generating a motion vector candidate list of the current block and generating a merge candidate list of the current block, motion information before refinement of a neighboring block adjacent to the current block may be used. Here, the temporal motion vector or the temporal motion vector based on each sub-block may be determined by using the motion information before refinement.

[0300] In another example, in at least one of generating a motion vector candidate list for a current block and generating a merge candidate list for a current block, refined motion information about a neighboring block adjacent to the current block may be used. Here, the spatial motion vector may be determined by using the motion information before refinement.

[0301] In another example, at least one of the motion vector candidate list and the merge candidate list of the current block may be configured by using only motion information before refinement about neighboring blocks adjacent to the current block.

[0302] In another example, when motion information about a neighboring block adjacent to the current block is refined motion information, when configuring at least one of a motion vector candidate list and a merge candidate list of the current block, the refined motion information about the neighboring block may be determined to be unavailable.

[0303] In addition, the motion vector before refinement and the motion vector after refinement of the current block may be stored in a memory or a buffer, and the motion vector before refinement and the motion vector after refinement of the current block may be used when configuring at least one of a motion vector candidate list and a merge candidate list of neighboring blocks adjacent to the current block.

[0304] In addition, after performing motion information refinement, the motion vector before refinement stored for the current block may be stored by replacing the motion vector before refinement stored for the current block with the motion vector after refinement.

[0305] In addition, the motion vector after refinement stored after refinement of the motion information for the current block may be stored by replacing the motion vector after refinement stored after refinement of the motion information for the current block with the motion vector before refinement.

[0306] In another example, when spatial motion information prediction is performed on the current block, motion information before refinement about the neighboring blocks may be used, and when temporal motion information prediction, temporal motion vector prediction based on each sub-block, and deblocking filtering are performed, motion information after refinement may be used.

[0307] In another example, when spatial motion information prediction and deblocking filtering are performed on the current block, motion information before refinement about the neighboring block may be used, and when temporal motion information prediction and temporal motion vector prediction are performed based on each sub-block, motion information after refinement may be used.

[0308] In another example, when spatial motion information prediction is performed on the current block, motion information before refinement about the neighboring block may be used, and when deblocking filtering, temporal motion information prediction, and temporal motion vector prediction are performed based on each sub-block, motion information after refinement may be used.

[0309] In another example, when the current block and the neighboring block are included in the same CTU, motion information before refinement about the neighboring block may be used when configuring at least one of a motion vector candidate list and a merge candidate list of the current block.

[0310] In another example, when the current block and the neighboring block are not included in the same CTU, refined motion information about the neighboring block may be used when configuring at least one of a motion vector candidate list and a merge candidate list of the current block.

[0311] In another example, when the current block and the neighboring block are included in the same row of CTU, motion information before refinement about the neighboring block may be used when configuring at least one of a motion vector candidate list and a merge candidate list of the current block.

[0312] In another example, when the current block and the neighboring block are not included in the same row of CTUs, refined motion information about the neighboring block may be used when configuring at least one of a motion vector candidate list and a merge candidate list of the current block.

[0313] When motion information prediction is performed on the current block, and the position of the neighboring block is included in an arbitrary region immediately preceding in the coding / decoding order, the motion information on the neighboring block may be used by regarding the motion information on the neighboring block as motion information before refinement or fixed motion information predefined in the encoder / decoder. Alternatively, when the position of the neighboring block is included in an arbitrary region immediately preceding in the coding / decoding order, the motion information on the neighboring block may be used by regarding the motion information on the neighboring block as motion information after refinement or fixed motion information predefined in the encoder / decoder.

[0314] Here, the fixed motion information predefined in the encoder / decoder may be defined as a vector of (0,0), a scaled vector at a position associated with time, or unavailable motion information.

[0315] In the above example, the motion information may include at least one of a motion vector, a reference picture index, an inter prediction indication, and a reference picture utilization flag.

[0316] In the above example, when determining the boundary strength in deblocking filtering, the motion vector before refinement or the motion vector after refinement may be used, and whether to perform filtering on the block boundary may be determined according to the determined boundary strength. When determining to apply filtering, at least one of strong filtering and weak filtering may be performed.

[0317] In the above example, when the skip mode or the merge mode is used for a specific block, bidirectional prediction is performed, and the product of the POC difference between the current image and the reference image at the L0 angle and the POC difference between the current image and the reference image at the L1 angle is less than 0, it can be determined that motion information refinement with respect to the specific block is performed. When the product of the POC difference between the current image and the reference image at the L0 angle and the POC difference between the current image and the reference image at the L1 angle is less than 0, this may indicate that the current image is located between the reference image in the L0 direction and the reference image in the L1 direction.

[0318] Hereinafter, a step of storing motion information about a current block will be described.

[0319] The image encoding / decoding method and apparatus of the present disclosure may store motion information about a current block.

[0320] In an example, when the current block is a block on which motion information refinement is performed, motion information before refinement may be stored in a line buffer, an internal memory, or an external memory, and when the current block is a block on which motion information refinement is not performed, decoded motion information may be stored in a line buffer, an internal memory, or an external memory.

[0321] Here, when motion information before refinement is stored for the current block, the stored motion information before refinement may be used when performing at least one process of encoding / decoding a neighboring block that is encoded / decoded after the current block.

[0322] In addition, when a specific block is not adjacent to a boundary of a CTU, a picture, a sub-picture, a slice, a tile, a partition, etc., motion information before refinement about the specific block may be stored, and when at least one process of encoding / decoding a neighboring block that is encoded / decoded after the current block is performed, the stored motion information before refinement may be used.

[0323] In another example, when information about a current block is stored and the current block is a block on which motion information refinement is performed, a flag or mode information indicating motion information before refinement or motion information before refinement and at least one of a fixed value predefined in an encoder / decoder may be stored in a line buffer, an internal memory, and an external memory.

[0324] Here, the predefined value may be a vector of (0,0) or a vector at a position associated with a previous time picture for which encoding / decoding has been completed.

[0325] In addition, storage in the online buffer and the external memory results in consumption of memory bandwidth, and thus storage in the internal memory may be performed in order to reduce the memory bandwidth.

[0326] In another example, when storing information about the current block, in an internal memory for motion information prediction of blocks included in a predetermined unit, motion information before refinement or a fixed value predefined in an encoder / decoder may be stored.

[0327] Here, motion information prediction may refer to steps used when encoding / decoding the current block by using motion information about a spatially or temporally adjacent position that has already completed encoding / decoding, such as motion vector prediction, merge candidate list generation, motion vector candidate list generation, etc.

[0328] Here, the predetermined unit may be a fixed size predefined in the encoder / decoder, such as a CTU, a maximum CU size, and a block size of a parent node in a block tree structure. Alternatively, the block size may be signaled via a header or parameter set of an SPS, a PPS, a tile group, a tile, a slice, or a slice segment.

[0329] In another example, when information about a current block is stored and a mode of the current block is a mode in which motion information refinement is performed, motion information before refinement may be stored so as to be used for spatial motion information prediction of a block after the current block or for deblocking a boundary of the current block. In other words, motion information before refinement may be stored in an internal memory or a line buffer and may be used as at least one piece of candidate motion information when spatial motion information prediction is performed on a block encoded / decoded after the current block. In addition, when deblocking is performed on the current block by storing motion information before refinement in an internal memory or a line buffer, motion information before refinement may be used.

[0330] In another example, when information about the current block is stored and the mode of the current block is a mode for performing motion information refinement, motion information before refinement may be stored so as to be used for spatial motion information prediction of a block after the current block. In other words, motion information before refinement may be stored in an internal memory or a line buffer and may be used as at least one piece of candidate motion information when performing spatial motion information prediction on a block encoded / decoded after the current block.

[0331] In another example, when information about the current block is stored and the mode of the current block is a mode for performing motion information refinement, the refined motion information may be stored so as to be used to perform deblocking on a boundary between a block after the current block and the current block. The refined motion information may be used to perform deblocking on a boundary of the current block by storing the refined motion information in an internal memory or a line buffer.

[0332] Hereinafter, the steps of performing motion information refinement on the current block will be described.

[0333] The image encoding / decoding method and apparatus of the present disclosure may perform motion information refinement on the current block. When performing motion information refinement on the current block, the refined motion information that minimizes image degradation may be derived by performing motion estimation and refinement on a spatially or temporally adjacent position using motion information derived by loading information about neighboring blocks, encoding / decoding the current block, and / or storing motion information about the current block. Subsequently, the reconstructed pixels of the current block may be generated or predicted by using the refined motion information.

[0334] Refining the motion information of the current block may require an additional step of performing motion estimation or deriving motion information on a per-block basis at a small size. Therefore, processing the additional steps is time-consuming. In addition, since a waiting time for encoding / decoding subsequent blocks is also generated, throughput may be reduced.

[0335] Reference Figure 8, the encoding / decoding method and apparatus of the present disclosure can start encoding / decoding the current block before completing encoding / decoding of the neighboring blocks. Therefore, the delay or throughput reduction caused by motion information can be solved.

[0336] The mode for performing motion information refinement may be a mode for updating motion information by performing a predetermined process such as motion estimation using decoded information and pixels. In other words, the mode is a mode for deriving new motion information by performing refinement again on motion information calculated by entropy decoding and / or motion information prediction. For example, the mode for performing motion information refinement may include DMVR, optical flow (BIO, BDOF), FRUC, bilateral matching, etc.

[0337] When motion information refinement is performed on a current block and the current block is larger than a size of a predetermined motion information refinement performance block, motion information refinement may be performed by partitioning the current block into sub-blocks.

[0338] In an example, the current block may be partitioned into at least one sub-block, and motion information refinement may be performed on each sub-block.

[0339] In another example, when a subblock is defined as a W×H shape (where W and H are positive integers other than 0, respectively, where W represents width and H represents height), motion information refinement may be performed by partitioning the current block into at least one subblock when the current block is larger than the W×H shape. Here, W and H may be 16.

[0340] In another example, a sub-block may be defined as a fixed number of pixels instead of a shape, and motion information refinement may be performed by partitioning the current block into sub-blocks having the fixed number of pixels.

[0341] In another example, motion information refinement may be performed by partitioning the current block into sub-blocks according to a combination of shape and the number of pixels.

[0342] Here, each sub-block may share motion information about the current block (CU). In addition, each sub-block may use the motion information about the current block as a start motion vector for motion information refinement. Optionally, the motion information about the current block may be used as initial motion information about each sub-block. In addition, the prediction list utilization flag information about the current block may be used as the prediction list utilization flag information about each sub-block. Here, before performing motion information refinement on each sub-block, the initial motion information may be set as the motion information before performing motion information refinement on the current block.

[0343] Therefore, motion compensation may be performed independently on each sub-block without depending on each other, and the image encoding / decoding method and apparatus of the present disclosure may perform parallel processing.

[0344] In another example, when the width and / or height of the current block is greater than 16, the current block can be partitioned into sub-blocks with a width and / or height of 16. Here, motion information refinement can be performed based on each sub-block.

[0345] Here, the maximum size of the pre-defined motion information refinement execution block can be 16×16.

[0346] Here, the number of sub-blocks in the horizontal direction can be an integer value obtained by dividing the width of the current block by 16. Additionally, the number of sub-blocks in the vertical direction can be an integer value obtained by dividing the height of the current block by 16.

[0347] When motion information refinement is performed on the current block and the current block is larger than the size of the pre-defined motion information refinement execution block, motion information refinement can be performed by partitioning the current block into sub-blocks. Here, at least one incomplete sub-block can be included.

[0348] Here, when the width or height of the current block is not a multiple of the width (W) or height (H) of the pre-defined motion information refinement execution block respectively, the shape of the incomplete sub-block can be SW×SH (where SW < W or SH < H).

[0349] In the example, motion information refinement can be omitted for the incomplete sub-block. In other words, motion compensation for the incomplete sub-block can be performed by using the motion information about the current block.

[0350] In another example, motion information refinement may not be performed on the incomplete sub-block, and motion compensation for the incomplete sub-block can be performed by sharing motion information after refinement of the spatially adjacent complete sub-blocks with a W×H shape. Here, for the incomplete sub-block located at the right corner within the current block, the motion information of the complete sub-block exactly on the left can be used. Optionally, for the incomplete sub-block located at the lowest corner within the current block, the motion information about the complete sub-block exactly above can be used. Optionally, for the incomplete sub-block located at the lower right corner within the current block, the motion information about the complete sub-block exactly at the upper left can be used. In other words, the motion information before refinement of the incomplete sub-block can be derived from the motion information before refinement of the spatially adjacent complete sub-blocks. Additionally, the motion information after refinement of the incomplete sub-block can be derived from the motion information after refinement of the spatially adjacent complete sub-blocks.

[0351] Additionally, the spatially adjacent complete sub-blocks used when deriving the motion information about the incomplete sub-block can be different from each other when deriving the motion information before refinement and the motion information after refinement.

[0352] When performing motion information refinement on the current block, padding or low-complexity interpolation filters may be used for the reference region. Memory bandwidth or usage complexity may be reduced by using padding or low-complexity interpolation filters.

[0353] When the maximum range of motion information refinement based on each integer pixel in at least one direction (up, down, left or right) is S (S is a positive integer other than 0), the range of the maximum reference area used for motion compensation or motion estimation can be extended by S compared with the range of the maximum reference area before the motion information refinement. Therefore, the memory bandwidth increases or the size of the cache memory increases. Therefore, the image encoding / decoding method and apparatus of the present disclosure solve the above-mentioned problem by using a padding or low-complexity interpolation filter.

[0354] In an example, padding may be performed on the value of the outermost pixel within a reference range required by the interpolation filter.

[0355] Fig.10 is a diagram illustrating filling a reference area according to an embodiment of the present invention.

[0356] Reference Fig.10 , the encoder / decoder may perform motion estimation or motion compensation by performing padding on the values ​​of the outermost pixels within the reference range required by the interpolation filter, so that the outer area of ​​the reference range required by the interpolation filter is not used when performing motion information refinement. As a result, the memory bandwidth and the size of the cache memory may be the same as when motion information refinement is not performed.

[0357] In another example, the length of the interpolation filter may be adjusted when performing motion information refinement. In other words, to perform motion estimation or motion compensation, the encoder / decoder may use an interpolation filter having a relatively short length so as to reduce the range of the reference region required for motion interpolation. For example, the interpolation filter may represent a bilinear interpolation filter.

[0358] Fig.11 is a diagram illustrating adjusting the length of an interpolation filter according to an embodiment of the present invention.

[0359] Reference Fig.11 , even when an 8-tap interpolation filter is used for general motion compensation, a low complexity 4-tap or 2-tap interpolation filter may be used for motion compensation or motion estimation in a mode of performing motion information refinement. Here, the 4-tap interpolation filter may represent an interpolation filter having a search area of ​​+2, -2.

[0360] Therefore, the range of the reference area required for interpolation can be reduced by four or five pixel lines in the vertical direction, or by four or five pixel lines in the horizontal direction. As a result, the memory bandwidth and the size of the cache memory can be the same as the case where motion information refinement is not performed. Here, the low complexity interpolation filter can be used only for motion estimation in the mode in which motion information refinement is performed, and when motion compensation is performed, the same interpolation filter as that of another mode can be used.

[0361] When motion information refinement is performed on the current block and it is determined that the motion vector after refinement or the candidate motion vector during refinement exceeds the range of the minimum motion vector or the maximum motion vector predefined in the encoder and / or decoder, the encoder and / or decoder may perform the operations described below.

[0362] In an example, the encoder / decoder may not implicitly perform motion information refinement.

[0363] In another example, the encoder / decoder may use candidate search points or motion vectors within a search region, wherein motion vectors not exceeding a minimum motion vector or a maximum motion vector in the search region are derived as candidates for the motion information after refinement.

[0364] In another example, the encoder / decoder may use clipping so that the motion vector after refinement is included within a predetermined range.

[0365] In another example, the encoder / decoder may use scaling so that the motion vector after refinement is included in a predetermined range.

[0366] In another example, the encoder / decoder may perform motion information refinement by setting a maximum cost value for search points that exceed a maximum motion vector.

[0367] In other words, the encoder / decoder may derive a new motion vector by using the same search method and the same motion vector derivation method for candidate motion vectors, and may determine a motion vector having a minimum search cost as the motion vector after refinement.

[0368] For example, for L0 and L1, a new motion vector may be derived by using the same search method and the same motion derivation method while using candidate motion vectors of different directions.

[0369] Here, when the candidate motion vector exceeds the maximum motion vector or the minimum motion vector, a predefined maximum value (e.g., 232-1, 264-1, etc.) may be set for the search cost of the candidate motion vector. In addition, for the search cost, a cost evaluation method such as SAD (sum of absolute differences), SSD (sum of square differences), etc. may be used.

[0370] For example, by using SAD, a candidate motion vector can be derived in which the difference between the pixel value at the position indicated by the candidate motion vector in the area within the LO reference picture and the pixel value at the position indicated by the vector opposite to the candidate motion vector in the area within the L1 reference picture is minimized. Here, the candidate motion vector can be a refined motion vector.

[0371] In addition, the case where the candidate motion vector exceeds the minimum motion vector includes the case where at least one of the x and y values ​​of the candidate motion vector is smaller than the x and y values ​​of the corresponding minimum motion vector.

[0372] In addition, the case where the candidate motion vector exceeds the maximum motion vector includes a case where at least one of the x and y values ​​of the candidate motion vector exceeds the x and y values ​​of the corresponding maximum motion vector.

[0373] Here, the maximum motion vector or the minimum motion vector may be signaled through a header or parameter set (log2_max_mv_length_horizontal, log2_max_mv_length_vertical of SPS VUI), or may be derived by using a value predefined in the same range in an encoder / decoder.

[0374] Fig.12a is a diagram illustrating an operation when a motion vector candidate exceeds a minimum motion vector range when performing motion information refinement according to an embodiment of the present invention.

[0375] Reference Fig.12a , when it is defined in the encoder / decoder that the x or y value of the minimum motion vector is -32768 and the motion vector before refinement is (5, -32768), motion information refinement may be performed by using refinement candidates A to H of the motion information. Here, in the case of position A, position B, and position C, the y value of the motion vector after motion information refinement becomes -32769, and thus becomes smaller than the y value of the minimum motion vector. Therefore, as described above, position A, position B, and position C may not be used as motion compensation candidates, or the search costs at position A, position B, and position C may be set to a predefined maximum value.

[0376] When motion information refinement is performed on the current block, and it is determined that the motion vector after refinement or the motion vector candidate during refinement (or the refinement candidate of the motion information) exceeds the MCTS (motion constrained parallel block set) or parallel block boundary, or exists within the boundary but the reference area of ​​the interpolation filter considered exceeds the MCTS or parallel block boundary, the encoder and / or decoder may perform the following operations.

[0377] In an example, the encoder / decoder may not implicitly perform motion information refinement.

[0378] In another example, the encoder / decoder may not use the corresponding candidate search point or the corresponding candidate motion vector as a candidate motion vector.

[0379] In another example, the encoder / decoder may perform motion information refinement by setting the cost of a corresponding candidate search point or a corresponding candidate motion vector to a maximum value.

[0380] In another example, the encoder / decoder may determine the MCTS or tile boundary as the picture boundary and perform motion information refinement by padding the pixels at the boundary. Here, the encoder / decoder may determine the MCTS or tile boundary as the picture boundary and perform motion information refinement by padding the pixels at the boundary.

[0381] Figure 12b is a diagram illustrating an operation when a motion vector candidate exceeds a limit in MCTS when performing motion information refinement according to an embodiment of the present invention.

[0382] The encoder / decoder may use a 6-tap interpolation filter. The restriction in the MCTS may indicate that a restriction is applied so as to use a region corresponding to the current MCTS in time when performing encoding / decoding.

[0383] Reference Figure 12b , in the case of motion vector X of the motion information before refinement, the same is true for the sub-pixel (1 / 2 pixel) position, and interpolation filtering is required. Here, the positions of the integer pixels used for interpolation filtering exist within the current MCTS, and therefore do not violate the MCTS restriction. However, in the case of motion vector candidate A, the same is true for the sub-pixel position, and interpolation filtering is required. Here, among the integer pixels a0 to integer pixels a5 used for interpolation filtering, a2 is a pixel that exists in another MCTS, and therefore violates the MCTS restriction. Like motion vector candidate A, motion vector candidates B and C violate the MCTS restriction. Therefore, as described above, position A, position B, and position C may not be used as motion vector candidates, motion refinement candidates, or motion compensation candidates. Optionally, the search cost for A, B, and C may be set to a predefined maximum value.

[0384] Hereinafter, a step of storing the refined motion information about the current block will be described.

[0385] The image encoding / decoding method and apparatus of the present disclosure may store motion information about a current block.

[0386] In case of a mode in which motion information refinement is performed on a current block, motion information before refinement on the current block and / or motion information after refinement on the current block may be stored.

[0387] In an example, at least one of the motion information before refinement, the motion information after refinement, and / or the flag of the motion information after refinement may be stored. For example, at least one of the motion information before refinement, the motion information after refinement, and / or the flag of the motion information after refinement may be stored in a line buffer, an internal memory, and / or an external memory.

[0388] In another example, flags or mode information indicating motion information before refinement and motion information after refinement may be stored.

[0389] In addition, storing in the line buffer and / or the external memory causes consumption of memory bandwidth, and therefore only the refined motion information is stored in the line buffer and / or the external memory in order to reduce bandwidth consumption.

[0390] In another example, information about motion information before refinement of the current block and / or the neighboring blocks and information about a difference between the motion information before refinement and the motion information after refinement may be stored.

[0391] In another example, information about the refined motion information of the current block and / or the neighboring blocks and information about the difference between the motion information before refinement and the motion information after refinement may be stored.

[0392] In another example, when the refined motion information about the current block is stored, encoding / decoding is performed on a neighboring block encoded / decoded after the current block, and the stored refined motion information may be used.

[0393] In case of a mode in which motion information refinement is performed on a current block, motion information before refinement and motion information after refinement may be stored in different memories or parameters according to a use purpose.

[0394] In an example, motion information before refinement about the current block may be used for spatial motion information prediction of a block following the current block and / or for deblocking the current block.

[0395] In another example, when motion compensation is performed on the current block and / or temporal motion information prediction is performed on any block of a picture encoded / decoded after the current image, the refined motion information about the current block may be used to derive at least one motion information candidate.

[0396] In an example, motion information before refinement about a current block may be used to predict spatial motion information for a block following the current block.

[0397] In another example, when deblocking is performed on the current block, motion compensation is performed on the current block, and / or temporal motion information prediction is performed on any block of a picture encoded / decoded after the current picture, at least one motion information candidate may be derived using the refined motion information about the current block.

[0398] In another example, the motion information before refinement may be used by storing the motion information before refinement in an internal memory.However, the motion information after refinement may be used by storing the motion information after refinement in an external memory and / or a line buffer.

[0399] In another example, when the refined motion information about the current block is stored and all blocks included in a predetermined unit are encoded / decoded, the refined motion information may be stored in a line buffer or an internal memory, as well as an external memory.

[0400] Here, when the motion information before refinement used when performing motion information prediction on the block included in the predetermined unit is stored in the internal memory, it may be updated to the motion information after refinement. In addition, according to a predetermined condition, the motion information before refinement may not be updated to the motion information after refinement. For example, when the motion information after refinement is equal to or greater than a predefined threshold range, the update may not be performed.

[0401] In case of a mode in which motion information refinement is performed on a current block, when the current block is larger than a size of a predefined motion information refinement performing block, motion information refinement may be performed by dividing the current block into sub-blocks.

[0402] In an example, at least one refined motion information may be derived for a current block. The at least one refined motion information may be stored in a temporal motion vector memory. In addition, when temporal motion information prediction is performed on any block of a picture encoded / decoded after the current picture, the stored refined motion information may be used when deriving at least one motion information candidate.

[0403] In an example, at least one refined motion information about a sub-block may be derived for a current block. The at least one refined motion information about the sub-block may be stored in a temporal motion vector memory. In addition, when temporal motion information prediction is performed on any block of a picture encoded / decoded after the current picture, the stored refined motion information may be used when deriving at least one motion information candidate.

[0404] In case of a mode in which motion information refinement is performed on a current block, used motion information may vary according to locations of neighboring blocks.

[0405] In an example, the motion information before refinement may be stored in an internal memory. Additionally, the motion information after refinement may be stored in an external memory and / or a line buffer.

[0406] In another example, Figure 9b In the example of , when motion estimation is performed on the current block C, for motion information about the upper neighboring block, the motion information after refinement may be used, and for motion information about the left neighboring block, the motion information before refinement may be used.

[0407] In another example, Figure 9b In the example of , when motion estimation is performed on the current block C, for motion information about the upper neighboring block, motion information before refinement may be used, and for motion information about the left neighboring block, motion information after refinement may be used.

[0408] In another example, when motion estimation is performed on the current block and the motion information before / after refinement is used for the motion information about some neighboring blocks, for the motion information about the remaining neighboring blocks, the motion information after / before refinement may be used, respectively. Figure 9b In the example of , when motion estimation is performed on the current block C and the motion information after refinement is used for the motion information about the upper neighboring block, unlike the upper block, the motion information before refinement may be used for the motion information about the left neighboring block.

[0409] In addition, when a specific block is adjacent to a boundary of a CTU, a picture, a sub-picture, a slice, a tile, a partition, etc., the refined motion information about the specific block may be stored. In addition, when encoding / decoding a neighboring block encoded / decoded after the current block, the stored refined motion information may be used.

[0410] For various CU sizes, the encoder of the present disclosure can determine the CU size that is optimal in terms of rate distortion. In addition, the encoder of the present disclosure can determine the best mode for each CU in terms of rate distortion in various prediction modes (intra-frame prediction, inter-frame prediction, merge / skip, etc.).

[0411] In general, the hardware of the encoder can be used by independent hardware blocks respectively responsible for the CU size. In order to increase the throughput, the mode determination process and the encoding process can be adopted in a pipeline form. Here, in inter-frame prediction, motion estimation and motion compensation can be performed even if the mode determination process and the encoding process of the neighboring block are not completed. However, in the merge mode, the motion information about the neighboring block can be used as it is, so when the mode determination process of the neighboring block has been completed, the encoding and motion compensation in the merge mode of the current block can be performed. Therefore, by waiting until the mode determination process of the neighboring block is completed, a delay may occur for the current block, and thus the throughput is reduced.

[0412] According to the present invention, in the case of a neighboring block undergoing mode determination processing, motion information about the neighboring block may not be used, or fixed motion information predefined in an encoder / decoder may be used in order to solve the problems of delay occurrence and throughput reduction.

[0413] The image encoding / decoding method of the present disclosure can be used for merge mode, and for inter-frame prediction, affine mode, OBMC using motion information about neighboring blocks. In addition, the image encoding / decoding method can be used in a method using motion information on a per-subblock basis.

[0414] Figures 13a to 13c are diagrams respectively illustrating encoding of a current block according to embodiments of the present invention.

[0415] exist Figures 13a to 13c In the example shown in , it is assumed that the size of the CTU is 128×128, there may be three candidates (CU 64×64, CU 32×32, CU 16×16) for the CU size, and encoding is performed on the current block C2.

[0416] Reference Fig.13a and Fig.13b , the current block C2 to be encoded is located in the first 64×64 area within the second CTU.

[0417] Reference Fig.13c , showing the processing order and encoding progress status of the candidates of the CU size. The mode determination process for the current block may be started when the encoding of the previous block has been completed in the encoding / decoding order. Here, the completion of the encoding may mean that the mode determination process has been completed for various modes, information about the final motion vector and about the reconstructed pixels has been derived, and the corresponding information is stored in the internal memory. In addition, in order to increase the throughput, for the encoder disclosed in the present invention, the mode determination process and the encoding process may be adopted in a pipeline form. In addition, in order to increase the throughput, the mode determination process for the subsequent blocks in the encoding / decoding order must be performed before the encoding / decoding of any block is completed. Here, for the intra-frame prediction mode using the pixels of the neighboring blocks, the encoding of the neighboring blocks must be completed. However, for the inter-frame prediction mode, the merge / skip mode, the affine mode, the OBMC mode, etc., the encoding may be performed by using the motion information about the neighboring blocks that have completed the encoding.

[0418] In an example, when encoding of the current block C2 is started, motion information prediction may be performed by using motion information about the neighboring block A and / or the neighboring block D for which encoding has been completed, and thus encoding may be performed for an inter prediction mode, a merge / skip mode, an affine mode, an OBMC mode, etc. Therefore, here, it may be determined whether encoding of the neighboring blocks used in the mode for motion information prediction has been completed.

[0419] Reference Fig.13c , showing the processing order and encoding progress status of CU size candidates.

[0420] Reference Fig.13c , a CU 64×64 hardware block as C0, a CU 32×32 hardware block as C1, and a CU 16×16 hardware block as C2 are current encoding target blocks, and motion information prediction of the above blocks may be performed.

[0421] Here, when motion information prediction is performed on block C0, motion information about block E, which is a previous block in encoding / decoding order, may not be used. In addition, when motion information prediction is performed on block C1, motion information about block F may not be used. In addition, when motion information prediction is performed on block C2, motion information of block B may not be used.

[0422] In addition, each hardware block (CU 64×64, CU 32×32, CU 16×16) can perform encoding at the same time, so for block C2, it may not be possible to use motion information about a region that additionally includes block E and block FDP. In addition, for block C1, motion information about a region that additionally includes block E may not be used. In short, when motion information prediction is performed on block C2, motion information about neighboring blocks B, E, and F may not be used.

[0423] Therefore, as far as the encoder is concerned, by excluding the area being encoded in the reference area of ​​the current block, and by using the motion information about the neighboring blocks included in the remaining area where the encoding has been completed, performing motion information prediction can be effective in terms of compression efficiency. However, as an example of generating a merge candidate list, when a step of determining whether the motion information about the neighboring block at a predefined position is valid (i.e., whether it is not intra-frame prediction) or determining whether it is the same as the motion information added to the list is included, the prediction mode and / or motion information about the neighboring block may be provided to the encoder / decoder so that the same merge candidate list is generated.

[0424] The encoder / decoder of the present disclosure can improve throughput and minimize the loss of compression efficiency by encoding / decoding the current block before completing the encoding of the adjacent blocks. In one example, with respect to the encoder, the method of determining the adjacent block being encoded and / or excluding the process of generating a merge candidate list for the corresponding adjacent block can be applied to the decoder of the present disclosure in the same manner. In another example, the encoder / decoder of the present disclosure can use motion information about another adjacent block or motion information generated by using a method predefined in the encoder / decoder to replace the excluded candidate motion information.

[0425] Fig.14 is a diagram of a flowchart of generating a merge candidate list according to an embodiment of the present invention.

[0426] When deriving spatial merge candidates, the encoder / decoder may determine whether the position of the predefined neighboring block is included in the encoding / decoding area. In addition, a virtual coding area may be determined, and the corresponding area and / or block may be excluded from the process of generating the merge candidate list. Here, the virtual coding area may represent the neighboring block and the area being encoded.

[0427] Figures 15a to 15c 2 are diagrams respectively illustrating a merge candidate list generated according to an embodiment of the present invention.

[0428] exist Figures 15a to 15c In the example shown in , the merge candidate list of the current block C2 may include up to five merge candidates. In addition, when generating the merge candidate list, the neighboring block A, the neighboring block B, the neighboring block D, and the neighboring block E may be used, and the neighboring block A, the neighboring block B, the neighboring block D, and the neighboring block E may be added to the merge candidate list in the order of the neighboring block A, the neighboring block B, the neighboring block D, and the neighboring block E.

[0429] Fig.15a An example of generating a merge candidate list in a case where it is uncertain whether a neighboring block is included in a virtual coding region and assuming that encoding / decoding of the neighboring block has been completed is shown.

[0430] Fig.15b An example of generating a merge candidate list by determining whether a neighboring block is included in a virtual coding area and excluding blocks included in the virtual coding area according to the determination is shown. Here, the encoding of the neighboring block B and the neighboring block E can be as follows: Figures 13a to 13c The process is shown in FIG. 5 , where neighboring blocks B and E are excluded from the merge candidate list, and additional motion information may be added according to merge candidate indexes 3 and 4.

[0431] Fig.15cAnother example of generating a merge candidate list by determining whether a neighboring block is included in a virtual coding region and excluding a block included in the virtual coding region according to the determination is shown. Fig.15b In contrast, instead of the neighboring block B and the neighboring block E excluded from the merge candidate list, motion information on B′ and E′ completed encoding / decoding at respective positions adjacent to B and E may be added to the merge candidate list.

[0432] In addition, the order in which the additional motion information and / or the motion information at the position where the encoding / decoding has been completed is added to the merge candidate list may be different from that in Fig.15b or Fig.15c The example shown in .

[0433] When motion information prediction is performed and the position of the neighboring block to be used is included in the area just before in the encoding / decoding order (i.e., the virtual coding area), the motion information about the corresponding neighboring block may not be used for the motion information prediction about the current block, or predefined fixed motion information may be used for the motion information prediction of the current block. Here, the virtual coding area may be a block having a size equal to or larger than the size of the current block among the block sizes estimated to be used in the encoder. Alternatively, the virtual coding area may represent the size of a pipeline buffer predefined in the encoder / decoder.

[0434] When motion information prediction is performed and the position of the neighboring block to be used is included in the virtual coding area where the current block is located (i.e., when the position of the neighboring block to be used exists within the grid of the same virtual coding area), motion information about the corresponding neighboring block may not be used for motion information prediction of the current block, or predefined fixed motion information may be used for motion information prediction of the current block.

[0435] Even if the exact sizes of all candidate blocks actually used in the encoder are not provided, the decoder can derive the virtual coding area by assuming that the encoder has used the minimum block size and the maximum block size (or the maximum transform size) predefined in the encoder / decoder and all block sizes included in the minimum block size and the maximum block size. Alternatively, the encoder can signal the minimum block size, the maximum block size, or the sizes of all blocks through a header (SPS, PPS, slice header, parallel block header, etc.) or a parameter set, and the decoder can derive the minimum block size, the maximum block size, or the sizes of all blocks used in the encoder by using the signaled information.

[0436] Fig.16 is a diagram illustrating positions of neighboring blocks that are not used when predicting motion information about various blocks in an encoder according to an embodiment of the present invention.

[0437] exist Fig.16In the example of , the size of the CTU is 128×128, and the encoding candidate blocks may include a 64×64 block, a 32×32 block, a QU AD 32 block obtained by partitioning a 32×32 region into four 16×16 blocks, a VERT_BI 32 block obtained by partitioning a 32×32 region into two 16×32 blocks, a HOR_BI 32 block obtained by partitioning a 32×32 region into two 32×16 blocks, a TRI_VERT32 block obtained by partitioning a 32×32 region into two 8×32 blocks and one 16×32 block, and a TRI_HOR 32 block obtained by partitioning a 32×32 region into two 32×8 blocks and one 32×16 block.

[0438] When performing motion information prediction, by excluding motion information about neighboring blocks included in a virtual coding area, or by replacing the motion information with another information, throughput can be improved.

[0439] exist Fig.16 In the example of FIG. 1 , when motion information prediction is performed on a block or a region, an unused block or region may be indicated by using an arrow.

[0440] In an example, when motion information prediction is performed on the third 64×64 block, motion information included in an immediately preceding 64×64 region (that is, the second 64×64 region) in encoding / decoding order may not be used.

[0441] In another example, when motion information prediction is performed on SINGLE32, which is a candidate block of the fourth 32×32 region within the third 64×64 region, motion information included in the immediately preceding 32×32 region in the encoding / decoding order (that is, the third 32×32 region within the third 64×64 region) may not be used. In addition, motion information included in the immediately preceding 64×64 region in the encoding / decoding order (that is, the second 64×64 region) may not be used.

[0442] In another example, when motion information prediction is performed on block 1 (16×32) of VERT_BI 32 which is a candidate block of the second 32×32 region within the fourth 64×64 region, motion information included in the immediately preceding 16×32 region (that is, immediately preceding block 0) in the encoding / decoding order may not be used. In addition, motion information included in the immediately preceding 32×32 region (that is, the first 32×32 region within the fourth 64×64 region) in the encoding / decoding order may not be used. In addition, motion information included in the immediately preceding 64×64 region (that is, the third 64×64 region) in the encoding / decoding order may not be used.

[0443] When an arbitrary region is partitioned into a plurality of blocks, by assuming that encoding of all blocks within the arbitrary region is performed simultaneously, motion information existing within the arbitrary region may not be used, or fixed motion information predefined in an encoder / decoder may be used.

[0444] In an example, in case of a TRI_VERT 32 partition, for block 2 within a 32×32 area, motion information about block 1 or motion information about block 0 may be used.

[0445] In another example, in case of TRI_HOR 32 partition, for block 2 within the 32×32 area, motion information about block 1 or motion information about block 0 may be used.

[0446] The encoder of the present disclosure may not specify a virtual coding region for at least one block size, or may specify a virtual coding region for at least one block size. Here, the encoder may signal information about the block size of a specified or unspecified virtual coding region through a header (SPS, PPS, slice header, parallel block header, etc.) or a parameter set, and the decoder may derive the specified virtual coding region by using the signaled information.

[0447] Fig.17a and Fig.17b are diagrams respectively illustrating designated virtual encoding areas according to embodiments of the present invention.

[0448] In the example, Fig.17a In the example shown in , for a current block C of size 16×16, motion information about neighboring blocks B, F, and E included in previous regions (16×16, 32×32, 64×64) in encoding / decoding order may not be used.

[0449] Here, when the 64×64 block size is not specified as the virtual coding area, as in Fig.17b In the example shown in , motion information included in the neighboring block E may be used.

[0450] In another example, Fig.17a In the embodiment, when the block sizes of 16×16 and 64×64 are not designated as virtual coding areas, for the current block C of the size of 16×16, motion information included in the neighboring block B and the neighboring block E may be used.

[0451] When performing image encoding / decoding, in intra-frame prediction, the pixels of the current block can be predicted by using the pixels of the neighboring blocks that have completed encoding / decoding. Therefore, multiple blocks cannot be encoded / decoded at the same time, and it is difficult to improve throughput when a pipeline is adopted.

[0452] When encoding / decoding in intra-frame prediction mode, the image encoding / decoding method and device of the present disclosure generates virtual reference pixels to replace the neighboring block pixels that have been encoded / decoded, so that multiple blocks in any unit can be encoded / decoded simultaneously.

[0453] Fig.18 2 is a diagram illustrating encoding / decoding performed on a parallel PU including two subblocks by using intra prediction according to an embodiment of the present invention. Here, the subblock may refer to a subblock.

[0454] In intra prediction, generally, when encoding / decoding of subblock 1 is completed, encoding / decoding of subblock 2 may be performed. However, according to the present invention, when entropy encoding / decoding is performed (a step of performing entropy encoding / decoding), encoding / decoding of two subblocks may be started at the same time. Here, encoding / decoding may be performed on prediction mode and / or transform coefficient information of at least one subblock within a parallel PU, and encoding / decoding may be performed on at least one subblock at the same time.

[0455] When generating reference pixels, the final reference pixels can be generated by loading reference pixels that have completed encoding / decoding and used for intra-frame prediction and performing filtering on them. Here, when neighboring blocks exist on the same parallel PU, virtual reference pixels can be generated to replace the reconstructed reference pixels. Optionally, reference pixels can be generated in parallel PUs, and the generated reference pixels can be shared between sub-blocks within the parallel PU.

[0456] In intra prediction, intra prediction on a current block may be performed by using reconstructed reference pixels or virtual reference pixels.

[0457] During inverse quantization and inverse transformation, the step of generating reference pixels and the step of performing intra prediction may be performed simultaneously.

[0458] When generating the reconstructed block, the reconstructed block may be generated by adding the reconstructed residual signal to the intra prediction signal. Subsequently, encoding / decoding of block 1 / 2 may be terminated.

[0459] Fig.19 2 is a diagram illustrating performing decoding on a parallel PU including three subblocks by using intra prediction according to an embodiment of the present invention.

[0460] exist Fig.19 In the example shown in , when performing intra prediction on each subblock, reconstructed reference pixels and / or virtual reference pixels may be used. The dotted area represents a parallel PU. The prediction direction used in intra prediction may be represented by using arrows.

[0461] In the case of subblock 1, encoding / decoding of neighboring blocks has been completed, so intra prediction can be performed by using reconstructed reference pixels. The intra prediction mode of block 1 is the diagonal mode.

[0462] In the case of sub-block 2, encoding / decoding of sub-block 2 may be performed simultaneously using left sub-block 1, and virtual reference pixels within sub-block 1 may be generated by using the intra prediction mode of sub-block 1. Therefore, intra prediction of sub-block 2 may be performed by using the upper reconstructed reference pixels and / or the left virtual reference pixels.

[0463] In the case of sub-block 3, encoding / decoding of sub-block 3 may be performed simultaneously using sub-block 1 and / or sub-block 2, and virtual reference pixels within sub-block 2 may be generated by using the horizontal mode as the intra-prediction mode of sub-block 2. Therefore, intra-prediction of sub-block 3 may be performed by using the upper reconstructed reference pixels and / or the left virtual reference pixels.

[0464] Fig. 20 2 is a diagram illustrating decoding performed on a parallel PU including three subblocks by using intra prediction according to another embodiment of the present invention.

[0465] exist Fig. 20 In the example shown in , intra prediction for each subblock can be performed by using reconstructed reference pixels and / or virtual reference pixels. The dotted area represents parallel PUs. The prediction direction used in intra prediction can be represented by using arrows.

[0466] Inter prediction is performed on subblock 1 and subblock 3, and intra prediction is performed on subblock 2.

[0467] In the case of subblock 1, the inter prediction mode is used, and thus encoding / decoding can be performed on subblock 1 without using pixels of neighboring blocks.

[0468] In the case of sub-block 2, encoding / decoding of sub-block 2 may be performed simultaneously using left sub-block 1, and virtual reference pixels within sub-block 1 may be generated by using the inter-prediction mode of sub-block 1. Therefore, intra-prediction of sub-block 2 may be performed by using the upper reconstructed reference pixels and / or the left virtual reference pixels.

[0469] In the case of subblock 3, encoding / decoding of subblock 3 can be performed simultaneously using subblock 1 and / or subblock 2, and an inter-frame prediction mode is used, so encoding / decoding of subblock 3 can be performed without using pixels of neighboring blocks.

[0470] For any parallel PU, a unit predefined in the encoder / decoder may be used, or a step of signaling through a header (SPS, PPS, etc.) or a parameter set may be performed and thus the same parallel PU is used in the encoder / decoder. Optionally, a minimum square block size predefined in the encoder / decoder or signaled through a header or parameter set may be used as a parallel PU. Optionally, when a block partitioning method of a quadtree, binary tree, and ternary tree is used, in the case of binary tree and ternary tree partitioning, the block size of the parent node may be used as a parallel PU.

[0471] Whether to use the parallel prediction method of the present disclosure may be defined in a configuration file or may be signaled through a header (SPS, PPS, etc.) or a parameter set.

[0472] When generating virtual reference pixels, accurate reference pixels may be generated by performing filtering (low-pass filtering, etc.) between the prediction signal and the reconstructed reference pixels instead of generating accurate reference pixels by using only the prediction signal of the neighboring block.

[0473] When a parallel prediction method is used and intra prediction is performed by using virtual reference pixels, there is no significant difference in prediction accuracy even if multiple intra predictions are used, so the amount of bits required to represent the intra prediction mode can be reduced by limiting the number of intra prediction modes.

[0474] Fig.21 is a diagram illustrating a flowchart of an image decoding method according to an embodiment of the present invention.

[0475] At S2101 , the decoder may decode information on whether to perform motion information refinement from a bitstream.

[0476] Here, the information on whether to perform motion information refinement may be signaled through a parameter set or at least one of a video parameter set, a sequence parameter set, a sub-picture parameter set, a picture parameter set, an adaptation parameter set, a slice header, a tile header, and a partition header.

[0477] At S2102 , the decoder may obtain second motion information for first motion information about the current block based on information about whether to perform motion information refinement.

[0478] Here, the first motion information may be initial motion information about the current block. In addition, the second motion information may be information obtained by performing refinement on the first motion information.

[0479] In addition, when the current block is equal to or larger than a predetermined block size, the second motion information may be obtained by partitioning the current block into at least one sub-block and performing motion information refinement on the at least one sub-block.

[0480] In addition, when at least one of a width and a height of the current block is equal to or greater than a predetermined block size, the second motion information may be obtained by partitioning the current block into at least one subblock and performing motion information refinement on the at least one subblock.

[0481] Here, the predetermined block size may be 16.

[0482] In addition, initial motion information about the current block may be used as initial motion information about the subblock.

[0483] In addition, the second motion information can be obtained by using the pixel values ​​indicated by the candidate motion vector in the area within the LO reference picture for the current block and the pixel values ​​indicated by the vector opposite to the candidate motion vector in the area within the L1 reference picture for the current block.

[0484] In addition, the first motion information about the current block may be used for at least one of spatial motion vector prediction of neighboring blocks of the current block and determination of boundary strength of deblocking filtering.

[0485] In addition, the second motion information about the current block may be used to predict motion information for the col block of the neighboring block about the current block.

[0486] In S2103 , the decoder may reconstruct at least one of the current block and the neighboring blocks of the current block by using at least one of the first motion information and the second motion information.

[0487] Fig. 22 is a diagram illustrating a flowchart of an image encoding method according to an embodiment of the present invention.

[0488] At S2201 , the encoder may determine whether to perform motion information refinement.

[0489] At S2202 , the encoder may encode information on whether to perform motion information refinement based on the determination.

[0490] Here, information about whether to perform motion information refinement may be signaled through at least one of a parameter set or a video parameter set (video parameter set), a sequence parameter set, a sub-picture parameter set, a picture parameter set, an adaptation parameter set, a slice header, a tile header, and a partition header.

[0491] In addition, according to the present invention, in a computer-readable non-transitory recording medium storing video data used in an image decoding method, the image data may include information on whether to perform motion information refinement. In addition, in the image decoding method, the information on whether to perform motion information refinement may be used to obtain second motion information for first motion information about a current block, and at least one of the first motion information and the second motion information may be used to reconstruct at least one of the current block and a neighboring block of the current block.

[0492] The above-described embodiments may be performed in the same manner in an encoder and a decoder.

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

[0494] The order in which the above-described embodiments are applied may be different between the encoder and the decoder, or the order in which the above-described embodiments are applied may be the same in the encoder and the decoder.

[0495] The above-described embodiments 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.

[0496] The shape of the block to which the above-described embodiment of the present invention is applied may have a square shape or a non-square shape.

[0497] The above-mentioned embodiments of the present invention may be applied according to the size of at least one of a coding block, a prediction block, a transform block, a block, a current block, a coding unit, a prediction unit, a transform unit, a unit, and a current unit. Here, the size may be defined as a minimum size or a maximum size or both a minimum size and a maximum size, so that the above-mentioned embodiments are applied, or the size may be defined as a fixed size to which the above-mentioned embodiments are applied. In addition, in the above-mentioned 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-mentioned embodiments may be applied according to a combination according to the size. In addition, the above-mentioned 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-mentioned embodiments may be applied when the block size is included in a specific range.

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

[0499] The above-described embodiments of the present invention may be applied according to time layers. In order to identify the time layers to which the above-described embodiments may be applied, a corresponding identifier may be transmitted by a signal, and the above-described 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-described embodiments may be applied, or may be defined as a specific layer indicating that the embodiments are applied. In addition, a fixed time layer to which the embodiments are applied may be defined.

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

[0501] A slice type or a tile group type to which the above-described embodiments of the present invention are applied may be defined, and the above-described embodiments may be applied according to the corresponding slice type or tile group type.

[0502] In the above embodiments, the method is described based on a flowchart having a series of steps or units, but the present invention is not limited to the order of the steps, but some steps may be performed simultaneously with other steps or in a different order. In addition, it should be understood by those of ordinary skill in the art that the steps in the flowchart are not mutually exclusive, and other steps may be added to the flowchart, or some steps may be deleted from the flowchart without affecting the scope of the present invention.

[0503] The embodiments include various aspects of the examples. All possible combinations of the 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 alternatives, modifications and changes within the scope of the claims.

[0504] Embodiments of the present invention may be implemented in the form of program instructions, which may be executed by various computer components and recorded in a computer-readable recording medium. A 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 may be known to a person of ordinary skill in the field of computer software technology. Examples of computer-readable recording media include magnetic recording media, such as hard disks, floppy disks, and magnetic tapes; optical data storage media, such as CD-ROMs or DVD-ROMs; magnetically optimized media, such as floppy disks; and hardware devices specially constructed to store and implement program instructions, such as read-only memory (ROM), random access memory (RAM), flash memory, etc. 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. A hardware device may be configured to be operated by one or more software modules to perform processing according to the present invention, and vice versa.

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

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

[0507] Industrial Applicability

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

Claims

1. A method for decoding an image, the method comprising: decoding information from a bitstream regarding whether to perform motion information refinement; obtaining second motion information of the current block by refining the first motion information of the current block based on the information; generating a prediction block of the current block based on the second motion information; generating a residual block of a current block from a bitstream; as well as Generate a reconstructed block of the current block based on the prediction block of the current block and the residual block of the current block, The first motion information of the current block is used for spatial motion vector prediction of the first block decoded later than the current block. The second motion information of the current block is used for temporal motion vector prediction of a second block decoded later than the current block.

2. The method according to claim 1, wherein: The information on whether to perform motion information refinement is signaled through a parameter set or at least one of a video parameter set, a sequence parameter set, a sub-picture parameter set, a picture parameter set, an adaptation parameter set, a slice header, a tile header, and a partition header.

3. The method according to claim 1, wherein: The first motion information is initial motion information about the current block, and the second motion information is information obtained by performing refinement on the first motion information.

4. The method according to claim 1, wherein: The second motion information is obtained by partitioning the current block into at least one sub-block and performing motion information refinement on the at least one sub-block when the current block is larger than a predetermined block size.

5. The method according to claim 1, wherein: The second motion information is obtained by partitioning the current block into at least one sub-block and performing motion information refinement on the at least one sub-block when at least one of a width and a height of the current block is greater than a predetermined block size.

6. The method according to claim 5, wherein: Initial motion information about the current block is used as initial motion information of the subblock.

7. The method according to claim 3, wherein: The second motion information is obtained by using pixel values ​​indicated by a candidate motion vector in an area within the LO reference picture for the current block and using pixel values ​​indicated by a vector opposite to the candidate motion vector in an area within the L1 reference picture for the current block.

8. The method according to claim 1, wherein: The first motion information about the current block is used to determine the boundary strength of the deblocking filtering.

9. A method for encoding an image, the method comprising: determining whether to perform motion information refinement; obtaining second motion information of the current block by refining the first motion information of the current block based on the determination; generating a prediction block of the current block based on the second motion information; Generate a residual block of the current block based on the prediction block of the current block; Generate transform coefficients by transforming a residual block of the current block; as well as encoding information regarding whether to perform motion information refinement based on the determination, The first motion information of the current block is used to predict the spatial motion vector of the first block decoded later than the current block. The second motion information of the current block is used for temporal motion vector prediction of a second block decoded later than the current block.

10. A computer-readable non-transitory recording medium storing a bit stream, wherein: The bit stream is encoded by at least one processor by using an image encoding method, the image encoding method comprising: determining whether to perform motion information refinement; Based on the determination, obtaining second motion information of the current block by refining the first motion information of the current block; generating a prediction block of the current block based on the second motion information; Generate a residual block of the current block based on the prediction block of the current block; Generate transform coefficients by transforming the residual block of the current block; and Based on the determination, encoding information regarding whether to perform motion information refinement, The first motion information of the current block is used to predict the spatial motion vector of the first block decoded later than the current block. The second motion information of the current block is used for temporal motion vector prediction of a second block decoded later than the current block.