Image encoding / decoding method and method for transmitting bit stream

By considering enhanced performance conditions in image encoding/decoding, derive symmetric motion vector difference mode information, the problem of low image encoding/decoding efficiency in the prior art is solved, and more efficient image data transmission and storage are achieved.

CN120050429APending Publication Date: 2025-05-27ELECTRONICS & TELECOMM RES INST
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510227097.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2019-03-15
Filing Date
2020-03-06
Publication Date
2025-05-27

AI Technical Summary

Technical Problem

When the prior art improves image encoding/decoding efficiency, it is difficult to effectively utilize the symmetric MVD derivation method, resulting in an increase in image data transmission and storage costs.

Method used

By considering the enhanced performance conditions, symmetric motion vector difference mode (MVD) information is derived, thereby improving image encoding and decoding efficiency. The specific steps include obtaining symmetric motion vector difference mode availability information and zero motion vector difference information from the bitstream, encoding and decoding the symmetric motion vector difference mode of the current block based on these information, and using the information to generate a prediction block.

Benefits of technology

The effect of improving image encoding and decoding efficiency is achieved, the cost of image data transmission and storage is reduced, and a recording medium storing the bitstream generated by the image decoding method is provided.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120050429A_ABST
    Figure CN120050429A_ABST
Patent Text Reader

Abstract

Disclosed herein are an image encoding / decoding method and a method of transmitting a bitstream. An image decoding method according to the present invention comprises: acquiring symmetric motion vector difference mode available information from a bitstream; obtaining first prediction direction zero motion vector difference information from the bit stream; acquiring symmetric motion vector difference mode information of the current block from the bitstream based on the symmetric motion vector difference mode available information and the first prediction direction zero motion vector difference information; obtaining first prediction direction reference picture index information, second prediction direction reference picture index information and a first prediction direction motion vector difference value based on the symmetric motion vector difference mode information; and generating a prediction block of the current block by using at least one of the first prediction direction reference picture index information, the second prediction direction reference picture index information, and the first prediction direction motion vector difference.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of a patent application with an application date of March 6, 2020, an application number of 202080019697.0, and a title of "Image Encoding / Decoding Method and Method for Transmitting a Bitstream". Technical Field

[0002] The present invention relates to an image encoding / decoding method and apparatus, and a recording medium for storing a bitstream. Background Art

[0003] Recently, in various applications, the demand for high-resolution and high-quality images (such as high-definition (HD) or ultra-high-definition (UHD) images) has increased. As the resolution and quality of images increase, the amount of data correspondingly increases. This is one of the reasons for the increase in transmission costs and storage costs when transmitting image data through existing transmission media (such as wired or wireless broadband channels) or when storing image data. To solve these problems of high-resolution and high-quality image data, efficient image encoding / decoding techniques are required.

[0004] There are various video compression techniques, such as: an inter-frame prediction technique that predicts the value of a pixel in a current image from the values of pixels in a previous image or a subsequent image; an intra-frame prediction technique that predicts the value of a pixel in another region of a current image from the values of pixels in a region of the current image; a transform and quantization technique that compresses the energy of a residual signal; and an entropy encoding technique that assigns a short code to frequently occurring pixel values and a long code to less frequently occurring pixel values). Summary of the Invention

[0005] Technical Problem

[0006] When using a symmetric MVD derivation method to improve encoding / decoding efficiency, the present invention can provide a method and apparatus for deriving an MVD by considering enhanced performance conditions.

[0007] An object of the present invention is to provide a method and apparatus for encoding and decoding a picture that improve encoding and decoding efficiency.

[0008] Another object of the present invention is to provide a recording medium for storing a bitstream generated by an image decoding method or apparatus according to the present invention.

[0009] Technical Solution

[0010] An image decoding method according to an embodiment of the present invention includes: obtaining symmetric motion vector difference pattern availability information from a bitstream; obtaining zero motion vector difference information in a first prediction direction from the bitstream; obtaining symmetric motion vector difference pattern information of a current block from the bitstream based on the symmetric motion vector difference pattern availability information and the zero motion vector difference information in the first prediction direction; obtaining reference picture index information in the first prediction direction, reference picture index information in the second prediction direction, and a motion vector difference value in the first prediction direction based on the symmetric motion vector difference pattern information; and generating a prediction block of the current block by using at least one of the reference picture index information in the first prediction direction, the reference picture index information in the second prediction direction, and the motion vector difference value in the first prediction direction, wherein the steps of obtaining the reference picture index information in the first prediction direction, the reference picture index information in the second prediction direction, and the motion vector difference value in the first prediction direction are obtained by derivation from the bitstream rather than decoding the bitstream when the symmetric motion vector difference pattern information of the current block indicates a symmetric motion vector difference pattern to obtain the reference picture index information in the first prediction direction, the reference picture index information in the second prediction direction, and the motion vector difference value in the first prediction direction.

[0011] In the image decoding method of the present invention, wherein the first prediction direction is the L1 prediction direction and the second prediction direction is the L0 prediction direction.

[0012] In the image decoding method of the present invention, wherein the zero motion vector difference information in the first prediction direction indicates that the motion vector difference value in the first prediction direction is not decoded but is derived as (0, 0).

[0013] In the image decoding method of the present invention, wherein the zero motion vector difference information in the first prediction direction is obtained at the picture level.

[0014] In the image decoding method of the present invention, wherein the symmetric motion vector difference pattern availability information is obtained at the sequence level.

[0015] In the image decoding method of the present invention, wherein when the symmetric motion vector difference pattern information of the current block indicates a symmetric motion vector difference pattern, the motion vector difference value in the first prediction direction is derived based on the motion vector difference value in the second prediction direction of the current block.

[0016] In the image decoding method of the present invention, wherein when the symmetric motion vector difference pattern information of the current block indicates a symmetric motion vector difference pattern, the reference picture index information in the first prediction direction is derived as the index of the backward reference picture closest to the current picture in the reference picture list in the first prediction direction, and the reference picture index information in the second prediction direction is derived as the index of the forward reference picture closest to the current picture in the reference picture list in the second prediction direction.

[0017] In the image decoding method of the present invention, when the symmetric motion vector difference mode information of the current block indicates the symmetric motion vector difference mode, the reference picture index information in the first prediction direction is derived as the index of the forward reference picture closest to the current picture in the reference picture list in the first prediction direction, and the reference picture index information in the second prediction direction is derived as the index of the backward reference picture closest to the current picture in the reference picture list in the second prediction direction.

[0018] In the image decoding method of the present invention, when the symmetric motion vector difference mode information of the current block indicates the symmetric motion vector difference mode, the reference picture index information in the first prediction direction and the reference picture index information in the second prediction direction are derived as the indexes of short-term reference pictures.

[0019] The image encoding method according to an embodiment of the present invention includes: determining symmetric motion vector difference mode availability information; determining zero motion vector difference information in the first prediction direction; encoding the symmetric motion vector difference mode information of the current block based on the symmetric motion vector difference mode availability information and the zero motion vector difference information in the first prediction direction; and determining whether to encode the reference picture index information in the first prediction direction, the reference picture index information in the second prediction direction, and the motion vector difference value in the first prediction direction based on the symmetric motion vector difference mode information, wherein the step of determining whether to encode the reference picture index information in the first prediction direction, the reference picture index information in the second prediction direction, and the motion vector difference value in the first prediction direction is determined not to encode the reference picture index information in the first prediction direction, the reference picture index information in the second prediction direction, and the motion vector difference value in the first prediction direction when the symmetric motion vector difference mode information of the current block indicates the symmetric motion vector difference mode.

[0020] In the image encoding method of the present invention, the first prediction direction is the L1 prediction direction, and the second prediction direction is the L0 prediction direction.

[0021] In the image encoding method of the present invention, the zero motion vector difference information in the first prediction direction indicates that the motion vector difference value in the first prediction direction is not encoded but is derived as (0, 0).

[0022] In the image encoding method of the present invention, the zero motion vector difference information in the first prediction direction is encoded at the picture level.

[0023] In the image encoding method of the present invention, the symmetric motion vector difference mode availability information is encoded at the sequence level.

[0024] In the image coding method of the present invention, when the symmetric motion vector difference mode information of the current block indicates the symmetric motion vector difference mode, the motion vector difference value in the first prediction direction is derived based on the motion vector difference value in the second prediction direction of the current block.

[0025] In the image coding method of the present invention, when the symmetric motion vector difference mode information of the current block indicates the symmetric motion vector difference mode, the reference picture index information in the first prediction direction is derived as the index of the backward reference picture closest to the current picture in the reference picture list in the first prediction direction, and the reference picture index information in the second prediction direction is derived as the index of the forward reference picture closest to the current picture in the reference picture list in the second prediction direction.

[0026] In the image coding method of the present invention, when the symmetric motion vector difference mode information of the current block indicates the symmetric motion vector difference mode, the reference picture index information in the first prediction direction is derived as the index of the forward reference picture closest to the current picture in the reference picture list in the first prediction direction, and the reference picture index information in the second prediction direction is derived as the index of the backward reference picture closest to the current picture in the reference picture list in the second prediction direction.

[0027] In the image coding method of the present invention, when the symmetric motion vector difference mode information of the current block indicates the symmetric motion vector difference mode, the reference picture index information in the first prediction direction and the reference picture index information in the second prediction direction are derived as the indexes of short-term reference pictures.

[0028] A non-transitory computer-readable recording medium storing a bitstream generated by an image coding method according to an embodiment of the present invention, wherein the image coding method includes: determining symmetric motion vector difference mode availability information; determining zero motion vector difference information in the first prediction direction; encoding the symmetric motion vector difference mode information of the current block based on the symmetric motion vector difference mode availability information and the zero motion vector difference information in the first prediction direction; and determining whether to encode the reference picture index information in the first prediction direction, the reference picture index information in the second prediction direction, and the motion vector difference value in the first prediction direction based on the symmetric motion vector difference mode information, wherein the step of determining whether to encode the reference picture index information in the first prediction direction, the reference picture index information in the second prediction direction, and the motion vector difference value in the first prediction direction is determined not to encode the reference picture index information in the first prediction direction, the reference picture index information in the second prediction direction, and the motion vector difference value in the first prediction direction when the symmetric motion vector difference mode information of the current block indicates the symmetric motion vector difference mode.

[0029] Beneficial effects

[0030] According to the present invention, an image encoding / decoding method and apparatus with improved compression efficiency can be provided. When using a symmetric MVD derivation method, the present invention can improve image encoding / decoding efficiency by providing an MVD derivation method and apparatus that take into account enhanced performance conditions.

[0031] According to the present invention, an image encoding / decoding method and apparatus with enhanced encoding and decoding efficiency can be provided.

[0032] In addition, according to the present invention, a recording medium storing a bitstream generated by the image encoding method or apparatus of the present invention can be provided.

[0033] In addition, according to the present invention, a recording medium storing a bitstream received and decoded by the picture decoding apparatus of the present invention and used for reconstructing a picture can be provided. BRIEF DESCRIPTION OF THE DRAWINGS

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

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

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

[0037] Figure 4 is a diagram showing intra prediction processing.

[0038] Figure 5 is a diagram showing an example of inter prediction processing.

[0039] Figure 6 is a diagram showing transform and quantization processing.

[0040] Figure 7 is a diagram showing reference sample points that can be used for intra prediction.

[0041] Figure 8 is a flowchart showing an image encoding method according to an embodiment of the present invention.

[0042] Figure 9 is a flowchart showing an image decoding method according to an embodiment of the present invention.

[0043] Figure 10 is a diagram showing spatial neighboring blocks of an encoding target block / decoding target block.

[0044] Figure 11 is a diagram showing temporal neighboring blocks of an encoding target block / decoding target block.

[0045] Figure 12 is a diagram for explaining history-based motion vector candidate derivation.

[0046] Figures 13 to 18 is a diagram for explaining various embodiments of the syntax and semantics related to the symmetric MVD mode according to the present invention.

[0047] Figure 19 is a flowchart for explaining an image decoding method according to an embodiment of the present invention.

[0048] Figure 20 is a diagram for explaining an image encoding method according to an embodiment of the present invention. Detailed Description of the Invention

[0049] Various modifications can be made to the present invention, and there are various embodiments of the present invention. Herein, examples of various embodiments of the present invention will now be provided and described in detail with reference to the accompanying drawings. However, the present invention is not limited thereto. Although the exemplary embodiments may be interpreted as including all modifications, equivalents, or alternatives within the technical concept and scope of the present invention. In all aspects, similar reference numerals refer to the same or similar functions. In the drawings, for clarity, the shapes and sizes of elements may be exaggerated. In the following detailed description of the present invention, reference is made to the accompanying drawings, in which specific embodiments in which the present invention can be practiced are shown by way of illustration. These embodiments are described in sufficient detail to enable those skilled in the art to practice the present disclosure. It should be understood that the various embodiments of the present disclosure, although different, are not necessarily mutually exclusive. For example, specific features, structures, and characteristics described herein in connection with one embodiment can be implemented in other embodiments without departing from the spirit and scope of the present disclosure. Additionally, it should be understood that the positions or arrangements of the individual elements within each disclosed embodiment can be modified without departing from the spirit and scope of the present disclosure. Accordingly, the following detailed description should not be considered limiting, and the scope of the present disclosure is defined only by the appended claims (along with the full scope of equivalents claimed, when appropriately interpreted).

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

[0051] It will be understood that in this specification, when an element is simply referred to as "connected to" or "coupled to" another element rather than "directly connected to" or "directly coupled to" another element, the element may be "directly connected to" or "directly coupled to" another element, or may be connected to or coupled to another element in the case where other elements are interposed between the element and the other element. Conversely, it should be understood that when an element is referred to as being "directly coupled" or "directly connected" to another element, there is no intermediate element.

[0052] In addition, the components shown in the embodiments of the present invention are shown independently to represent different characteristic functions from each other. Therefore, this does not mean that each component is constituted by a separate hardware or software component unit. In other words, for convenience, each component includes each of the listed components. Therefore, at least two components of each component may be combined to form one component, or one component may be partitioned into multiple components to perform each function. Embodiments in which each component is combined and embodiments in which one component is partitioned are also included in the scope of the present invention without departing from the essence of the present invention.

[0053] The terms used in this specification are only for describing specific embodiments and are not intended to limit the present invention. Expressions used in the singular form include the plural form unless having a clearly different meaning in the context. In this specification, it will be understood that terms such as "including", "having", etc. are intended to indicate the presence of the features, numbers, steps, actions, elements, components or combinations thereof disclosed in the specification, and are not intended to exclude the possibility of the existence or addition of one or more other features, numbers, steps, actions, elements, components or combinations thereof. In other words, when a specific element is referred to as being "included", elements other than the corresponding element are not excluded, but additional elements may be included in the embodiments of the present invention or within the scope of the present invention.

[0054] In addition, some components may not be essential components for performing the basic functions of the present invention, but are only optional components for improving its performance. The present invention can be implemented by including only the essential components for realizing the essence of the present invention and not including the components for improving performance. Structures that include only the essential components and do not include the optional components only for improving performance are also included in the scope of the present invention.

[0055] Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings. When describing the exemplary embodiments of the present invention, well-known functions or configurations will not be described in detail because they may unnecessarily obscure the understanding of the present invention. The same components in the drawings are denoted by the same reference numerals, and repeated descriptions of the same components will be omitted.

[0056] Hereinafter, an image may refer to a frame constituting a video, or may refer to the video itself. For example, "encoding or decoding an image, or both encoding and decoding" may refer to "encoding or decoding a moving picture, or both encoding and decoding", and may refer to "encoding or decoding, or both encoding and decoding, one of the images in the moving picture image".

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

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

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

[0060] Hereinafter, a target block may be an encoding target block as an encoding target and / or a decoding target block as a decoding target. Additionally, 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 with the same meaning and may be replaced with each other.

[0061] Hereinafter, the terms "block" and "unit" may be used with the same meaning and may be replaced with each other. Or a "block" may represent a specific unit.

[0062] Hereinafter, the terms "region" and "segment" may be replaced with each other.

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

[0064] In an embodiment, each of specific information, data, flag, index, element, and attribute, etc. may have a value. A value of information, data, flag, index, element, and attribute equal to "0" may represent logical false or a first predefined value. In other words, the values "0", false, logical false, and the first predefined value may be replaced with each other. A value of information, data, flag, index, element, and attribute equal to "1" may represent logical true or a second predefined value. In other words, the values "1", true, logical true, and the second predefined value may be replaced with each other.

[0065] When the variables i or j are used to represent columns, rows, or indices, the value of i can be an integer equal to or greater than 0, or an integer equal to or greater than 1. That is, columns, rows, indices, etc. can be counted starting from 0, or can be counted starting from 1.

[0066] Term description

[0067] Encoder: Represents a device that performs encoding. That is, it represents an encoding device.

[0068] Decoder: Represents a device that performs decoding. That is, it represents a decoding device.

[0069] Block: Is an array of samples of M×N. Here, M and N can represent positive integers, and the block can represent an array of samples in two-dimensional form. A block can refer to a unit. The current block can represent an encoding target block that becomes the target during encoding, or a decoding target block that becomes the target during decoding. Additionally, the current block can be at least one of an encoding block, a prediction block, a residual block, and a transform block.

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

[0071] Unit: Can refer to an encoding and decoding unit. When encoding and decoding an image, a unit can be a region generated by partitioning a single image. Additionally, when a single image is partitioned into sub-partition units during encoding or decoding, a unit can represent a sub-partition unit. That is, an image can be partitioned into multiple units. When encoding and decoding an image, a predetermined process can be performed for each unit. A single unit can be partitioned into sub-units with a size smaller than the size of the unit. Depending on the function, a unit can represent a block, a macroblock, a coding tree unit, a coding tree block, an encoding unit, an encoding block, a prediction unit, a prediction block, a residual unit, a residual block, a transform unit, a transform block, etc. Additionally, in order to distinguish a unit from a block, a unit can include a luminance component block, a chrominance component block associated with the luminance component block, and syntax elements of each color component block. A unit can have various sizes and shapes. Specifically, the shape of a unit can be a two-dimensional geometric figure, such as a square, a rectangle, a trapezoid, a triangle, a pentagon, etc. Additionally, unit information can include at least one of a unit type indicating an encoding unit, a prediction unit, a transform unit, etc., and a unit size, a unit depth, an encoding and decoding order of the unit, etc.

[0072] Coding tree unit: A single coding tree block configured with the luminance component Y and two coding tree blocks related to the chrominance components Cb and Cr. Additionally, a coding tree unit may represent a block and the syntax elements of each block. Each coding tree unit may be partitioned by using at least one of a quadtree partitioning method, a binary tree partitioning method, and a ternary tree partitioning method to configure lower-level units such as coding units, prediction units, transform units, etc. A 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, a quadtree may represent a quadtree.

[0073] When the size of a coding block is within a predetermined range, partitioning may be performed using only quadtree partitioning. Here, the predetermined range may be defined as at least one of the maximum size and the minimum size of a coding block that can be partitioned using only quadtree partitioning. Information indicating the maximum / minimum size of a coding block allowing quadtree partitioning may be signaled via a bitstream, and the information may be signaled in at least one unit among a sequence, picture parameters, parallel block groups, or slices. Optionally, the maximum / minimum size of a coding block may be a fixed size predetermined in the encoder / decoder. For example, when the size of a coding block corresponds to 256×256 to 64×64, partitioning may be performed using only quadtree partitioning. Optionally, when the size of a coding block is larger than the size of the maximum transform block, partitioning may be performed using only quadtree partitioning. Here, the block to be partitioned may be at least one of a coding block and a transform block. In this case, the information indicating the partitioning of the coding block (e.g., split_flag) may be a flag indicating whether quadtree partitioning is performed. When the size of a coding block falls within the predetermined range, partitioning may be performed using only binary tree or ternary tree partitioning. In this case, the above description of quadtree partitioning may be applied to binary tree partitioning or ternary tree partitioning in the same manner.

[0074] Coding tree block: A term that may be used to specify any one of a Y coding tree block, a Cb coding tree block, and a Cr coding tree block.

[0075] Neighboring block: May represent a block adjacent to the current block. A block adjacent to the current block may represent a block that touches the boundary of the current block or a block located within a predetermined distance from the current block. A neighboring block may represent a block adjacent to a vertex of the current block. Here, a block adjacent to a vertex of the current block may represent a block that is vertically adjacent to a horizontally adjacent neighboring block of the current block or a block that is horizontally adjacent to a vertically adjacent neighboring block of the current block.

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

[0077] Unit depth: It 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. Additionally, the highest node can have the 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 first partitioning the first unit. 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 is a node that cannot be further partitioned. The depth of a leaf node can be the maximum level. For example, a 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. Additionally, when a unit is represented as a tree structure, the level where the unit exists can represent the unit depth.

[0078] Bitstream: It can represent a bitstream including encoded image information.

[0079] Parameter set: It corresponds to the header information among the configurations within the bitstream. At least one of a video parameter set, a sequence parameter set, a picture parameter set, and an adaptive parameter set can be included in the parameter set. In addition, the parameter set can include slice headers, tile group headers, and tile header information. The term "tile group" represents a group of tiles and has the same meaning as a slice.

[0080] The adaptive parameter set can represent a parameter set that can be shared by being referenced in different pictures, sub-pictures, slices, tile groups, tiles, or blocks. Additionally, the information in the adaptive parameter set can be used by referring to different adaptive parameter sets for sub-pictures, slices, tile groups, tiles, or blocks within a picture.

[0081] In addition, regarding the adaptive parameter set, different adaptive parameter sets can be referred to by using the identifiers of different adaptive parameter sets for sub-pictures, slices, tile groups, tiles, or blocks within a picture.

[0082] In addition, regarding the adaptive parameter set, different adaptive parameter sets can be referred to by using the identifiers of different adaptive parameter sets for slices, tile groups, tiles, or blocks within a sub-picture.

[0083] In addition, regarding the adaptive parameter set, different adaptive parameter sets can be referred to by using identifiers of different adaptive parameter sets for parallel blocks or chunks within a slice.

[0084] In addition, regarding the adaptive parameter set, different adaptive parameter sets can be referred to by using identifiers of different adaptive parameter sets for chunks within a parallel block.

[0085] Information about the adaptive parameter set identifier can be included in the parameter set or header of a sub - picture, and the adaptive parameter set corresponding to the adaptive parameter set identifier can be used for the sub - picture.

[0086] Information about the adaptive parameter set identifier can be included in the parameter set or header of a parallel block, and the adaptive parameter set corresponding to the adaptive parameter set identifier can be used for the parallel block.

[0087] Information about the adaptive parameter set identifier can be included in the header of a chunk, and the adaptive parameter set corresponding to the adaptive parameter set identifier can be used for the chunk.

[0088] A picture can be partitioned into one or more parallel block rows and one or more parallel block columns.

[0089] A sub - picture can be partitioned into one or more parallel block rows and one or more parallel block columns within a picture. A sub - picture can be a region in the picture having a rectangular / square form and can include one or more CTUs. Additionally, at least one or more parallel blocks / chunks / slices can be included within a sub - picture.

[0090] A parallel block can be a region in the picture having a rectangular / square form and can include one or more CTUs. Additionally, a parallel block can be partitioned into one or more chunks.

[0091] A chunk can represent one or more CTU rows within a parallel block. A parallel block can be partitioned into one or more blocks, and each block can have at least one or more CTU rows. A parallel block that is not partitioned into two or more can represent a chunk.

[0092] A slice can include one or more parallel blocks within a picture and can include one or more chunks within a parallel block.

[0093] Parsing: can represent determining the value of a syntax element by performing entropy decoding or can represent entropy decoding itself.

[0094] Symbol: can represent at least one of a syntax element, an encoding parameter, and a transform coefficient value of an encoding / decoding target unit. Additionally, a symbol can represent an entropy encoding target or an entropy decoding result.

[0095] Prediction mode: Information that can indicate a mode encoded / decoded using intra prediction or a mode encoded / decoded using inter prediction.

[0096] Prediction unit: Can represent the basic unit when performing prediction (such as inter prediction, intra prediction, inter compensation, intra compensation, and motion compensation). A single prediction unit can be partitioned into multiple partitions with smaller sizes, or can be partitioned into multiple lower-level prediction units. Multiple partitions can be the basic units when performing prediction or compensation. The partitions generated by partitioning the prediction unit can also be prediction units.

[0097] Prediction unit partition: Can represent the shape obtained by partitioning the prediction unit.

[0098] The reference picture list can refer to a list including one or more reference pictures 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).

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

[0100] The prediction list utilization flag indicates whether at least one reference picture in a specific reference picture list is used to generate the prediction block. The prediction list utilization flag can be used to derive the inter prediction indicator, and conversely, the inter prediction indicator can be used to derive the prediction list utilization flag. For example, when the prediction list utilization flag has a first value of zero (0), it indicates that the reference pictures in the reference picture list are not used to generate the prediction block. On the other hand, when the prediction list utilization flag has a second value of one (1), it indicates that the reference picture list is used to generate the prediction block.

[0101] The reference picture index can refer to an index indicating a specific reference picture in the reference picture list.

[0102] The reference picture can represent a reference picture referred to by a specific block for the purpose of inter prediction or motion compensation of the specific block. Optionally, the reference picture can be a picture including reference blocks referred to by the current block for inter prediction or motion compensation. Hereinafter, the terms "reference picture" and "reference picture" have the same meaning and can be interchanged.

[0103] A motion vector can be a two-dimensional vector for inter-frame prediction or motion compensation. The motion vector can represent an offset between an encoded target block / decoded target block and a reference block. For example, (mvX, mvY) can represent a motion vector. Here, mvX can represent the horizontal component, and mvY can represent the vertical component.

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

[0105] A motion vector candidate can refer to a predicted candidate block or the motion vector of a predicted candidate block when predicting a motion vector. Additionally, the motion vector candidate can be included in a motion vector candidate list.

[0106] The motion vector candidate list can represent a list composed of one or more motion vector candidates.

[0107] The motion vector candidate index can represent an indicator that indicates a motion vector candidate in the motion vector candidate list. Optionally, it can be an index of a motion vector predictor.

[0108] Motion information can represent information including at least one of a motion vector, a reference picture index, an inter-frame prediction indicator, a prediction list utilization flag, reference picture list information, a reference picture, a motion vector candidate, a motion vector candidate index, a merge candidate, and a merge index.

[0109] The merge candidate list can represent a list composed of one or more merge candidates.

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

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

[0112] Transform unit: can represent a basic unit when performing encoding / decoding (such as transformation, inverse transformation, quantization, dequantization, transformation coefficient encoding / decoding) on a residual signal. A single transform unit can be partitioned into multiple lower-level transform units with smaller sizes. Here, the transformation / inverse transformation can include at least one of a first transformation / first inverse transformation and a second transformation / second inverse transformation.

[0113] Scaling: It can represent a process of multiplying the quantization levels by a factor. The transform coefficients can be generated by scaling the quantization levels. Scaling can also be referred to as inverse quantization.

[0114] Quantization parameter: It can represent a value used when generating quantization levels using transform coefficients during quantization. The quantization parameter can also represent a value used when generating transform coefficients by scaling the quantization levels during inverse quantization. The quantization parameter can be a value mapped to the quantization step.

[0115] Delta quantization parameter: It can represent the difference between the predicted quantization parameter and the quantization parameter of the coding / decoding target unit.

[0116] Scanning: It can represent a method of sorting coefficients within a unit, block, or matrix. For example, converting a two-dimensional matrix of coefficients into a one-dimensional matrix can be referred to as scanning, and converting a one-dimensional matrix of coefficients into a two-dimensional matrix can be referred to as scanning or inverse scanning.

[0117] Transform coefficient: It can represent the coefficient value generated after performing a transform in the encoder. The transform coefficient can represent the coefficient value generated after performing at least one of entropy decoding and inverse quantization in the decoder. The quantization levels or quantized transform coefficient levels obtained by quantizing the transform coefficients or residual signals can also fall within the meaning of transform coefficients.

[0118] Quantization level: It can represent the value generated by quantizing the transform coefficients or residual signals in the encoder. Optionally, the quantization level can represent the value of the inverse quantization target that undergoes inverse quantization in the decoder. Similarly, the quantized transform coefficient levels as a result of transform and quantization can also fall within the meaning of quantization levels.

[0119] Non-zero transform coefficient: It can represent a transform coefficient with a value other than zero, or a transform coefficient level or quantization level with a value other than zero.

[0120] Quantization matrix: It can represent a matrix used in the quantization process or inverse quantization process performed to improve subjective image quality or objective image quality. The quantization matrix can also be referred to as a scaling list.

[0121] Quantization matrix coefficient: It can represent each element within the quantization matrix. The quantization matrix coefficient can also be referred to as a matrix coefficient.

[0122] Default matrix: It can represent a predefined quantization matrix in the encoder or decoder.

[0123] Non-default matrix: It can represent a quantization matrix that is not predefined in the encoder or decoder but signaled by the user.

[0124] Statistical value: The statistical value for at least one of variables, coding parameters, constant values, etc. with computable specific values can be one or more of the average value, sum value, weighted average value, weighted sum value, minimum value, maximum value, most frequently occurring value, median value, interpolation of the corresponding specific values.

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

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

[0127] Referring to Figure 1 , the encoding device 100 can include a motion prediction unit 111, a motion compensation unit 112, an intra 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.

[0128] The encoding device 100 can perform encoding of an input image by using an intra mode or an inter mode or both an intra mode and an inter mode. In addition, the encoding device 100 can generate a bitstream including encoding information by encoding the input image and output the generated bitstream. The generated bitstream can be stored in a computer-readable recording medium or can be streamed through a wired / wireless transmission medium. When the intra mode is used as a prediction mode, the switch 115 can switch to intra. Optionally, when the inter mode is used as a prediction mode, the switch 115 can switch to the inter mode. Here, the intra mode can represent an intra prediction mode, and the inter mode can represent an inter prediction mode. The encoding device 100 can generate a prediction block for an input block of the input image. In addition, the encoding device 100 can encode a residual block by using the residual between the input block and the prediction block after generating the prediction block. The input image can be referred to as the current picture that is the current encoding target. The input block can be referred to as the current block that is the current encoding target or as the encoding target block.

[0129] When the prediction mode is the intra mode, the intra prediction unit 120 can use the samples of the blocks that have been encoded / decoded and are adjacent to the current block as reference samples. The intra prediction unit 120 can perform spatial prediction on the current block by using the reference samples or generate prediction samples of the input block by performing spatial prediction. Here, the intra prediction can represent the prediction inside the frame.

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

[0131] The motion compensation unit 112 may perform motion compensation on the current block by using the motion vector to generate a prediction block. Here, inter-frame prediction may represent prediction or motion compensation between frames.

[0132] 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 region of the reference picture. To perform inter-picture prediction or motion compensation on an encoding unit, it may be determined which one of a skip mode, a merge mode, an advanced motion vector prediction (AMVP) mode, and a current picture reference mode is used for motion prediction and motion compensation of a prediction unit included in the corresponding encoding unit. Then, inter-picture prediction or motion compensation may be performed differently according to the determined mode.

[0133] The subtractor 125 may generate a residual block by using the difference between the input block and the prediction block. The residual block may be referred to as a residual signal. The residual signal may represent the difference between the original signal and the prediction signal. In addition, the residual signal may be a signal generated by transforming or quantizing or transforming and quantizing the difference between the original signal and the prediction signal. The residual block may be the residual signal of a block unit.

[0134] The transform unit 130 may generate transform coefficients by performing a transform on the residual block, and output the generated transform coefficients. Here, the transform coefficients may be coefficient values generated by performing a transform on the residual block. When the transform skip mode is applied, the transform unit 130 may skip the transform of the residual block.

[0135] Quantized levels may be generated by applying quantization to the transform coefficients or to the residual signal. Hereinafter, the quantized levels may also be referred to as transform coefficients in the embodiments.

[0136] The quantization unit 140 may generate quantized levels by quantizing the transform coefficients or the residual signal according to parameters, and output the generated quantized levels. Here, the quantization unit 140 may quantize the transform coefficients by using a quantization matrix.

[0137] The entropy encoding unit 150 may generate a bitstream by performing entropy encoding on the values calculated by the quantization unit 140 or on the encoding parameter values calculated during encoding according to a probability distribution, and output the generated bitstream. The entropy encoding unit 150 may perform entropy encoding on the sample information of the image and the information for decoding the image. For example, the information for decoding the image may include syntax elements.

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

[0139] To encode the transform coefficient levels (quantization levels), the entropy encoding unit 150 may change the coefficients in two-dimensional block form into one-dimensional vector form by using a transform coefficient scanning method.

[0140] Coding parameters may include information such as syntax elements (flags, indices, etc.) that are coded in an encoder and signaled to a decoder, as well as information derived during the execution of coding or decoding. The coding parameters may represent the information required for encoding or decoding an image. For example, at least one value or combination among the following items may be included in the coding parameters: unit / block size, unit / block depth, unit / block partitioning information, unit / block shape, unit / block partitioning structure, whether quadtree-based partitioning is performed, whether binary tree-based partitioning is performed, binary tree-based partitioning direction (horizontal direction or vertical direction), binary tree-based partitioning form (symmetric partitioning or asymmetric partitioning), whether the current coding unit is partitioned by ternary tree partitioning, ternary tree partitioning direction (horizontal direction or vertical direction), ternary tree partitioning type (symmetric type or asymmetric type), whether the current coding unit is partitioned by multi-type tree partitioning, multi-type tree partitioning direction (horizontal direction or vertical direction), multi-type tree partitioning type (symmetric type or asymmetric type), multi-type tree partitioning tree (binary tree or ternary tree) structure, prediction mode (intra prediction or inter prediction), luminance intra prediction mode / direction, chrominance intra prediction mode / direction, intra partitioning information, inter partitioning information, coding block partitioning flag, prediction block partitioning flag, transform block partitioning 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 prediction mode, inter prediction mode, motion information, motion vector, motion vector difference, reference picture index, inter prediction angle, inter prediction indicator, prediction list utilization flag, reference picture list, reference picture, motion vector predictor index, motion vector predictor candidate, motion vector candidate list, whether merge mode is used, merge index, merge candidate, merge candidate list, whether skip mode is used, interpolation filter type, interpolation filter taps, interpolation filter coefficients, motion vector size, representation precision of the 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, information on whether a residual signal exists, coding block style, coding block flag (CBF), quantization parameter, quantization parameter of residual, quantization matrix, whether intra-loop filter is applied, intra-loop filter coefficients, intra-loop filter taps, intra-loop filter shape / form, whether deblocking filter is applied, deblocking filter coefficients, deblocking filter taps, deblocking filter strength, deblocking filter shape / form, whether adaptive sample offset is applied, adaptive sample offset value, adaptive sample offset category, adaptive sample offset type, whether adaptive loop filter is applied, adaptive loop filter coefficients, adaptive loop filter taps, adaptive loop filter shape / form,Binarization / inverse binarization method, context model determination method, context model update method, whether to execute the normal mode, whether to execute the bypass mode, context binary bit, bypass binary bit, valid coefficient flag, last valid coefficient flag, coding flag for the unit of the coefficient group, position of the last valid coefficient, flag indicating whether the value of the coefficient is greater than 1, flag indicating whether the value of the coefficient is greater than 2, flag indicating whether the value of the coefficient is greater than 3, information about the values of the remaining coefficients, 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 the motion vector search area on the decoder side, shape of the motion vector search area on the decoder side, number of times of motion vector search on 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 the input sample, bit depth of the reconstructed sample, bit depth of the residual sample, bit depth of the transform coefficient, bit depth of the quantized level, and information about the luminance signal or information about the chrominance signal.

[0141] Here, it can be indicated by a signaling flag or index that the encoder performs entropy coding on the corresponding flag or index and includes it in the bitstream, and it can be indicated that the decoder performs entropy decoding on the corresponding flag or index from the bitstream.

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

[0143] The quantized level can be dequantized in the dequantization unit 160, or can be inverse-transformed in the inverse transform unit 170. The coefficient that has been dequantized or inverse-transformed or both can be added to the prediction block by the adder 175. By adding the coefficient that has been dequantized or inverse-transformed or both to the prediction block, a reconstructed block can be generated. Here, the coefficient that has been dequantized or inverse-transformed or both can represent the coefficient on which at least one of dequantization and inverse transformation has been performed, and can represent the reconstructed residual block.

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

[0145] The deblocking filter can remove block distortion generated at the boundary between blocks. 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 several rows or columns included in the block. When applying the deblocking filter to a block, another filter can be applied according to the required deblocking filtering strength.

[0146] To compensate for coding errors, an appropriate offset value can be added to the sample value by using sample adaptive offset. Sample adaptive offset can correct the offset between the deblocked image and the original image on a sample-by-sample basis. A method that applies the offset considering the edge information about each sample can be used, or the following method can be used: partitioning the samples of the image into a predetermined number of regions, determining the regions to which the offset is applied, and applying the offset to the determined regions.

[0147] The adaptive loop filter can perform filtering based on the comparison result between the filtered reconstructed image and the original image. The samples included in the image can be partitioned into predetermined groups, the filter to be applied to each group can be determined, and differential filtering can be performed on each group. Information on whether to apply ALF can be signaled through the coding unit (CU), and the form and coefficients of the ALF to be applied to each block can vary.

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

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

[0150] Decoding device 200 can be a decoder, a video decoding device, or an image decoding device.

[0151] Referring to Figure 2 , decoding device 200 can include an entropy decoding unit 210, an inverse quantization unit 220, an inverse transform unit 230, an intra prediction unit 240, a motion compensation unit 250, an adder 255, a filter unit 260, and a reference picture buffer 270.

[0152] The decoding device 200 may receive a bitstream output from the encoding device 100. The decoding device 200 may receive the bitstream stored in a computer-readable recording medium, or may receive the bitstream streamed through a wired / wireless transmission medium. The decoding device 200 may decode the bitstream by using an intra mode or an inter mode. In addition, the decoding device 200 may generate a reconstructed image or a decoded image generated by decoding, and output the reconstructed image or the decoded image.

[0153] When the prediction mode used during decoding is the intra mode, the switcher may be switched to intra. Optionally, when the prediction mode used during decoding is the inter mode, the switcher may be switched to the inter mode.

[0154] The decoding device 200 may obtain a reconstructed residual block by decoding an input bitstream, and generate a prediction block. When the reconstructed residual block and the prediction block are obtained, the decoding device 200 may generate a reconstructed block to be decoded by adding the reconstructed residual block to the prediction block. The block to be decoded may be referred to as a current block.

[0155] The entropy decoding unit 210 may generate symbols by performing entropy decoding on the bitstream according to a probability distribution. The generated symbols may include symbols in a quantized level form. Here, the entropy decoding method may be an inverse process of the above entropy encoding method.

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

[0157] The quantized levels may be dequantized in the dequantization unit 220, or may be inverse-transformed in the inverse transform unit 230. The quantized levels may be the result of performing dequantization or inverse transformation or both dequantization and inverse transformation, and may be generated as a reconstructed residual block. Here, the dequantization unit 220 may apply a quantization matrix to the quantized levels.

[0158] When using the intra mode, the intra prediction unit 240 may generate a prediction block by performing spatial prediction on the current block, where the spatial prediction uses the sample values of the blocks adjacent to the block to be decoded and already decoded.

[0159] When using the inter mode, the motion compensation unit 250 may generate a prediction block by performing motion compensation on the current block, where the motion compensation uses a motion vector and a reference picture stored in the reference picture buffer 270.

[0160] The adder 225 can generate a reconstructed block by adding the reconstructed residual block and the prediction block. The filter unit 260 can apply at least one of a deblocking filter, sample adaptive offset, and 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 during inter-frame prediction. The reconstructed block processed by the filter unit 260 can be part of the reference picture. That is, the reference picture is the reconstructed image composed of the reconstructed blocks processed by the filter unit 260. The stored reference picture can be used later in inter-frame prediction or motion compensation.

[0161] Figure 3 is a diagram schematically showing the partitioning structure of an image when encoding and decoding the image. Figure 3 Schematically shows an example of partitioning a single unit into multiple lower-level units.

[0162] To partition an image effectively, a coding unit (CU) can be used when encoding and decoding the image. The coding unit can be used as the basic unit when encoding / decoding the image. In addition, the coding unit can be used as the unit for distinguishing between the intra-frame prediction mode and the inter-frame prediction mode when encoding / decoding the image. The coding unit can be the basic unit for prediction, transformation, quantization, inverse transformation, dequantization, or encoding / decoding processing of transform coefficients.

[0163] Refer to Figure 3 , the image 300 is sequentially partitioned according to the largest coding unit (LCU), and the LCU unit is determined as the partitioning structure. Here, the LCU can be used with the same meaning as the coding tree unit (CTU). Unit partitioning can represent partitioning the blocks associated with the unit. In the block partitioning information, information on the unit depth can be included. The depth information can represent the number of times or the degree or both the number of times and the degree to which the unit is partitioned. A single unit can be partitioned into multiple 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 can correspond to a node and the children of the node, respectively. Each of the partitioned lower-level units can have depth information. The depth information can be information representing the size of the CU and can be stored in each CU. The unit depth represents the number of times and / or the degree related to partitioning the unit. Therefore, the partitioning information of the lower-level units can include information on the size of the lower-level units.

[0164] The partitioning structure may represent the distribution of coding units (CUs) within the LCU 310. Such a distribution may be determined based on whether a single CU is partitioned into multiple (positive integers equal to or greater than 2, including 2, 4, 8, 16, etc.) CUs. The horizontal size and vertical size of the CUs generated by partitioning may be half of the horizontal size and vertical size of the CU before partitioning, respectively, or may have sizes smaller than the horizontal size and vertical size before partitioning according to the number of partitions. A CU may be recursively partitioned into multiple CUs. Through 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 executed until a predetermined depth or a predetermined size is reached. For example, the depth of the LCU may be 0, and the depth of the smallest coding unit (SCU) may be a predetermined maximum depth. Here, as described above, the LCU may be a coding unit with the maximum coding unit size, and the SCU may be a coding unit with the smallest coding unit size. The partitioning starts from the LCU 310, and when the horizontal size or vertical size or both the horizontal size and vertical size of the CU are reduced by partitioning, the CU depth increases by 1. For example, for each depth, the size of the unpartitioned CU may be 2N×2N. Additionally, in the case of a partitioned CU, a CU with a size of 2N×2N may be partitioned into four CUs with a size of N×N. As the depth increases by 1, the size of N may be halved.

[0165] In addition, information indicating whether a CU is partitioned may be represented by using the partitioning information of the CU. The partitioning information may be 1-bit information. All CUs except the SCU may include the partitioning information. For example, when the value of the partitioning information is a first value, the CU may not be partitioned, and when the value of the partitioning information is a second value, the CU may be partitioned.

[0166] Referring to Figure 3 , the LCU with a depth of 0 may be a 64×64 block. 0 may be the minimum depth. The SCU with a depth of 3 may be an 8×8 block. 3 may be the maximum depth. The CUs of the 32×32 block and the 16×16 block may be represented as depth 1 and depth 2, respectively.

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

[0168] For example, when a 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 can be half of the horizontal size or vertical size of the original coding unit. For example, when a coding unit with a size of 32×32 is vertically partitioned into two sub-coding units, each of the two sub-coding units can have a size of 16×32. For example, when a coding unit with a size of 8×32 is horizontally partitioned into two sub-coding units, each of the two sub-coding units can have a size of 8×16. When a coding unit is partitioned into two sub-coding units, it can be said that the coding unit is bipartitioned or partitioned by a binary tree partitioning structure.

[0169] For example, when a coding unit is partitioned into three sub-coding units, the horizontal size or vertical size of the coding unit can be partitioned in a ratio of 1:2:1, resulting in three sub-coding units with a horizontal size or vertical size ratio of 1:2:1. For example, when a coding unit with a size of 16×32 is horizontally partitioned into three sub-coding units, the three sub-coding units can have sizes of 16×8, 16×16, and 16×8 in order from the topmost sub-coding unit to the bottommost sub-coding unit. For example, when a coding unit with a size of 32×32 is vertically partitioned into three sub-coding units, the three sub-coding units can have sizes of 8×32, 16×32, and 8×32 in order from the leftmost sub-coding unit to the rightmost sub-coding unit. When a coding unit is partitioned into three sub-coding units, it can be said that the coding unit is tripartitioned or partitioned according to a ternary tree partitioning structure.

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

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

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

[0173] There may be no priority between binary tree partitioning and ternary tree partitioning. That is, a coding unit corresponding to a leaf node of a quadtree can further undergo either binary tree partitioning or ternary tree partitioning. Additionally, a coding unit generated by binary tree partitioning or ternary tree partitioning can undergo further binary tree partitioning or further ternary tree partitioning, or may not be further partitioned.

[0174] A tree structure in which there is no priority between binary tree partitioning and ternary tree partitioning is referred to as a multi-type tree structure. A coding unit corresponding to a leaf node of a quadtree can 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 can be used to signal whether a coding unit corresponding to a node of a multi-type tree is partitioned. To partition a coding unit corresponding to a node of a multi-type tree, the multi-type tree partition indication information, partition direction information, and partition tree information can be signaled sequentially.

[0175] Multi-type tree partition indication information having a first value (e.g., "1") can indicate that the current coding unit will undergo multi-type tree partitioning. Multi-type tree partition indication information having a second value (e.g., "0") can indicate that the current coding unit will not undergo multi-type tree partitioning.

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

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

[0178] The partition indication information, the partition tree information, and the partition direction information may each be a flag having a predetermined length (e.g., one bit).

[0179] 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 / entropy decoded. To entropy encode / entropy decode those types of information, information about neighboring coding units adjacent to the current coding unit may be used. For example, the likelihood 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 is high. Thus, context information for entropy encoding / entropy decoding information about the current coding unit may be derived from information about the neighboring coding units. The information about the neighboring coding units may include at least any one of the quad-partition information, the multi-type tree partition indication information, the partition direction information, and the partition tree information.

[0180] As another example, in binary tree partitioning and ternary tree partitioning, binary tree partitioning may be preferentially performed. That is, the current coding unit may first undergo binary tree partitioning, and subsequently, the coding unit corresponding to the leaf node of the binary tree may be set as the root node for 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.

[0181] 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 coding, prediction, and / or transformation. That is, the coding unit cannot be further partitioned for prediction and / or transformation. Thus, in the bitstream, there may be no partition structure information and partition information for partitioning the coding unit into a prediction unit and / or a transformation unit.

[0182] However, when the size of a coding unit (i.e., the basic unit for partitioning) is larger than the size of the maximum transform block, the coding unit can be recursively partitioned until the size of the coding unit is reduced to be equal to or less 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 can be partitioned into four 32×32 blocks for transformation. 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 can be partitioned into two 32×32 blocks for transformation. In this case, the partitioning of the coding unit for transformation is not signaled separately, and the partitioning of the coding unit for transformation can be determined by comparing the horizontal size or vertical size of the coding unit with 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 can be bisected vertically. For example, when the vertical size (height) of the coding unit is larger than the vertical size (height) of the maximum transform block, the coding unit can be bisected horizontally.

[0183] The information on the maximum and / or minimum size of the coding unit and the information on the maximum and / or minimum size of the transform block can be signaled or determined at a higher level of the coding unit. The higher level can be, for example, sequence level, picture level, slice level, parallel block group level, parallel block level, etc. For example, the minimum size of the coding unit can be determined to be 4×4. For example, the maximum size of the transform block can be determined to be 64×64. For example, the minimum size of the transform block can be determined to be 4×4.

[0184] The information on the minimum size (quadtree minimum size) of the coding unit corresponding to the leaf node of the quadtree and / or the information on the maximum depth (maximum tree depth of the multi-type tree) from the root node to the leaf node of the multi-type tree can be signaled or determined at a higher level of the coding unit. For example, the higher level can be sequence level, picture level, slice level, parallel block group level, parallel block level, etc. The information on the minimum size of the quadtree and / or the information on the maximum depth of the multi-type tree can be signaled or determined for each of the in-picture slices and inter-picture slices.

[0185] The difference information between the size of the CTU and the maximum size of the transform block can be signaled or determined at a higher level of the coding unit. For example, the higher level can be the sequence level, picture level, slice level, parallel block group level, parallel block level, etc. The information on the maximum size of the coding unit (hereinafter referred to as the maximum size of the binary tree) corresponding to each node of the binary tree can be determined based on the size of the coding tree unit and the difference information. The maximum size of the coding unit (hereinafter referred to as the maximum size of the ternary tree) corresponding to each node of the ternary tree can vary according to the type of the slice. For example, for an intra-slice, the maximum size of the ternary tree can be 32×32. For example, for an inter-slice, the maximum size of the ternary tree can be 128×128. For example, the minimum size of the coding unit (hereinafter referred to as the minimum size of the binary tree) corresponding to each node of the binary tree and / or the minimum size of the coding unit (hereinafter referred to as the minimum size of the ternary tree) corresponding to each node of the ternary tree can be set to the minimum size of the coding block.

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

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

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

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

[0190] 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 twice as large as the maximum size (horizontal size and vertical size) of the ternary tree, the coding unit may not be further bipartitioned or tripartitioned. Therefore, instead of signaling the multi-type tree partition indication information, the multi-type tree partition indication information may be derived from the second value. This is because when partitioning the coding unit through the binary tree partition structure and / or the ternary tree partition structure, coding units smaller than the minimum size of the binary tree and / or the minimum size of the ternary tree are generated.

[0191] Optionally, the binary tree partition or the ternary tree partition may be restricted based on the size of the virtual pipeline data unit (hereinafter, the pipeline buffer size). For example, when partitioning a coding unit into sub-coding units that do not fit the pipeline buffer size through the binary tree partition or the ternary tree partition, the corresponding binary tree partition or ternary tree partition may be restricted. The pipeline buffer size may be the size of the maximum transform block (e.g., 64×64). For example, when the pipeline buffer size is 64×64, the following partitions may be restricted.

[0192] - Ternary tree partition for an N×M (N and / or M is 128) coding unit

[0193] - Binary tree partition in the horizontal direction for a 128×N (N <= 64) coding unit

[0194] - Binary tree partition in the vertical direction for an N×128 (N <= 64) coding unit

[0195] 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 bipartitioned and / or tripartitioned. Therefore, instead of signaling the multi-type tree partition indication information, the multi-type tree partition indication information may be inferred as the second value.

[0196] Optionally, the multi-type tree partition indication information may be signaled only when at least one of the binary tree partition in the vertical direction, the binary tree partition in the horizontal direction, the ternary tree partition in the vertical direction, and the ternary tree partition in the horizontal direction is possible for the coding unit corresponding to the node of the multi-type tree. Otherwise, the coding unit may not be bipartitioned and / or tripartitioned. Therefore, instead of signaling the multi-type tree partition indication information, the multi-type tree partition indication information may be inferred as the second value.

[0197] Optionally, the partition direction information may be signaled only if both the vertical binary tree partition and the horizontal binary tree partition or both the vertical ternary tree partition and the horizontal ternary tree partition are possible for a coding unit corresponding to a node of the multi-type tree. Otherwise, the partition direction information may not be signaled, but the partition direction information may be derived from values indicating possible partition directions.

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

[0199] Figure 4 is a diagram showing intra prediction processing.

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

[0201] Intra coding 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 coding and / or decoding may be performed by using coding parameters or values of reference samples included in the reconstructed neighboring blocks.

[0202] A 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 the size of one of a CU, a PU, and a TU. The prediction block may be a square block with a size of 2×2, 4×4, 16×16, 32×32, or 64×64, etc., or may be a rectangular block with a size of 2×8, 4×8, 2×16, 4×16, and 8×16, etc.

[0203] Intra prediction may be performed according to the 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 the attributes of the prediction block. For example, the attributes of the prediction block may include the size of the prediction block and the shape of the prediction block, etc.

[0204] Regardless of the block size, the number of intra prediction modes can be fixed at N. Alternatively, the number of intra prediction modes can be 3, 5, 9, 17, 34, 35, 36, 65, or 67, etc. Optionally, the number of intra prediction modes can vary according to the block size or color component type or both the block size and color component type. For example, the number of intra prediction modes can vary according to whether the color component is a luminance signal or a chrominance signal. For example, as the block size gets larger, the number of intra prediction modes can increase. Optionally, the number of intra prediction modes for a luminance component block can be greater than the number of intra prediction modes for a chrominance component block.

[0205] The intra prediction mode can be a non - angular mode or an angular mode. The non - angular mode can be a DC mode or a planar mode, and the angular mode can be a prediction mode with a specific direction or angle. The intra prediction mode can be represented by at least one of a mode number, a mode value, a mode numbering, a mode angle, and a mode direction. The number of intra prediction modes can be M greater than 1, including non - angular modes and angular modes. To perform intra prediction on a current block, a step of determining whether samples included in reconstructed neighboring blocks can be used as reference samples for the current block can be executed. When there are samples that cannot be used as reference samples for the current block, the value obtained by copying or performing interpolation or both copying and interpolation on at least one sample value among the samples included in the reconstructed neighboring blocks can be used to replace the unavailable sample values of the samples, so that the replaced sample values are used as reference samples for the current block.

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

[0207] As Figure 7 shown, at least one of reference sample lines 0 to 3 can be used for intra prediction of the current block. In Figure 7 , the samples of segment A and segment F can be filled with the samples closest to segment B and segment 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 can be signaled. For example, in Figure 7 , reference sample line indicators 0, 1, and 2 can be signaled as index information indicating reference sample lines 0, 1, and 2. When the upper boundary of the current block is the boundary of a CTU, only reference sample line 0 can be available. Therefore, in this case, the index information can be not signaled. When using a reference sample line other than reference sample line 0, the filtering for the prediction block described later may not be performed.

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

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

[0210] In the case of intra prediction between color components, a prediction block of the current block of the second color component can be generated based on the corresponding reconstructed block of the first color component. For example, the first color component can be a luminance component, and the second color component can be a chrominance component. For intra prediction between color components, the parameters of a linear model between the first color component and the second color component can be derived based on a template. The template can include the upper and / or left neighboring samples of the current block and the upper and / or left neighboring samples of the corresponding reconstructed block of the first color component. For example, the sample value of the first color component with the maximum value among the samples in the template and the corresponding sample value of the second color component, and the sample value of the first color component with the minimum value among the samples in the template and the corresponding sample value of the second color component can be used to derive the parameters of the linear model. When deriving the parameters of the linear model, the corresponding reconstructed block can be applied to the linear model to generate a prediction block of the current block. According to the video format, downsampling can be performed on the reconstructed block of the first color component and the neighboring samples of the corresponding reconstructed block. For example, when one sample of the second color component corresponds to four samples of the first color component, the four samples of the first color component can be downsampled to calculate one corresponding sample. In this case, the derivation of the parameters of the linear model and the intra prediction between color components can be performed based on the corresponding downsampled samples. Whether to perform intra prediction between color components and / or the range of the template can be signaled as an intra prediction mode.

[0211] The current block can be partitioned into two sub-blocks or four sub-blocks either horizontally or vertically. The partitioned sub-blocks can be reconstructed sequentially. That is, intra prediction can be performed on the sub-blocks to generate sub-prediction blocks. Additionally, inverse quantization and / or inverse transform can be performed on the sub-blocks to generate sub-residual blocks. The reconstructed sub-blocks can be generated by adding the sub-prediction blocks to the sub-residual blocks. The reconstructed sub-blocks can be used as reference sample points for intra prediction of sub-sub-blocks. A sub-block can be a block including a predetermined number (e.g., 16) or more sample points. Thus, for example, when the current block is an 8×4 block or a 4×8 block, the current block can be partitioned into two sub-blocks. Further, 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 dimensions, the current block can be partitioned into four sub-blocks. Information on whether to perform intra prediction based on sub-blocks and / or the partition direction (horizontal or vertical) can be signaled. The intra prediction based on sub-blocks can be limited to be performed only when using reference sample line 0. When performing intra prediction based on sub-blocks, filtering for the prediction block described later may not be performed.

[0212] The final prediction block can be generated by performing filtering on the prediction block that has been intra predicted. The filtering can be performed by applying predetermined weights to the filtering target sample points, the left reference sample points, the upper reference sample points, and / or the upper left reference sample points. The weights and / or reference sample points (range, position, etc.) for filtering can be determined based on at least one of the block size, the intra prediction mode, and the position of the filtering target sample points in the prediction block. The filtering can be performed only in the case of a predetermined intra prediction mode (e.g., DC, planar, vertical, horizontal, diagonal, and / or adjacent diagonal mode). The adjacent diagonal mode can be a mode obtained by adding k to or subtracting k from the diagonal mode. For example, k can be a positive integer of 8 or less.

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

[0214] Figure 5 is a diagram showing an embodiment of the inter prediction process.

[0215] In Figure 5 a rectangle can represent a picture. In Figure 5In this figure, the arrow indicates the prediction direction. According to the coding 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).

[0216] The I picture can be encoded by intra prediction without the need for inter-picture prediction. The P picture can be encoded by inter-picture prediction by using the reference picture existing in one direction (i.e., forward or backward) for the current block. The B picture can be encoded by inter-picture prediction by using the reference pictures existing in two directions (i.e., forward and backward) for the current block. When using inter-picture prediction, the encoder can perform inter-picture prediction or motion compensation, and the decoder can perform the corresponding motion compensation.

[0217] Hereinafter, embodiments of inter-frame prediction will be described in detail.

[0218] The reference picture and motion information can be used to perform inter-picture prediction or motion compensation.

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

[0220] The method for deriving the motion information may vary according to the prediction mode of the current block. For example, the prediction modes applied to inter-frame prediction include the AMVP mode, the merge mode, the skip mode, the merge mode with motion vector difference, the sub-block merge mode, the geometric partitioning mode, the combined inter-frame intra-frame prediction mode, the affine mode, etc. Here, the merge mode can be referred to as the motion merge mode.

[0221] For example, when AMVP is used as the prediction mode, at least one of the motion vectors of the reconstructed neighboring block, the motion vector of the co-located block, the motion vector of the block adjacent to the co-located block, and the (0,0) motion vector can be determined as the motion vector candidate for the current block, and a motion vector candidate list is generated by using the motion vector candidate. The motion vector candidate of the current block can be derived by using the generated motion vector candidate list. The motion information of the current block can 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 can be referred to as the temporal motion vector candidate, and the motion vector of the reconstructed neighboring block can be referred to as the spatial motion vector candidate.

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

[0223] In addition, the encoding device 100 may perform entropy encoding on resolution information of the calculated MVD. The decoding device 200 may use the MVD resolution information to adjust the resolution of the entropy-decoded MVD.

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

[0225] The bitstream may include a reference picture index indicating a reference picture. The reference picture index may be entropy-encoded by the encoding device 100 and subsequently signaled as a bitstream to the decoding device 200. The decoding device 200 may generate a prediction block of the decoding target block based on the derived motion vector and the reference picture index information.

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

[0227] 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 neighboring blocks adjacent to the current block (spatial merge candidate), motion information of co-located blocks of the current block in a reference picture (temporal merge candidate), new motion information generated by combining the motion information existing in the merge candidate list, motion information of blocks encoded / decoded before the current block (history-based merge candidate), and zero merge candidate.

[0228] The encoding device 100 may generate a bitstream by performing entropy encoding on at least one of a merge flag and a merge index, and may signal the bitstream to the decoding device 200. The merge flag may be information indicating whether the merge mode is performed for each block, and the merge index may be information indicating which neighboring block among the neighboring blocks of the current block is the merge target block. For example, the neighboring blocks of the current block may include a left neighboring block located on the left side of the current block, an upper neighboring block arranged above the current block, and a temporal neighboring block temporally adjacent to the current block.

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

[0230] The skip mode may be a mode of applying the motion information of a neighboring block to the current block as it is. When the skip mode is applied, the encoding device 100 may perform entropy encoding on information about which block's motion information will be used as the motion information of the current block to generate a bitstream, and may signal the bitstream to the decoding device 200. The encoding device 100 may not signal syntax elements of at least any one of motion vector difference information, coded block flag, and transform coefficient level to the decoding device 200.

[0231] The sub-block merge mode may represent a mode of deriving motion information in units of sub-blocks of a coded unit (CU). When the sub-block merge mode is applied, motion information of sub-blocks co-located with the current sub-block in a reference picture (sub-block-based temporal merge candidate) and / or affine control point motion vector merge candidates may be used to generate a sub-block merge candidate list.

[0232] The geometric partitioning mode may represent a mode of deriving motion information by partitioning a current block in a predefined direction, using each of the derived motion information to derive each predicted sample point, and deriving the predicted sample point of the current block by weighting each of the derived predicted sample points.

[0233] The inter-frame / intra-frame combined prediction mode may represent a mode of deriving the predicted sample point of a current block by weighting the predicted sample points generated by inter-frame prediction and the predicted sample points generated by intra-frame prediction.

[0234] The decoding device 200 may correct the derived motion information by itself. The decoding device 200 may search a predetermined area based on the reference block indicated by the derived motion information, and derive the motion information with the minimum SAD as the corrected motion information.

[0235] The decoding device 200 may compensate the predicted sample points derived via inter-frame prediction using optical flow.

[0236] Figure 6 is a diagram showing the transformation and quantization processes.

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

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

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

[0240] The decoder performs entropy decoding on the bitstream to obtain the quantized level coefficients. The quantized level coefficients can be arranged in two-dimensional block form by inverse scanning. For inverse scanning, at least one of a right-up diagonal scan, a vertical scan, and a horizontal scan can be used.

[0241] Then, the quantized level coefficients can be dequantized, then a secondary inverse transform can be performed as needed, and finally a primary inverse transform can be performed as needed to generate a reconstructed residual signal.

[0242] Inverse mapping in the dynamic range can be performed on the luminance component reconstructed by intra prediction or inter prediction before in-loop filtering. The dynamic range can be partitioned into 16 equal segments, and the mapping function for each segment can be signaled. The mapping function can be signaled at the slice level or at the parallel block group level. An 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 region, and the prediction block generated by inter prediction is transformed to the mapping region via mapping using the mapping function and then used to generate a reconstructed block. However, since intra prediction is performed in the mapping region, the prediction block generated by intra prediction can be used to generate a reconstructed block without mapping / inverse mapping.

[0243] When the current block is a residual block of a chrominance component, the residual block can be transformed to the inverse mapped region by performing scaling on the chrominance component of the mapped region. The availability of the scaling can be signaled at the slice level or at the parallel block group level. The scaling can be applied only when the mapping of the luma component is available and the partitioning of the luma component and the splitting of the chrominance component follow the same tree structure. The scaling can be performed based on the average of the sample values of the luma prediction block corresponding to the chrominance difference block. In this case, when inter prediction is used for the current block, the luma prediction block can represent the mapped luma prediction block. The value required for scaling can be derived by using the index of the segment to which the average of the sample values of the luma prediction block belongs to look up a table. Finally, by scaling the residual block using the derived value, the residual block can be transformed to the inverse mapped region. Then, chrominance component block recovery, intra prediction, inter prediction, in-loop filtering, and reference picture storage can be performed in the inverse mapped region.

[0244] The information indicating whether the mapping / inverse mapping of the luma component and the chrominance component is available can be signaled by the sequence parameter set.

[0245] A prediction block for the current block can be generated based on a block vector indicating the displacement between the current block in the current picture and a reference block. In this way, the prediction mode for generating a prediction block by referring to the current picture is called the Intra Block Copy (IBC) mode. The IBC mode can be applied to M×N (M <= 64, N <= 64) coding units. The IBC mode can include a skip mode, a merge mode, an AMVP mode, etc. In the case of the skip mode or the merge mode, a merge candidate list is constructed, and a merge index is signaled so that a merge candidate can be specified. The block vector of the specified merge candidate can be used as the block vector of the current block. The merge candidate list can include at least one of a spatial candidate, a history-based candidate, a candidate based on the average of two candidates, and a zero merge candidate. In the case of the AMVP mode, a differential block vector can be signaled. Additionally, the prediction block vector can be derived from the left neighboring block and the upper neighboring block of the current block. The index of the neighboring block to be used can be signaled. The prediction block in the IBC mode is included in the current CTU or the left CTU and is limited to the blocks in the already reconstructed region. For example, the value of the block vector can be restricted so that the prediction block of the current block is located in the region of three 64×64 blocks before the 64×64 block to which the current block belongs in the coding / decoding order. By restricting the value of the block vector in this way, the memory consumption and device complexity according to the IBC mode implementation can be reduced.

[0246] In the following, reference will be made to Figures 8 to 20 describe embodiments of the present invention.

[0247] Figure 8 is a flowchart showing an image coding method according to an embodiment of the present invention, Figure 9It is a flowchart showing an image decoding method according to an embodiment of the present invention.

[0248] [E1 / D1]Derive motion vector candidates

[0249] Deriving motion vector candidates [E1 / D1] may include deriving at least one or more of spatial motion vector candidates [E1-1 / D1-1], temporal motion vector candidates [E1-2 / D1-2], and motion vector candidates [E1-3 / D1-3] derived based on history. Here, when the current block is in the IBC (Intra Block Copy) mode, the motion vector may represent a block vector.

[0250] [E1-1 / D1-1]Derive spatial motion vector candidates

[0251] The encoder / decoder may derive motion vector candidates from reconstructed blocks that are spatially adjacent to the encoding target block / decoding target block.

[0252] For example, as Figure 10 shown, the encoder / decoder may determine the spatial motion vector candidates of the encoding target block / decoding target block by deriving the spatial motion vectors of the block B1 adjacent above the encoding target block / decoding target block X, the block A1 adjacent to the left of the encoding target block / decoding target block, the block B0 adjacent to the upper right corner of the encoding target block / decoding target block, the block B2 adjacent to the upper left corner of the encoding target block / decoding target block, and the block A0 adjacent to the lower left corner of the encoding target block / decoding target block.

[0253] In addition, the encoder / decoder may determine whether there is a motion vector in each block according to a predetermined order of the blocks included in positions A0, A1, B0, B1, and B2. In the case where there is a motion vector, the encoder / decoder may determine the motion vector of the corresponding block as a spatial motion vector candidate.

[0254] When the encoding target block / decoding target block is in the IBC (Intra Block Copy) mode referring to the current picture, only neighboring blocks encoded in the IBC mode may be determined as spatial motion vector candidates. Here, the spatial motion vector candidates may be spatial block vector candidates.

[0255] When the encoding target block / decoding target block is in the inter prediction mode rather than the IBC mode, if the neighboring block is encoded in the IBC mode, the encoder / decoder may not use the motion vector of the corresponding block as a spatial motion vector candidate.

[0256] In other words, only when the spatially neighboring block has the same prediction mode as the current block, the encoder / decoder may determine the motion vector of the spatially neighboring block as a spatial motion vector candidate.

[0257] In addition, when the reference picture of at least one or more blocks included in positions A0, A1, B0, B1, and B2 is different from the reference picture of the coding target block / decoding target block, the encoder / decoder can scale the motion vector of the corresponding block and determine the motion vector of the corresponding block as a spatial motion vector candidate by using the distance between the coded / decoded target picture and the reference picture of the corresponding block and the distance between the coded / decoded target picture and the reference picture of the coding target block / decoding target block. Here, the encoder / decoder can scale the motion vector based on the reference picture index rather than the reference picture.

[0258] In addition, when performing scaling, the encoder / decoder can determine a spatial motion vector candidate by scaling at least one or more motion vectors of the blocks included in positions A0, A1, B0, B1, and B2 based on the reference picture corresponding to the reference picture index having a specific value. Here, the specific value can be a positive integer including 0.

[0259] In addition, the encoder / decoder can derive a spatial motion vector candidate based on at least one or more coding parameters.

[0260] In addition, the encoder / decoder can determine the motion vector of a spatially adjacent block as a spatial motion vector candidate based on the size or area of the current block.

[0261] For example, the encoder / decoder can determine the motion vector of an adjacent block as a spatial motion vector candidate only when the area of the current block is greater than a predefined value.

[0262] For another example, if the current block is in the IBC mode, then the encoder / decoder can determine the block vector of an adjacent block as a spatial block vector candidate only when the area of the current block is greater than a predefined value.

[0263] Here, the predefined value can be 16.

[0264] [E1-2 / D1-2] Derive temporal motion vector candidates

[0265] The encoder / decoder can derive motion vector candidates from the blocks reconstructed from the co-located pictures temporally adjacent to the coding target block / decoding target block.

[0266] For example, as Figure 11As shown, the encoder / decoder may derive temporal motion vector candidates in the order of the block at position H and the block at position C3, where position H is outside the co-located block C corresponding spatially to the coded / decoded target block X, and position C3 is in the co-located picture of the coded / decoded target picture. Here, when a motion vector can be derived from the block at position H, the encoder / decoder may derive the temporal motion vector candidate in the block at H. On the other hand, when a motion vector cannot be derived from the block at H, the encoder / decoder may derive the temporal motion vector candidate at position C3. If H or C3 as a predetermined position uses the current picture as a reference picture and is intra-coded or coded in the IBC (Intra Block Copy) mode, the encoder / decoder may not derive the temporal motion vector candidate. In this case, the temporal motion vector candidate may represent the motion vector of the co-located block.

[0267] In other words, only when the temporally neighboring block has the same prediction mode as the current block, the encoder / decoder may determine the motion vector of the temporally neighboring block as the temporal motion vector candidate.

[0268] In addition, the encoder / decoder may derive the temporal motion vector candidate based on at least one or more coding parameters.

[0269] When the distance between the picture including the coded / decoded target block and the reference block of the coded / decoded target block is different from the distance between the picture including the co-located block and the reference picture of the co-located block, the encoder / decoder may derive the temporal motion vector candidate by scaling the motion vector of the co-located block. Here, the encoder / decoder may scale the motion vector based on the reference picture index rather than the reference picture.

[0270] [E1-3 / D1-3] Derive history-based motion vector candidates

[0271] At least one piece of information used in the encoding / decoding process in the encoder / decoder or generated after the encoding / decoding process may be included in the history-based candidate list (i.e., the HMVP candidate list).

[0272] Here, the information of the block may be at least one of the coding parameters (such as the intra prediction mode and motion information).

[0273] When the current block is not in the affine mode or temporal motion vector candidates are not used in the sub-blocks, at least one piece of block information of the current block may be included in the HMVP candidate list.

[0274] When the current block is in the IBC (Intra Block Copy) mode using the current picture as a reference picture, it may be included in a separate HMVP candidate list. Here, the separate candidate list may be the IBC HMVP candidate list.

[0275] Different from the conventional candidate lists (motion vector candidate list and merge candidate list) configured in block units, the HMVP candidate list is maintained when encoding / decoding is performed in units of picture, slice, parallel block, CTU, CTU row, and CTU column. Therefore, it can be used within units of picture, slice, parallel block, CTU, CTU row, and CTU column. Additionally, the HMVP candidate list may include at least one piece of block information among multiple pieces of block information of blocks that have been encoded / decoded in units of picture, slice, parallel block, CTU, CTU row, and CTU column before the current block. Additionally, the HMVP candidate list may include at least one piece of block information among multiple pieces of block information of blocks that have been encoded / decoded in units of picture, slice, parallel block, CTU, CTU row, and CTU column previously.

[0276] As Figure 12 shown in the example of, the encoder / decoder may determine at least one piece of block information of a candidate in the HMVP candidate list for the encoding / decoding process of the current block. The encoder / decoder may perform the encoding / decoding process of the current block by using at least one piece of block information of the selected candidate.

[0277] The encoder / decoder may include in the HMVP candidate list at least one piece of block information used during the encoding / decoding process of the current block or at least one piece of block information used after the encoding / decoding process of the current block. Here, including at least one of block information, candidate, and block in the candidate list may mean adding at least one of block information, candidate, and block to the HMVP candidate list.

[0278] When at least one piece of block information of the current block is included in the HMVP candidate list, this piece of block information of the current block may be added to the HMVP candidate list first or last.

[0279] The maximum number of candidates in the HMVP candidate list may be determined as P. Here, P may be a positive integer including 0. P may be determined based on at least one of the encoding parameters of the current block and the encoding parameters of the candidate block. Additionally, P may be a value already set in the encoder / decoder or a value signaled from the encoder to the decoder.

[0280] The candidates in the HMVP candidate list may be used to configure at least one of the intra prediction mode candidate list, the first MPM (Most Probable Mode) list, the second MPM list, the residual intra prediction mode candidate list, the motion vector candidate list, the merge candidate list, and the IBC candidate list.

[0281] Among multiple block information, the intra prediction coding mode may be included in the HMVP candidate list. The candidates in the HMVP candidate list including the intra prediction coding mode can be used to configure the intra prediction mode candidate list (e.g., the first MPM list, the second MPM list, the residual mode list, etc.). The candidates can be included in the intra prediction mode candidate list.

[0282] Among multiple block information, the inter coding information (e.g., motion vector, reference picture index, reference picture list information, bi - directional prediction weight information (bcwIdx), 1 / 2 interpolation filter information (HpelIfIdx), etc.) may be included in the HMVP candidate list. The candidates in the candidate list including the inter coding information can be used to configure the motion vector candidate list. The candidates can be included in the motion vector candidate list.

[0283] Among multiple block information, the inter coding information (e.g., motion vector, reference picture index, reference picture list information, bi - directional prediction weight information (bcwIdx), 1 / 2 interpolation filter information (HpelIfIdx), etc.) may be included in the HMVP candidate list. The candidates in the HMVP candidate list including the inter coding information can be used to configure the merge candidate list. The candidates can be included in the merge candidate list.

[0284] In this step, a history - based motion vector candidate list can be configured, where the history - based motion vector candidate list includes the inter coding information in multiple block information (e.g., motion vector, reference picture index, reference picture list information, bi - directional prediction weight information (bcwIdx), 1 / 2 interpolation filter information (HpelIfIdx), etc.).

[0285] [E2 / D2] Configure the motion vector candidate list

[0286] Configuring the motion vector candidate list [E2 / D2] may include generating combined motion vector candidates and adding them to the motion vector candidate list [E2 - 1 / D2 - 1].

[0287] The encoder / decoder can configure the motion vector candidate list by adding the derived motion vector candidates to the motion vector candidate list or by removing the motion vector candidates included in the motion vector candidate list.

[0288] The derived spatial motion vector candidates, temporal motion vector candidates, and the history - based motion vector candidate list can be added to the motion vector candidate list mvpListLX in a predetermined order. mvpListLX can represent the motion vector candidate list corresponding to at least one or more reference picture lists (such as L0, L1, L2, and L3). For example, the motion vector candidate list corresponding to the reference picture list L0 can be represented as mvpListL0.

[0289] In the following, embodiments of configuring a motion vector candidate list will be described.

[0290] For example, an encoder / decoder may sequentially add derived spatial motion vector candidates, temporal motion vector candidates, and a history-based motion vector candidate list to the motion vector candidate list.

[0291] For example, an encoder / decoder may sequentially add derived spatial motion vector candidates, a history-based motion vector candidate list, and temporal motion vector candidates to the motion vector candidate list.

[0292] For example, an encoder / decoder may add a history-based motion vector candidate list to the derived spatial motion vector candidates, and then add temporal motion vector candidates to the motion vector candidate list. Specifically, an encoder / decoder may sequentially add N spatial motion vector candidates, a history-based motion vector candidate list, M spatial motion vector candidates, and temporal motion vector candidates to the motion vector candidate list. Here, N and M may be positive integers equal to or greater than 0.

[0293] Optionally, an encoder / decoder may add spatial motion vector candidates, temporal motion vector candidates, and a history-based motion vector candidate list to the motion vector candidate list in a predetermined order.

[0294] When configuring the motion vector candidate list, an encoder / decoder may determine whether the motion information is the same only in the derived spatial motion vector candidates. In a case where the number of candidates in the list does not satisfy the maximum number of motion vector candidates and thus temporal motion vector candidates or history-based motion vector candidates are added, the encoder / decoder may not check for redundancy with previous candidates.

[0295] In a case where an encoder / decoder adds a history-based motion vector candidate when configuring the motion vector candidate list, the encoder / decoder may add information on the maximum number of candidate blocks in the history-based candidate list being N to the motion vector candidate list. N may be greater than 0 and equal to the maximum number of candidates in the history-based candidate list.

[0296] In a case where an encoder / decoder adds a history-based motion vector candidate when configuring the motion vector candidate list, the encoder / decoder may add information on the maximum number of candidate blocks in the history-based candidate list being N to the motion vector candidate list. N may be greater than 0 and equal to the maximum number of candidates in the history-based candidate list. In a case where the maximum number of candidates in the history-based candidate list is greater than 4, information on up to 4 candidate blocks may be added to the motion vector candidate list.

[0297] When the encoder / decoder adds history-based motion vector candidates when configuring the IBC candidate list, the encoder / decoder may add the information of P candidate blocks in the history-based candidate list to the IBC candidate list. Here, P may be 1, and the motion vector candidate may be a block vector candidate.

[0298] In addition to the derived spatial motion vector candidates, the history-based motion vector candidate list, and the temporal motion vector candidates, the encoder / decoder may add a vector with a predetermined value to the motion vector candidate list mvpListLX.

[0299] [E2-1 / D2-1] Generate combined motion vector candidates and add them to the motion vector candidate list

[0300] The encoder / decoder may generate combined motion vector candidates by using at least one or more of the spatial motion vector candidates, the history-based motion vector candidate list, the temporal motion vector candidates, and the zero motion vector candidates in the motion vector candidate list, and may also add the combined motion vector candidates to the motion vector candidate list.

[0301] In addition, the encoder / decoder may generate combined motion vector candidates based on at least one or more coding parameters. In addition, the encoder / decoder may add the combined motion vector candidates to the motion vector candidate list based on at least one or more coding parameters.

[0302] [E3 / D3] Determine the predicted motion vector from the motion vector candidate list

[0303] The encoder / decoder may determine the motion vector candidate in the motion vector candidate list mvpListLX corresponding to the motion vector candidate index as the predicted motion vector.

[0304] The encoder may calculate the motion vector difference by calculating the difference between the motion vector and the predicted motion vector, and the decoder may calculate the motion vector by adding the predicted motion vector and the motion vector difference.

[0305] [E4 / D4] Perform motion compensation

[0306] In the encoder / decoder, inter-frame prediction or motion compensation may be performed by using the determined motion vector.

[0307] [E5 / D5] Entropy coding / entropy decoding of the information on the motion compensation for the current encoding target block / decoding target block.

[0308] The encoder / decoder may perform entropy coding / entropy decoding on the information on the motion compensation from the bitstream. Here, the information on the motion compensation may include at least one of the following multiple pieces of information.

[0309] - The inter_pred_idc indicates the inter prediction indicator

[0310] - The reference picture index (ref_idx_l0, ref_idx_l1, ref_idx_l2, ref_idx_l3)

[0311] - The motion vector candidate index (mvp_l0_flag, mvp_l1_flag, mvp_l2_flag, mvp_l3_flag)

[0312] - The motion vector difference

[0313] - The cu_skip_flag, indicating whether to use the skip mode

[0314] - The merge_flag, indicating whether to use the merge mode

[0315] - The merge_idx (merge_index), indicating the merge candidate

[0316] - The weighting factors (wf_l0, wf_l1, wf_l2, wf_l3)

[0317] - The offset values (offset_l0, offset_l1, offset_l2, offset_l3)

[0318] The inter prediction indicator may refer to the direction of the inter prediction (such as uni - directional prediction, bi - directional prediction, tri - directional prediction, quad - directional prediction, etc.) of the current block during inter prediction. This may represent the number of reference pictures used by the current block to generate the prediction block. Optionally, one reference picture may be used for multi - direction prediction. In this case, M - direction prediction may be performed by using N reference pictures (N < M). Optionally, the inter prediction indicator may refer to the number of prediction blocks used by the current block to perform inter prediction or motion compensation. Additionally, it may represent the number of prediction blocks used by the current block when performing inter prediction or motion compensation through at least one or more reference picture lists (such as L0, L1, L2, and L3). Here, L0, L1, L2, and L3 may refer to list 0, list 1, list 2, and list 3 respectively. Additionally, the inter prediction indicator may be information on whether the current block refers to a maximum of N reference picture lists. Here, N may be 1, 2, 3, 4, etc., or a positive integer equal to or greater than 1. The current block may perform motion compensation by using one or more reference picture lists.

[0319] For example, the encoder / decoder may perform motion compensation by using reference picture lists L0 and L1 to generate at least one or more prediction blocks.

[0320] For example, an encoder / decoder may perform motion compensation by using reference picture lists L0, L1, and L2 to generate at least one prediction block.

[0321] For example, an encoder / decoder may perform motion compensation by using reference picture lists L0, L1, and L2 to generate at least one or more prediction blocks.

[0322] For example, an encoder / decoder may perform motion compensation by using reference picture lists L0, L1, and L2 to generate at least one or more prediction blocks and a maximum number of N prediction blocks. Here, N may be 3 or a positive integer equal to or greater than 2.

[0323] For example, an encoder / decoder may perform motion compensation by using reference picture lists L0, L1, L2, and L3 to generate one prediction block.

[0324] For example, an encoder / decoder may perform motion compensation by using reference picture lists L0, L1, L2, and L3 to generate at least one or more prediction blocks.

[0325] For example, an encoder / decoder may perform motion compensation by using reference picture lists L0, L1, L2, and L3 to generate at least one or more prediction blocks and a maximum number of N prediction blocks. Here, N may be 4 or a positive integer equal to or greater than 2.

[0326] An available inter prediction direction may be determined based on an inter prediction indicator. Some or all of the available inter prediction directions may be selectively used based on the size and / or shape of the current block.

[0327] The inter prediction indicator may be information indicating whether the inter prediction is unidirectional prediction using L0 (list 0), unidirectional prediction using L1 (list 1), or bidirectional prediction using both L0 and L1. The inter prediction indicator may be represented in the form of a flag for the prediction list, where the flag form for the prediction list includes a flag indicating whether to use prediction in direction L0 and a flag indicating whether to use prediction in direction L1.

[0328] Here, the prediction list utilization flag can indicate whether to use the corresponding reference picture list to generate a prediction block. For example, when the prediction list utilization flag indicates the first value (1), it can indicate that the corresponding reference picture list is used to generate a prediction block. On the other hand, when the prediction list utilization flag indicates the second value (0), it can indicate that the corresponding reference picture list is not used to generate a prediction block. In other words, a prediction block of the current block can be generated only by using the motion information of the prediction list utilization flag indicating that the corresponding reference picture list can be used to generate a prediction block. Additionally, a prediction block of the current block can be generated using the corresponding motion information only when the prediction list utilization flag has the first value. Additionally, the prediction list utilization flag can be set based on the inter prediction indicator, and the inter prediction indicator can be set based on the prediction list utilization flag.

[0329] Additionally, num_ref_idx_l0_active_minus1, num_ref_idx_l1_active_minus1, num_ref_idx_l2_active_minus1, and num_ref_idx_l3_active_minus1 can respectively refer to the number of reference pictures in reference picture lists L0, L1, L2, and L3.

[0330] The reference picture index can represent the reference picture referred to by the current block in each reference picture list. For each reference picture list, one or more reference picture indexes can be entropy decoded. The encoder / decoder can perform motion compensation by using one or more reference picture indexes.

[0331] For example, the encoder / decoder can perform motion compensation by using one reference picture index to generate at least one or more prediction blocks.

[0332] For example, the encoder / decoder can perform motion compensation by using two reference picture indexes to generate at least one or more prediction blocks and a maximum number of N prediction blocks. Here, N can be 2 or a positive integer equal to or greater than 2.

[0333] For example, the encoder / decoder can perform motion compensation by using three reference picture indexes to generate at least one or more prediction blocks and a maximum number of N prediction blocks. Here, N can be 3 or a positive integer equal to or greater than 3.

[0334] For example, the encoder / decoder can perform motion compensation by using four reference picture indexes to generate at least one or more prediction blocks and a maximum number of N prediction blocks. Here, N can be 4 or a positive integer equal to or greater than 4.

[0335] The motion vector candidate index may indicate the motion vector candidate used by the current block in the motion vector candidate list generated from each reference picture list and / or each reference picture index. For each reference picture list and / or each reference picture index, one or more motion vector candidate indices may be entropy decoded. The encoder / decoder may perform motion compensation by using one or more motion vector candidate indices.

[0336] For example, the encoder / decoder may perform motion compensation by using one motion vector candidate index, thereby generating at least one or more predicted blocks.

[0337] For example, the encoder / decoder may perform motion compensation by using two motion vector candidate indices, thereby generating at least one or more predicted blocks and a maximum number of N predicted blocks. Here, N may be 2 or a positive integer equal to or greater than 2.

[0338] For example, the encoder / decoder may perform motion compensation by using three motion vector candidate indices, thereby generating at least one or more predicted blocks and a maximum number of N predicted blocks. Here, N may be 3 or a positive integer equal to or greater than 3.

[0339] For example, the encoder / decoder may perform motion compensation by using four motion vector candidate indices, thereby generating at least one or more predicted blocks and a maximum number of N predicted blocks. Here, N may be 4 or a positive integer equal to or greater than 4.

[0340] The motion vector difference may represent the difference between the motion vector and the predicted motion vector. For the current block, one or more motion vector differences in each reference picture list and / or each reference picture index may be entropy decoded. The encoder / decoder may perform motion compensation by using one or more motion vector differences.

[0341] For example, the encoder / decoder may perform motion compensation by using one motion vector difference, thereby generating at least one or more predicted blocks.

[0342] For example, the encoder / decoder may perform motion compensation by using two motion vector differences, thereby generating at least one or more predicted blocks and a maximum number of N predicted blocks. Here, N may be 2 or a positive integer equal to or greater than 2.

[0343] For example, the encoder / decoder may perform motion compensation by using three motion vector differences, thereby generating at least one or more predicted blocks and a maximum number of N predicted blocks. Here, N may be 3 or a positive integer equal to or greater than 3.

[0344] For example, an encoder / decoder may perform motion compensation by using four motion vector differences, thereby generating at least one or more prediction blocks and a maximum number N of prediction blocks. Here, N may be 4 or a positive integer equal to or greater than 4.

[0345] The cu_skip_flag may represent information on whether to use the skip mode, and may be entropy encoded / entropy decoded in at least one or more units of the coding block and the prediction block. For example, when the information on whether to use the skip mode has a first value (1), it may indicate the use of the skip mode. When the information on whether to use the skip mode has a second value (0), it may not indicate the use of the skip mode.

[0346] The merge_flag may represent information on whether to use the merge mode, and may be entropy encoded / entropy decoded in at least one or more units of the coding block and the prediction block. For example, when the information on whether to use the merge mode has a first value (1), it may indicate the use of the merge mode. When the information on whether to use the merge mode has a second value (0), it may not indicate the use of the merge mode.

[0347] The merge_idx may represent information indicating a merge candidate within a merge candidate list, and may be entropy encoded / entropy decoded in at least one or more units of the coding block and the prediction block. Additionally, the merge_idx may represent merge index information. Additionally, the merge_idx may indicate a block from which a merge candidate is derived from a reconstructed block adjacent to the current block in space / time. Additionally, the merge_idx may indicate at least one or more pieces of motion information of the merge candidate. For example, when the merge index information has a first value (0), it may indicate the first merge candidate within the merge candidate list. When the merge index information has a second value (1), it may indicate the second merge candidate within the merge candidate list. When the merge index information has a third value (2), it may indicate the third merge candidate within the merge candidate list. Similarly, when it has a fourth value or an nth value, it may indicate the merge candidate with the corresponding value according to the order in the merge candidate list. Here, N may be a positive integer including 0.

[0348] When performing motion compensation, at least two or more prediction blocks may be generated, and then a weighted sum may be calculated by using at least one or more of a weighting factor and an offset for each prediction block. The weighted sum calculated thereby may be used for inter-frame prediction or motion compensation of a current block. At least one or more of the weighting factor and the offset of the prediction block may be entropy-encoded / entropy-decoded in at least one or more units of the coded block and the prediction block. Here, at least one or more of the weighting factor and the offset of each prediction block may be entropy-encoded / entropy-decoded for at least one or more of a reference picture list, a reference picture, a motion vector candidate index, a motion vector difference, a motion vector, information on whether to use a skip mode, information on whether to use a merge mode, and merge index information. Additionally, at least one or more of the weighting factor and the offset value of each prediction block may be entropy-encoded / entropy-decoded based on an inter-frame prediction indicator.

[0349] At least one or more of the above-mentioned multiple pieces of information regarding motion compensation may be entropy-encoded / entropy-decoded in at least one or more units of a CTU and a sub-CTU. Here, the sub-CTU may include at least one or more of a sub-CTU, a CU, and a PU.

[0350] For example, when entropy-encoding / entropy-decoding at least one or more of the pieces of information regarding motion compensation in a CTU, at least one or more of the pieces of information regarding motion compensation existing in all blocks in the CTU may be used to perform motion compensation.

[0351] For example, when entropy-encoding / entropy-decoding at least one or more of the pieces of information regarding motion compensation in a CTU or a sub-CTU, at least one or more of the pieces of information regarding motion compensation for a specific block size or a specific block depth may be entropy-encoded / entropy-decoded. Here, information regarding the specific block size or the specific block depth may be additionally entropy-encoded / entropy-decoded. Additionally, the block size or the block depth preset in the encoder / decoder may be used as the specific block size or the specific block depth. Additionally, information regarding the specific block size or the specific block depth may be determined based on coding parameters. Additionally, information regarding the specific block size or the specific block depth may be determined based on the value of another coded / decoded syntax element. Blocks in the sub-CTU may have a square or non-square shape.

[0352] Here, in a block including a specific block size or having a block size larger than the specific block size, at least one or more of the pieces of information regarding motion compensation may be entropy-encoded / entropy-decoded. In a block having a block size smaller than the specific block size, at least one or more of the pieces of information regarding motion compensation may not be entropy-encoded / entropy-decoded.

[0353] In a block having a smaller block size within a specific block size, motion compensation can be performed based on at least one or more pieces of information for entropy encoding / decoding of motion compensation in the specific block size. Here, in a block having a smaller block size within a specific block size, at least one or more of a motion vector candidate, a motion vector candidate list, a merge candidate, a merge candidate list, or other information included in the information regarding motion compensation can be shared.

[0354] Here, in a block including a specific block depth or having a block depth shallower than the specific block depth, at least one or more pieces of information regarding motion compensation can be entropy encoded / decoded. In a block having a block depth deeper than the specific block depth, at least one or more pieces of information regarding motion compensation cannot be entropy encoded / decoded.

[0355] In a block having a deeper block depth lower than the specific block depth, motion compensation can be performed based on at least one or more pieces of entropy decoding information regarding motion compensation at the specific block depth. In a block having a deeper block depth lower than the specific block depth, motion compensation can be performed based on at least one or more pieces of information regarding motion compensation at the specific block depth, and the information regarding motion compensation at the specific block depth can be entropy encoded. Here, in a block having a deeper block depth lower than the specific block depth, at least one or more of a motion vector candidate, a motion vector candidate list, a merge candidate, a merge candidate list, or other information included in the information regarding motion compensation can be shared.

[0356] For example, when the block size of a CTU is 64×64 and at least one or more pieces of information regarding motion compensation in a 32×32 block as a sub-CTU are entropy encoded / decoded, motion compensation in a block belonging to the 32×32 block but having a smaller size can be performed based on at least one or more pieces of entropy encoded / decoded information regarding motion compensation in the 32×32 block unit.

[0357] For example, when the block size of a CTU is 128×128 and at least one or more pieces of information regarding motion compensation in a 16×16 block as a sub-CTU are entropy encoded / decoded, motion compensation in a block belonging to the 16×16 block but having a size less than or equal to the 16×16 block unit can be performed based on at least one or more pieces of entropy encoded / decoded information regarding motion compensation in the 16×16 block unit.

[0358] For example, when the block depth of a CTU is 0 and at least one or more pieces of information regarding motion compensation in a block depth of 1 in a sub-CTU are entropy encoded / decoded, motion compensation in a block belonging to the block depth of 1 but having a deeper block depth can be performed based on at least one or more pieces of entropy encoded / decoded information regarding motion compensation in the block depth of 1.

[0359] For example, when the block depth of a CTU is 0 and at least one or more pieces of information regarding motion compensation for a block depth of 2 in a sub-CTU are entropy encoded / entropy decoded, motion compensation in blocks that belong to a block depth of 2 but have a deeper or equal block depth can be performed based on at least one or more pieces of entropy encoded / entropy decoded information regarding motion compensation for a block depth of 2.

[0360] Here, as the positive integer of the depth increases, the depth can increase. As the depth value decreases, the depth can become shallower. Additionally, as the depth increases, the block size can decrease. On the other hand, as the depth decreases, the block size can increase. Further, the sub-depth of a specific block depth can represent a depth deeper than the specific block depth. The sub-depth of a specific block depth can represent a deeper depth within the block size corresponding to the specific block depth.

[0361] Additionally, at least one or more pieces of information regarding motion compensation can be calculated by using index information within a set predetermined in an encoder and a decoder.

[0362] Furthermore, at least one or more pieces of information regarding motion compensation can be entropy encoded / entropy decoded in at least one or more of a video parameter set, a sequence parameter set, a picture parameter set, an adaptive parameter set, a picture header, and a slice header.

[0363] Moreover, the difference between at least one or more pieces of information regarding motion compensation in at least one or more units among CTUs, sub-CTUs, CUs, and PUs can be entropy encoded / entropy decoded by using at least one or more pieces of higher-level information regarding motion compensation in a parameter set, a picture header, and a slice header as prediction values. The value of at least one or more pieces of information regarding motion compensation can be calculated by adding the prediction value of at least one or more pieces of information regarding motion compensation to the difference between at least one or more pieces of information regarding motion compensation.

[0364] Optionally, at least one or more pieces of information regarding motion compensation in at least one or more of CTUs, sub-CTUs, CUs, and PUs can be entropy encoded / entropy decoded by using at least one or more pieces of information regarding motion compensation in a specific region within a picture, a slice, a parallel block, or a CTU as prediction values. The value of at least one or more pieces of information regarding motion compensation can be calculated by adding the prediction value of at least one or more pieces of information regarding motion compensation to the difference between at least one or more pieces of information regarding motion compensation.

[0365] Additionally, at least one or more pieces of information regarding motion compensation for a predicted block can be entropy encoded / entropy decoded in at least one or more specific regions within a picture, a slice, a parallel block, or a CTU.

[0366] In addition, the encoder / decoder may entropy-encode / entropy-decode the difference of at least one or more pieces of information regarding motion compensation by using at least one or more pieces of information regarding motion compensation of neighboring blocks for encoding / decoding as prediction values of at least one or more pieces of information regarding motion compensation of neighboring blocks for encoding / decoding. The encoder / decoder may calculate the value of at least one or more pieces of information regarding motion compensation by adding the prediction value of at least one or more pieces of information regarding motion compensation to the difference of at least one or more pieces of information regarding motion compensation.

[0367] In addition, the encoder / decoder may use at least one or more pieces of information regarding motion compensation of neighboring blocks for encoding / decoding as the value of at least one or more pieces of information regarding motion compensation of the current block without performing entropy-encoding / entropy-decoding on at least one or more pieces of information regarding motion compensation.

[0368] In addition, the encoder / decoder may derive at least one or more pieces of information regarding motion compensation based on at least one or more of the encoding parameters.

[0369] In addition, the encoder / decoder may entropy-decode at least one or more pieces of information regarding motion compensation from the bitstream based on at least one or more of the encoding parameters. The encoder / decoder may entropy-encode at least one or more pieces of information regarding motion compensation as a bitstream based on at least one or more of the encoding parameters.

[0370] In addition, the information regarding motion compensation may further include at least one or more of a motion vector, motion vector resolution information, overlapping block motion compensation information, local illumination compensation information, affine motion compensation information, decoder-side motion vector derivation information, and bidirectional optical flow information. Here, the decoder-side motion vector derivation may represent pattern-matching motion vector derivation.

[0371] The motion vector resolution information may be information regarding whether a specific resolution is used for at least one or more of the motion vector and the motion vector difference. Here, the resolution may represent precision. In addition, the specific resolution may be at least one or more of a 16-pixel (16-pel) unit, an 8-pixel (8-pel) unit, a 4-pixel (4-pel) unit, an integer-pixel (integer-pel) unit, a 1 / 2-pixel (1 / 2-pel) unit, a 1 / 4-pixel (1 / 4-pel) unit, a 1 / 8-pixel (1 / 8-pel) unit, a 1 / 16-pixel (1 / 16-pel) unit, a 1 / 32-pixel (1 / 32-pel) unit, and a 1 / 64-pixel (1 / 64-pel) unit.

[0372] The overlapping block motion compensation information may be information on whether sub - blocks constructed by using the motion information of spatially adjacent blocks of the coding target block / decoding target block are used to construct the prediction block of the coding target block / decoding target block when performing motion compensation on the coding target block / decoding target block.

[0373] The local illumination compensation information may be information on whether at least one or more of a weighting factor and an offset value are applied when constructing the prediction block of the coding target block / decoding target block. Here, the weighting factor and the offset value may be values calculated based on a reference block.

[0374] The affine motion compensation information may be information on whether an affine motion model is used for motion compensation of the coding target block / decoding target block. Here, the affine motion model may be a method of partitioning a block into multiple sub - blocks by multiple parameters and calculating the motion vectors of the partitioned sub - blocks from representative motion vectors.

[0375] The decoder - side motion vector derivation information may be information on whether motion vectors required for motion compensation are derived and used from the decoder. Here, information on the motion vectors may not be entropy - encoded / entropy - decoded. Here, when using the merge mode, decoder - side motion vector derivation may be performed.

[0376] The bidirectional optical flow information may be information on whether motion compensation is performed by correcting the motion vectors in pixels. Here, the motion vectors in pixels may not be entropy - encoded / entropy - decoded. Additionally, motion vector correction may change the motion vector values in a block to pixels.

[0377] The current block may perform motion compensation by using at least one or more pieces of entropy - decoded information on motion compensation. The current block may perform motion compensation by using at least one or more pieces of information on motion compensation, and at least one or more pieces of information on motion compensation may be entropy - encoded.

[0378] When entropy - encoding / entropy - decoding information related to the motion compensation of the current coding target block / decoding target block, the encoder / decoder may not perform entropy - encoding / entropy - decoding on at least one or more pieces of information related to motion compensation by using the coding information of the reference pictures in the current picture and the reference picture list to which the current coding target block / decoding target block belongs.

[0379] Here, the coding information of the current picture and the reference pictures may be POC (Picture Order Count) information. The encoder / decoder may not perform entropy - encoding / entropy - decoding on at least one or more pieces of information on motion compensation by using the POC information of the reference pictures in the current picture and the reference picture list.

[0380] When the POC information between the current picture and the reference pictures in the reference picture list satisfies the following conditions, the encoder / decoder can perform entropy encoding / decoding on the information (e.g., sym_mvd_flag) indicating whether to perform entropy encoding / decoding on the L0 and L1 reference picture index information (ref_idx_l0 and ref_idx_l1) and the unidirectional (L0 or L1) motion vector difference information (MvdL0 or MvdL1) of the current encoding target block / decoding target block.

[0381] [Condition 1] The current encoding target block / decoding target block is in the bi-prediction mode, and there are L0 reference pictures and L1 reference pictures.

[0382] [Condition 2-1] The POC of at least one or more reference pictures among the N reference pictures in the L0 reference picture list is less than the POC of the current picture, and the POC of at least one or more reference pictures among the M reference pictures in the L1 reference picture list is greater than the POC of the current picture (N and M can be natural numbers greater than 0, and can be equal to or different from each other).

[0383] [Condition 2-2] The POC of at least one or more reference pictures among the N reference pictures in the L0 reference picture list is greater than the POC of the current picture, and the POC of at least one or more reference pictures among the M reference pictures in the L1 reference picture list is less than the POC of the current picture (N and M can be natural numbers greater than 0, and can be equal to or different from each other).

[0384] When there are no reference pictures satisfying [Condition 2-1], [Condition 2-2] can be executed. On the contrary, when there are no reference pictures satisfying [Condition 2-2] after executing [Condition 2-2], [Condition 2-1] can be executed.

[0385] Under the condition of satisfaction, the L0 and L1 reference picture index information and the unidirectional (L0 or L1) motion vector difference (MVD) information can always be derived without performing entropy encoding / decoding, regardless of the information (e.g., "sym_mvd_flag") indicating whether to perform entropy encoding / decoding.

[0386] When the condition is satisfied and the encoded / decoded "sym_mvd_flag" has the first value (0), entropy encoding / decoding can be performed on the L0 and L1 reference picture index information and the MVD (motion vector difference) information of L0 and L1.

[0387] When the condition is satisfied and the encoded / decoded "sym_mvd_flag" has the second value (1), the L0 and L1 reference picture index information and the MVD information in one direction (L0 or L1) can be derived without being entropy encoded / decoded as follows.

[0388] When [Condition 2-1] is satisfied, if the POC of at least one or more of the N reference pictures in the L0 reference picture list is less than the POC of the current picture, the position information of such a reference picture within the L0 reference picture list can be derived as the L0 reference picture index value: the reference picture is a short-term reference picture, and the POC of the reference picture is less than the POC of the current picture and has the smallest difference from the POC of the current picture.

[0389] For example, when the POC of the second reference picture in the L0 reference picture list has the smallest difference from the POC of the current picture, the value "1" indicating the second reference picture in the L0 reference picture list can be derived as the L0 reference picture index.

[0390] When [Condition 2-1] is satisfied, if the POC of at least one or more of the M reference pictures in the L1 reference picture list is greater than the POC of the current picture, the position information of such a reference picture within the L1 reference picture list can be derived as the L1 reference picture index value: the reference picture is a short-term reference picture, and the POC of the reference picture is greater than the POC of the current picture and has the smallest difference from the POC of the current picture.

[0391] For example, when the POC of the third reference picture in the L1 reference picture list has the smallest difference from the POC of the current picture, the value "2" indicating the third reference picture in the L1 reference picture list can be derived as the L1 reference picture index.

[0392] When [Condition 2-2] is satisfied, if the POC of at least one or more of the N reference pictures in the L0 reference picture list is greater than the POC of the current picture, the position information of such a reference picture within the L0 reference picture list can be derived as the L0 reference picture index value: the reference picture is a short-term reference picture, and the POC of the reference picture is greater than the POC of the current picture and has the smallest difference in POC from the POC of the current picture.

[0393] For example, when the POC of the second reference picture in the L0 reference picture list has the smallest difference from the POC of the current picture, the value "1" indicating the second reference picture in the L0 reference picture list can be derived as the L0 reference picture index.

[0394] When [Condition 2-2] is satisfied, if the POC of at least one or more of the M reference pictures in the L1 reference picture list is less than the POC of the current picture, the position information of such a reference picture within the L1 reference picture list can be derived as the L1 reference picture index value: the reference picture is the current short-term reference picture, and the POC of the reference picture is less than the POC of the current picture and has the smallest difference from the POC of the current picture.

[0395] For example, when the third reference picture POC in the L1 reference picture list has the smallest difference from the current picture POC, the value "2" indicating the third reference picture in the L1 reference picture list can be derived as the L1 reference picture index.

[0396] After configuring the reference picture list of the current picture or slice including the coding target block / decoding target block, the check of conditions [2-1] and [2-2] and the derivation process of the L0 / L1 reference picture index can be performed.

[0397] Without considering the POC difference between the current picture POC, the L0 reference picture POC, and the L1 reference picture POC indicated by the derived L0 reference picture index and L1 reference picture index information, the encoder / decoder can always derive the motion vector difference in the direction not entropy-coded / entropy-decoded as follows.

[0398] When entropy-coding / entropy-decoding the motion vector difference (MVD0) in direction L0, the motion vector difference (MVD1) in direction L1 can be derived as -MVD0. In other words, the horizontal and vertical motion vector differences in direction L1 are as follows. (MVD1_x = -MVD0_x, MVD1_y = -MVD0_y)

[0399] When entropy-coding / entropy-decoding the motion vector difference (MVD1) in direction L1, the motion vector difference (MVD0) in direction L0 can be derived as -MVD1. In other words, the horizontal and vertical motion vector differences in direction L0 are as follows. (MVD0_x = -MVD1_x, MVD0_y = -MVD1_y)

[0400] The encoder / decoder can derive the motion vector difference in the direction not encoded / decoded by considering the current picture POC, the L0 reference picture POC indicated by the derived L0 reference picture index information, and the L1 reference picture POC indicated by the derived L1 reference picture index information.

[0401] For example, when entropy-coding / entropy-decoding the motion vector difference (MVD0) in direction L0, the motion vector difference in direction L1 can be derived as a scaled MVD0 value through Equation 1 below.

[0402] Equation 1

[0403] currPocDiffL0 = DiffPicOrderCnt(currPic,RefPicList0[refIdxL0])currPocDiffL1 = DiffPicOrderCnt(currPic,RefPicList1[refIdxL1])

[0404] td = Clip3(-128, 127, currPocDiffL0)

[0405] tb = Clip3(-128, 127, currPocDiffL1) [Mathematical formula 1]

[0406] tx = (16384 + (Abs(td) >> 1)) / td

[0407] distScaleFactor = Clip3(-4096, 4095, (tb * tx + 32) >> 6)

[0408] MVD1_x = Clip3(-2 15 , 2 15 , -1, Sign(distScaleFactor * MVD0_x) * ((Abs(distScaleFactor * MVD0_x) + 127) >> 8)

[0409] MVD1_y = Clip3(-2 15 , 2 15 , -1, Sign(distScaleFactor * MVD0_y) * ((Abs(distScaleFactor * MVD0_y) + 127) >> 8))

[0410] currPic is the POC of the current picture, RefPicList0[RefIdx10] is the POC of the reference picture indicated by the derived L0 reference picture index information, and RefPicList1[refIdxL1] is the POC of the reference picture indicated by the derived L1 reference picture index information.

[0411] DiffPicOrderCnt() is the POC difference between the POC of the current picture and the POC of the reference picture.

[0412] For example, when entropy encoding / decoding the motion vector difference (MVD1) in direction L1, the motion vector difference in direction L0 can be derived as a scaled MVD1 value through Equation 1.

[0413] The encoder / decoder can determine the direction of the motion vector difference for entropy encoding / decoding by considering the POC difference between the POC of the current picture, the POC of the L0 reference picture, and the POC of the L1 reference picture indicated by the derived L0 reference picture index and L1 reference picture index information.

[0414] For example, when the difference between the current picture POC and the derived L0 reference picture POC is greater than the difference between the current picture POC and the derived L1 reference picture POC, the motion vector difference (MVD0) in the L0 direction can be entropy-coded / entropy-decoded, and the motion vector difference in the L1 direction can be derived as a scaled MVD0 value.

[0415] For example, when the difference between the current picture POC and the derived L1 reference picture POC is greater than the difference between the current picture POC and the derived L0 reference picture POC, the motion vector difference (MVD1) in the L1 direction can be entropy-coded / entropy-decoded, and the motion vector difference in the L0 direction can be derived as a scaled MVD1 value.

[0416] As another example, when the POC information between the current picture and the reference pictures in the reference picture list satisfies the following conditions, the encoder / decoder can entropy-code / entropy-decode the information (e.g., sym_mvd_flag) indicating whether to perform entropy coding / entropy decoding on the L0 and / or L1 reference picture index information and the unidirectional (L0 or L1) motion vector difference (MVD) information of the current coding target block / decoding target block.

[0417] [Condition 1] The current coding target block / decoding target block is in the bi-prediction mode, and there are L0 reference pictures and L1 reference pictures.

[0418] [Condition 2-1] At least one or more of the N reference pictures in the L0 reference picture list have a POC less than the current picture POC, and at least one or more of the M reference pictures in the L1 reference picture list have a POC greater than the current picture POC (N > 0, M > 0).

[0419] [Condition 2-2] At least one or more of the N reference pictures in the L0 reference picture list have a POC greater than the current picture POC, and at least one or more of the M reference pictures in the L1 reference picture list have a POC less than the current picture POC (N > 0, M > 0).

[0420] When there are no reference pictures that satisfy [Condition 2-1], [Condition 2-2] can be executed. Conversely, when there are no reference pictures that satisfy [Condition 2-2] after executing [Condition 2-2], [Condition 2-1] can be executed.

[0421] [Condition 3] The POC difference between the L0 reference picture and the L1 reference picture with the smallest POC difference from the current picture POC satisfies the following Equation 2.

[0422] Equation 2

[0423] DiffPicOrderCnt(currPic, RefPicListO[refIdx0]) ==

[0424] DiffPicOrderCnt(RefPicList1[refIdx1], currPiC)

[0425] currPic is the POC of the current picture, RefPicList0[refIdx0] is the POC of the reference picture with the smallest POC difference from the current picture in the L0 reference picture list, and RefPicList1[refIdx1] is the POC of the reference picture with the smallest POC difference from the current picture in the L1 reference picture list.

[0426] When the condition is satisfied and the encoded / decoded "sym_mvd_flag" has a first value (0), the encoder / decoder can perform entropy encoding / decoding on the L0 and L1 reference picture index information and the L0 and L1 MVD (Motion Vector Difference) information.

[0427] When the condition is satisfied and the encoded / decoded "sym_mvd_flag" has a second value (1), the encoder / decoder may not perform entropy encoding / decoding, but instead derive the L0 and / or L1 reference picture index information and the MVD information in one direction (L0 or L1) as described below.

[0428] When the condition is satisfied, the encoder / decoder may not perform entropy encoding / decoding, but always derive the L0 and / or L1 reference picture index information and the one-way (L0 or L1) motion vector difference (MVD) information, regardless of the information indicating whether to perform entropy encoding / decoding (e.g., "sym_mvd_flag").

[0429] The L0 reference picture index can be derived from the position information of the reference picture with the smallest POC difference from the current picture in the L0 reference picture list.

[0430] For example, when the POC of the second reference picture in the L0 reference picture list has the smallest difference from the current picture POC, the encoder / decoder can derive the value "1" indicating the second reference picture in the L0 reference picture list as the L0 reference picture index.

[0431] The L1 reference picture index can be derived from the position information of the reference picture with the smallest POC difference from the current picture in the L1 reference picture list.

[0432] For example, when the second reference picture POC in the L0 reference picture list has the minimum difference from the current picture POC, the encoder / decoder may derive the value "1" indicating the second reference picture in the L0 reference picture list as the L0 reference picture index.

[0433] After configuring the reference picture list of the current picture or slice including the coding target block / decoding target block, the checks for conditions [2-1], [2-2], and [3] and the derivation process of the L0 / L1 reference picture index can be performed.

[0434] When entropy coding / decoding the motion vector difference (MVD0) in direction L0, the motion vector difference (MVD1) in direction L1 can be derived as -MVD0. In other words, the horizontal and vertical motion vector differences in direction L1 are as follows. (MVD1_x = -MVD0_x, MVD1_y = -MVD0_y)

[0435] When entropy coding / decoding the motion vector difference (MVD1) in direction L1, the motion vector difference (MVD0) in direction L0 can be derived as -MVD1. In other words, the horizontal and vertical motion vector differences in direction L0 are as follows. (MVD0_x = -MVD1_x, MVD0_y = -MVD1_y)

[0436] As another example, when the POC information between the current picture and the reference pictures in the reference picture list satisfies the following conditions, the encoder / decoder can perform entropy coding / decoding on the information (e.g., sym_mvd_flag) indicating whether to perform entropy coding / decoding on the L0 and / or L1 reference picture index information and the unidirectional (L0 or L1) motion vector difference (MVD) information of the current coding / target block for decoding the target block.

[0437] [Condition 1] The current coding target block / decoding target block is in the bi-prediction mode, and there are an L0 reference picture and an L1 reference picture.

[0438] [Condition 2] The POC differences among the current picture POC, the Nth reference picture POC in the L0 reference picture list, and the Mth reference picture POC in the L1 reference picture list satisfy the following Equation 3.

[0439] Equation 3

[0440] DiffPicOrderCnt(currPic,RefPicListO[N-1]) ==

[0441] DiffPicOrderCnt(RefPicList1[M-1],currPiC)

[0442] currPic is the POC of the current picture, RefPicList0[N - 1] is the POC of the Nth reference picture in the L0 reference picture list, and RefPicList1[M - 1] is the POC of the Mth reference picture in the L1 reference picture list.

[0443] Here, N and M can be natural numbers greater than 0 and can have the same value or different values.

[0444] For example, when N and M have the value "1", they can represent the POC of the first reference picture in the L0 / L1 reference picture list.

[0445] When the condition is satisfied and the encoded / decoded "sym_mvd_flag" has the first value (0), the encoder / decoder can perform entropy encoding / decoding on the L0 and L1 reference picture index information and the L0 and L1 MVD (Motion Vector Difference) information.

[0446] When the condition is satisfied and the encoded / decoded "sym_mvd_flag" has the second value (1), the encoder / decoder can, instead of performing entropy encoding / decoding, derive the L0 and / or L1 reference picture index information and MVD information in one direction (L0 or L1) as described below.

[0447] The L0 reference picture index can be derived as the value of "N - 1", thereby indicating the Nth reference picture in the L0 reference picture list.

[0448] For example, when N = 1, the L0 reference picture index can be derived as "0", thereby indicating the first reference picture in the L0 reference picture list.

[0449] The L1 reference picture index can be derived as the value of "M - 1", thereby indicating the Mth reference picture in the L1 reference picture list.

[0450] For example, when M = 1, the L1 reference picture index can be derived as "0", thereby indicating the first reference picture in the L1 reference picture list.

[0451] After configuring the reference picture list of the current picture or slice including the encoding / decoding target block, the check of condition [2] and the derivation process of the L0 / L1 reference picture index can be performed.

[0452] When performing entropy encoding / decoding on the motion vector difference (MVD0) in direction L0, the motion vector difference (MVD1) in direction L1 can be derived as -MVD0. In other words, the horizontal and vertical motion vector differences in direction L1 are as follows. (MVD1_x = -MVD0_x, MVD1_y = -MVD0_y)

[0453] When entropy encoding / decoding the motion vector difference (MVD1) in direction L1, the motion vector difference (MVD0) in direction L0 can be derived as -MVD1. In other words, the horizontal and vertical motion vector differences in direction L0 are as follows. (MVD0_x = -MVD1_x, MVD0_y = -MVD1_y)

[0454] Under the condition, the L0 and / or L1 reference picture index information and the unidirectional (L0 or L1) motion vector difference (MVD) information can always be derived without entropy encoding / decoding, regardless of the information indicating whether to perform entropy encoding / decoding (e.g., "sym_mvd_flag").

[0455] When the current picture is a B slice and the POC information in the current picture POC and the reference pictures in the reference picture list satisfies at least one or more of the above conditions, the encoder can perform entropy encoding on the information (e.g., smvd_enabled_flag) indicating the possibility of entropy decoding of the "L0 and / or L1 reference picture index information and the unidirectional (L0 or L1) motion vector difference (MVD) information" indicating all the coding target blocks in the current slice, and send the information to the decoder at levels such as the sequence parameter set (SPS), picture parameter set (PPS), adaptive parameter set (APS), picture header, parallel block group header, slice header, and CTU.

[0456] The decoder can perform entropy decoding on the corresponding information (e.g., smvd_enabled_flag) sent from the encoder, and can decode the "sym_mvd_flag" information of the current decoding target block based on the corresponding information. Here, the smvd_enabled_flag indicating that sym_mvd_flag can be sent can be signaled at levels such as the sequence parameter set (SPS), picture parameter set (PPS), adaptive parameter set (APS), picture header, parallel block group header, slice header, and CTU.

[0457] Accordingly, when the following conditions are met, the encoder / decoder can perform entropy encoding / decoding on the information (e.g., sym_mvd_flag) indicating whether to perform entropy encoding / decoding on the L0 and L1 reference picture index information (ref_idx_l0 and ref_idx_l1) and the unidirectional (L0 or L1) motion vector difference information (MvdL0 or MvdL1) of the current coding target block / decoding target block.

[0458] [Condition 1] The current coding target block / decoding target block is in the bi-predictive mode, and there are L0 reference picture and L1 reference picture.

[0459] [Condition 2-1] At least one or more of the N reference pictures in the L0 reference picture list have a POC less than the POC of the current picture, and at least one or more of the M reference pictures in the L1 reference picture list have a POC greater than the POC of the current picture (N and M can be natural numbers greater than 0, and can be equal to or different from each other).

[0460] [Condition 2-2] At least one or more of the N reference pictures in the L0 reference picture list have a POC greater than the POC of the current picture, and at least one or more of the M reference pictures in the L1 reference picture list have a POC less than the POC of the current picture (N and M can be natural numbers greater than 0, and can be equal to or different from each other).

[0461] [Condition 3] smvd_enabled_flag has a value indicating that sym_mvd_flag can be sent (for example, smvd_enabled_flag is "1")

[0462] When there are no reference pictures that satisfy [Condition 2-1], [Condition 2-2] can be executed. Conversely, when there are no reference pictures that satisfy [Condition 2-2] after executing [Condition 2-2], [Condition 2-1] can be executed.

[0463] For example, only when "tile_group_smvd_enabled_flag" sent from the parallel tile group header has a second value (1) and the decoding target block is in the bi-predictive mode, the encoder / decoder can decode the "sym_mvd_flag" information. When "sym_mvd_flag" has the second value (1), the encoder / decoder can derive the L0 and / or L1 reference picture index information and the uni-directional motion vector difference (MVD) information of the corresponding block by using at least one or more of the above methods.

[0464] For example, when "tile_group_smvd_enabled_flag" sent from the parallel tile group header has a first value (0), the encoder / decoder can infer the corresponding information as the first value (0) instead of decoding the "sym_mvd_flag" information for all decoding target blocks, and thus perform entropy decoding on the "L0 and L1 reference picture index information and L0 motion vector difference / L1 motion vector difference" information.

[0465] The first value and the second value are not limited to the above examples. The present invention may include a case where the same definitions as in the above embodiments are applied when the first value is 1 and the second value is 0.

[0466] When the current picture is a B slice and the POC information in the current picture POC and the reference picture POC information in the reference picture list satisfy at least one or more of the above conditions, the encoder may perform entropy encoding on information (e.g., "tile_group_smvd_enabled_flag") indicating the possibility of entropy decoding of "L0 and / or L1 reference picture index information and unidirectional (L0 or L1) motion vector difference (MVD) information" of all coded target blocks in the current slice at at least one level among the sequence parameter set (SPS), picture parameter set (PPS), adaptive parameter set (APS), picture header, parallel block group header, slice header, CTU, and CU, and may send the information to the decoder.

[0467] The decoder may perform entropy decoding on the corresponding information (e.g., "tile_group_smvd_enabled_flag") sent from the encoder, and may decode the "sym_mvd_flag" information of the current decoding target block based on the corresponding information.

[0468] In addition, when at least one or more of the above POC conditions are satisfied, the encoder may perform entropy encoding on the position information of the L0 and / or L1 reference pictures at at least one level among the picture header, parallel block group header, slice header, and CTU, and send the information to the decoder.

[0469] For example, as Figure 13 shown, when the "tile_group_smvd_enabled_flag" entropy decoded in the parallel block group header has a second value ("1"), the decoder may perform entropy decoding on the reference picture index information (e.g., smvd_ref_idx0, smvd_ref_idx1) generally applicable to all target blocks included in the parallel block group. When the "sym_mvd_flag" information entropy decoded in the decoding target block has a second value ("1"), the decoder may derive the reference picture of the corresponding block from the reference picture index information (e.g., smvd_ref_idx0 or smvd_ref_idx1) entropy decoded in the parallel block group header. Figure 13 The parallel block group in

[0470] may represent a slice. The first value and the second value are not limited to the above examples. The present invention may include a case where the same definitions as in the above embodiments are applied when the first value is 1 and the second value is 0.

[0471] When the current picture is a B slice and the POC information in the current picture POC and the POC information in the reference pictures in the reference picture list meet at least one or more of the above conditions, the encoder can perform entropy coding on information (e.g., 'tile_group_smvd_enabled_flag') indicating the possibility of entropy decoding of information (e.g., "sym_mvd_flag") indicating whether to send "L0 and / or L1 reference picture index information and unidirectional (L0 or L1) motion vector difference (MVD) information" for all coding target blocks in the current tile group at least at one level of the sequence parameter set (SPS), picture parameter set (PPS), adaptive parameter set (APS), picture header, parallel block group header, slice header, CTU, and CU, and can send the information to the decoder.

[0472] The decoder can decode the "sym_mvd_flag" information of the current decoding target block based on the corresponding information (e.g., 'tile_group_smvd_enabled_flag') sent from the encoder.

[0473] In addition, when at least one or more of the above POC conditions are met, the encoder can perform entropy coding on the position information of the L0 and / or L1 reference pictures at least at one level of the parallel block group header, slice header, and CTU, and send the information to the decoder.

[0474] For example, as Figure 14 shown, when the "tile_group_smvd_enabled_flag" entropy decoded in the parallel block group header has a second value ("1"), the decoder can perform entropy decoding on information (e.g., "default_smvd_refIdx_flag") indicating whether to use the default reference picture index information generally applicable to all target blocks included in the parallel block group. In addition, when the "default_smvd_refIdx_flag" has a second value ("1"), the decoder can apply the reference picture index of the L0 / L1 reference picture in a predetermined position defined by the encoder / decoder to all target blocks. Figure 14 The parallel block group in

[0475] For example, the reference picture index indicating a predetermined position defined in the encoder / decoder may be "0" indicating the first reference picture in the L0 reference picture list and the L1 reference picture list. When the corresponding flag ("default_smvd_refIdx_flag") has a first value (0), the reference picture index information (e.g., smvd_ref_idx0 and / or smvd_ref_idx1) that is normally applicable to all target blocks in the parallel block group may be additionally entropy decoded. When the "sym_mvd_flag" information entropy decoded in the target block to be decoded has a second value ("1"), the reference picture of the corresponding block may be derived from the reference picture index (e.g., smvd_ref_idx0 and / or smvd_ref_idx1) entropy decoded in the parallel block group header.

[0476] Figure 15 The sps_smvd_enable_flag of is information sent at the sequence level. This may be information indicating whether to use the symmetric MVD mode, where the symmetric MVD mode is derived without entropy decoding the unidirectional motion vector difference information and the bidirectional reference picture index information of the coding target block / decoding target block.

[0477] Figure 16 The mvd_l1_zero_flag of may be information indicating that the motion vector difference value in the L1 direction is not decoded but is derived as (0,0). When the mvd_l1_zero_flag has a first value (1), it may indicate that the motion vector difference value in the L1 direction is not decoded but is derived as (0,0). When the mvd_l1_zero_flag has a second value (0), it may indicate that the motion vector difference value in the L1 direction is not derived as (0,0).

[0478] Accordingly, when the following conditions are met, the encoder / decoder may entropy encode / entropy decode the information (e.g., sym_mvd_flag) indicating whether to perform entropy encoding / entropy decoding on the L0 and L1 reference picture index information (ref_idx_l0 and ref_idx_l1) and the unidirectional (L0 or L1) motion vector difference information (MvdL0 or MvdL1) of the current coding target block / decoding target block.

[0479] [Condition 1] The current coding target block / decoding target block is in the bi-predictive mode, and there are L0 reference pictures and L1 reference pictures.

[0480] [Condition 2-1] At least one or more reference picture POCs among the N reference pictures in the L0 reference picture list are less than the current picture POC, and at least one or more reference picture POCs among the M reference pictures in the L1 reference picture list are greater than the current picture POC (N and M can be natural numbers greater than 0, and can be equal to or different from each other).

[0481] [Condition 2-2] At least one or more reference picture POCs among the N reference pictures in the L0 reference picture list are greater than the current picture POC, and at least one or more reference picture POCs among the M reference pictures in the L1 reference picture list are less than the current picture POC (N and M can be natural numbers greater than 0, and can be equal to or different from each other).

[0482] [Condition 3] sps_smvd_enabled_flag has a value indicating that sym_mvd_flag can be sent (for example, sps_smvd_enabled_flag is "1").

[0483] [Condition 4] mvd_l1_zero_flag has a value indicating that the motion vector difference in the L1 direction is not derived as (0,0) (for example, mvd_l1_zero_flag is "0").

[0484] When there is no reference picture that satisfies [Condition 2-1], [Condition 2-2] can be executed. Conversely, when there is no reference picture that satisfies [Condition 2-2] after executing [Condition 2-2], [Condition 2-1] can be executed.

[0485] In addition, when the "mvd_l1_zero_flag" information has a second value (1), at least one or more of the above "tile_group_smvd_enabled_flag", "default_smvd_refIdx_flag", "smvd_ref_idx0", "smvd_ref_idx1", and "sym_mvd_flag" may not be entropy-coded / entropy-decoded. In addition, although "mvd_l1_zero_flag" is described as being encoded / decoded in the parallel block group header, it can be encoded / decoded at least at one level of the sequence parameter set (SPS), picture parameter set (PPS), adaptive parameter set (APS), picture header, slice header, CTU, and CU.

[0486] Figures 16 to 18 are other embodiments of the symmetric MVD mode.

[0487] In Figure 16In it, only when each reference picture list has at least one or more reference pictures, can "sym_mvd_ref_idx[i]" entropy decoded in the parallel block group header be signaled.

[0488] For example, when there is one reference picture in the L0 reference picture list and two or more reference pictures in the L1 reference picture list, "sym_mvd_ref_idx[1]" can be entropy decoded only for the L1 direction, and "sym_mvd_ref_idx[0]" can be inferred as 0 for the L0 direction.

[0489] For another example, only one "sym_mvd_ref_idx" applied to both the L0 / L1 reference picture lists can be entropy decoded.

[0490] For example, when the "tile_group_smvd_enabled_flag" has a second value (1), the decoder can entropy decode only one "sym_mvd_ref_idx" and use the L0 and L1 reference pictures indicated by the corresponding values.

[0491] When the decoder needs to generate a bitstream that satisfies Figure 17 at least one or more of [Condition A], [Condition B], and [Condition C] described in

[0492] [Condition A]

[0493] The POC difference between the current picture and the reference picture indicated by "sym_mvd_ref_idx[0]" and the POC difference between the current picture and the reference picture indicated by "sym_mvd_ref_idx[1]" should have different codings. The POC difference between the current picture and the reference picture indicated by "sym_mvd_ref_idx[0]" in the L0 reference picture list should be the smallest, and the POC difference between the current picture and the reference picture indicated by "sym_mvd_ref_idx[1]" in the L1 reference picture list should be the smallest.

[0494] [Condition B]

[0495] The POC difference between the current picture and the reference picture indicated by "sym_mvd_ref_idx[0]" and the POC difference between the current picture and the reference picture indicated by "sym_mvd_ref_idx[1]" should have different codings.

[0496] [Condition C]

[0497] The POC difference between the current picture and the reference picture indicated by "sym_mvd_ref_idx[0]" and the POC difference between the current picture and the reference picture indicated by "sym_mvd_ref_idx[1]" shall be equal to each other, and the reference picture indicated by "sym_mvd_ref_idx[0]" and the reference picture indicated by "sym_mvd_ref_idx[1]" shall be in directions opposite to the current picture.

[0498] In addition, Figure 16 and Figure 17 the parallel block groups in may represent stripes.

[0499] Figure 19 is a diagram for explaining an image decoding method according to an embodiment of the present invention.

[0500] The decoder may obtain symmetric motion vector difference mode availability information from the bitstream (S1901).

[0501] Here, the symmetric motion vector difference mode availability information may be the sps_smvd_enable flag obtained at the sequence level. Since the sps_smvd_enable flag has been described above, the detailed description of the sps_smvd_enable flag is omitted here.

[0502] In addition, the decoder may obtain zero motion vector difference information for the first prediction direction from the bitstream based on the symmetric motion vector difference mode availability information (S1902). Specifically, the zero motion vector difference information for the first prediction direction may indicate that the motion vector difference value for the first prediction direction is not decoded but is derived as (0,0).

[0503] Here, the zero motion vector difference information for the first prediction direction may be the mvd_l1_zero_flag obtained at the picture level. Since the mvd_l1_zero_flag has been described above, the detailed description of the mvd_l1_zero_flag is omitted here.

[0504] In addition, the decoder may obtain symmetric motion vector difference mode information for the current block from the bitstream based on the symmetric motion vector difference mode availability information and the zero motion vector difference information for the first prediction direction (S1903).

[0505] Here, the motion vector difference mode information may be the above-mentioned sym_mvd_flag.

[0506] In addition, the decoder may obtain reference picture index information for a first prediction direction, reference picture index information for a second prediction direction, and a motion vector difference for the first prediction direction based on the symmetric motion vector difference mode information (S1904). Specifically, when the symmetric motion vector difference mode information of the current block indicates the symmetric motion vector difference mode, the decoder may obtain the reference picture index information for the first prediction direction, the reference picture index information for the second prediction direction, and the motion vector difference for the first prediction direction by derivation from the bitstream rather than decoding the bitstream.

[0507] When the symmetric motion vector difference mode information of the current block indicates the symmetric motion vector difference mode, the motion vector difference for the first prediction direction may be derived based on the motion vector difference for the second prediction direction of the current block.

[0508] When the symmetric motion vector difference mode information of the current block indicates the symmetric motion vector difference mode, the reference picture index information for the first prediction direction may be derived as the index of the backward reference picture closest to the current picture in the reference picture list for the first prediction direction, and the reference picture index information for the second prediction direction may be derived as the index of the forward reference picture closest to the current picture in the reference picture list for the second prediction direction.

[0509] When the symmetric motion vector difference mode information of the current block indicates the symmetric motion vector difference mode, the reference picture index information for the first prediction direction may be derived as the index of the forward reference picture closest to the current picture in the reference picture list for the first prediction direction, and the reference picture index information for the second prediction direction may be derived as the index of the backward reference picture closest to the current picture in the reference picture list for the second prediction direction.

[0510] In addition, when the symmetric motion vector difference mode information of the current block indicates the symmetric motion vector difference mode, the reference picture index information for the first prediction direction and the reference picture index information for the second prediction direction may be derived as the indices of short-term reference pictures.

[0511] In addition, the decoder may generate a predicted block for the current block by using at least one of the reference picture index information for the first prediction direction, the reference picture index information for the second prediction direction, and the motion vector difference for the first prediction direction (S1905).

[0512] Here, the first prediction direction may be the L1 prediction direction, and the second prediction direction may be the L0 prediction direction.

[0513] Figure 20 is a diagram for explaining an image encoding method according to an embodiment of the present invention.

[0514] The encoder may determine symmetric motion vector difference mode availability information (S2001).

[0515] Here, the symmetric motion vector difference mode availability information may be the sps_smvd_enable flag encoded at the sequence level. Since the sps_smvd_enable flag has been described above, the detailed implementation here omits the description of the sps_smvd_enable flag.

[0516] In addition, the encoder may determine the zero motion vector difference information of the first prediction direction (S2002). Specifically, the zero motion vector difference information of the first prediction direction may indicate that the motion vector difference value of the first prediction direction is not encoded but is derived as (0, 0).

[0517] Here, the zero motion vector difference information of the first prediction direction may be the mvd_l1_zero_flag encoded at the picture level. Since the mvd_l1_zero_flag has been described above, the detailed implementation here omits the description of the mvd_l1_zero_flag.

[0518] In addition, the encoder may encode the symmetric motion vector difference mode information of the current block based on the symmetric motion vector difference mode availability information and the zero motion vector difference information of the first prediction direction (S2003). Here, the motion vector difference mode information may be the above-mentioned sym_mvd_flag.

[0519] In addition, the encoder may determine whether to encode the reference picture index information of the first prediction direction, the reference picture index information of the second prediction direction, and the motion vector difference value of the first prediction direction based on the symmetric motion vector difference mode information (S2004). Specifically, when the symmetric motion vector difference mode information of the current block indicates the symmetric motion vector difference mode, the encoder may determine that the reference picture index information of the first prediction direction, the reference picture index information of the second prediction direction, and the motion vector difference value of the first prediction direction are not encoded.

[0520] When the symmetric motion vector difference mode information of the current block indicates the symmetric motion vector difference mode, the motion vector difference value of the first prediction direction may be derived based on the motion vector difference value of the second prediction direction of the current block.

[0521] When the symmetric motion vector difference mode information of the current block indicates the symmetric motion vector difference mode, the reference picture index information of the first prediction direction may be derived as the index of the backward reference picture closest to the current picture in the reference picture list of the first prediction direction, and the reference picture index information of the second prediction direction may be derived as the index of the forward reference picture closest to the current picture in the reference picture list of the second prediction direction.

[0522] When the symmetric motion vector difference mode information of the current block indicates the symmetric motion vector difference mode, the reference picture index information in the first prediction direction can be derived as the index of the forward reference picture closest to the current picture in the reference picture list in the first prediction direction, and the reference picture index information in the second prediction direction can be derived as the index of the backward reference picture closest to the current picture in the reference picture list in the second prediction direction.

[0523] In addition, when the symmetric motion vector difference mode information of the current block indicates the symmetric motion vector difference mode, the reference picture index information in the first prediction direction and the reference picture index information in the second prediction direction can be derived as the indexes of short-term reference pictures.

[0524] Here, the first prediction direction may be the L1 prediction direction, and the second prediction direction may be the L0 prediction direction.

[0525] By Figure 20 The bitstream generated by the image coding method described in

[0526] When entropy coding / entropy decoding at least one or more pieces of information regarding motion compensation, at least one or more of the following binarization methods may be used.

[0527] Truncated Rice binarization method

[0528] k-th order Exp_Golomb binarization method

[0529] Limited k-th order Exp_Golomb binarization method

[0530] Fixed-length binarization method

[0531] Unary binarization method

[0532] Truncated unary binarization method

[0533] When entropy coding / entropy decoding at least one or more pieces of information regarding motion compensation, the encoder / decoder may determine the context model by using at least one or more pieces of information regarding motion compensation of neighboring blocks, at least one or more pieces of information regarding previously encoded / decoded motion information, information regarding the depth of the current unit / block, or information regarding the size of the current unit / block.

[0534] The encoder / decoder may entropy code / entropy decode at least one or more pieces of information regarding motion compensation by using at least one or more pieces of information regarding motion compensation of neighboring blocks, at least one or more pieces of information regarding previously encoded / decoded motion information, information regarding the depth of the current unit / block, or information regarding the size of the current unit / block as prediction values of the information regarding motion compensation of the current block.

[0535] As described in the embodiments of the present invention, the reference picture set for reference picture list construction and reference picture list modification may use at least one or more reference picture lists among L0, L1, L2, and L3.

[0536] When calculating the boundary strength in the deblocking filter according to the embodiments of the present invention, 1 to N motion vectors of the coding target block / decoding target block may be used. Here, N represents a positive integer of 1 or greater, and may be 2, 3, 4, etc.

[0537] When the motion vector for motion vector prediction has at least one or more of 16-pel unit, 8-pel unit, 4-pel unit, integer-pel unit, 1 / 2-pel unit, 1 / 4-pel unit, 1 / 8-pel unit, 1 / 16-pel unit, 1 / 32-pel unit, and 1 / 64-pel unit, the embodiments of the present invention may also be applied. Additionally, when performing motion vector prediction, the motion vector may be selectively used for each pixel unit.

[0538] The slice types to which the embodiments of the present invention are applied may be defined, and the embodiments of the present invention may be applied according to the corresponding slice types.

[0539] For example, when the slice type is a T (triple prediction) slice, at least three or more motion vectors may be used to generate prediction blocks, and the weighted sum of at least three or more prediction blocks may be calculated and used as the final prediction block of the coding target block / decoding target block. For example, when the slice type is a Q (quadruple prediction) slice, at least four or more motion vectors may be used to generate prediction blocks, and the weighted sum of at least four or more prediction blocks may be calculated and used as the final prediction block of the coding target block / decoding target block.

[0540] The above embodiments of the present invention may be applied not only to the inter prediction and motion compensation methods using motion vector prediction, but also to the inter prediction and motion compensation methods using skip mode and merge mode.

[0541] The above embodiments may be executed in the same manner in the encoder and decoder.

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

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

[0544] The above embodiments may be performed for each luminance signal and chrominance signal, or the above embodiments may be performed identically for the luminance and chrominance signals.

[0545] The block form applying the above embodiments of the present invention may have a square form or a non-square form.

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

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

[0548] The above embodiments of the present invention may be applied according to a temporal layer. To identify the temporal layer to which the above embodiments can be applied, a corresponding identifier may be signaled, and the above embodiments may be applied to the specified temporal layer identified by the corresponding identifier. Here, the identifier may be defined as the lowest layer or the highest layer or both the lowest layer and the highest layer to which the above embodiments can be applied, or may be defined as a specific layer indicating the application of the embodiments. Additionally, a fixed temporal layer for applying the embodiments may be defined.

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

[0550] The stripe type or parallel block group type of the above embodiments of the present invention can be defined, and the above embodiments can be applied according to the corresponding stripe type or parallel block group type.

[0551] In the above embodiments, the method is described based on a flowchart having a series of steps or units. However, the present invention is not limited to the order of the steps, but rather some steps can be executed simultaneously with other steps or in a different order. Additionally, those of ordinary skill in the art should understand that the steps in the flowchart are not mutually exclusive, and other steps can be added to the flowchart or some steps can be deleted from the flowchart without affecting the scope of the present invention.

[0552] The embodiments include various aspects of the examples. It is not necessary to describe all possible combinations for each aspect, but those skilled in the art will be able to recognize different combinations. Therefore, the present invention can include all substitutions, modifications, and changes within the scope of the claims.

[0553] The embodiments of the present invention can be implemented in the form of program instructions executable by various computer components and recorded on a computer-readable recording medium. The computer-readable recording medium can include independent program instructions, data files, data structures, etc., or combinations of program instructions, data files, data structures, etc. The program instructions recorded on the computer-readable recording medium can be specifically designed and constructed for the present invention or well-known to those of ordinary skill in the computer software art. 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); magneto-optical media (such as optical floppy disks); and hardware devices specifically configured to store and implement program instructions (such as read-only memories (ROMs), random access memories (RAMs), flash memories, etc.). Examples of program instructions include not only machine language codes formatted by compilers but also high-level language codes that can be implemented by a computer using interpreters. The hardware device can be configured to be operated by one or more software modules to perform the processing according to the present invention, or vice versa.

[0554] Although the present invention has been described based on specific items such as detailed elements, limited embodiments, and drawings, they are only provided to help more comprehensively understand the present invention, and the present invention is not limited to the above embodiments. Those skilled in the art to which the present invention pertains should understand that various modifications and changes can be made based on the above description.

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

[0556] Industrial Applicability

[0557] The present invention can be used for encoding or decoding an image.

Claims

1. An image decoding method, the method comprises: determining a prediction mode of a current block; in response to the prediction mode of the current block being an Intra Block Copy (IBC) mode, deriving a list of block vector candidates based on the size of the current block, wherein, in response to only the size of the current block being greater than a threshold, the list of block vector candidates includes block vectors of neighboring blocks of the current block as spatial block vector candidates.

2. The method according to claim 1, wherein, the threshold is 16.

3. The method according to claim 1, wherein, the list of block vector candidates includes history-based block vector candidates obtained from a history-based list of block vector candidates.

4. An image encoding method, the method comprises: determining a prediction mode of a current block; in response to the prediction mode of the current block being an Intra Block Copy (IBC) mode, deriving a list of block vector candidates based on the size of the current block, wherein, in response to only the size of the current block being greater than a threshold, the list of block vector candidates includes block vectors of neighboring blocks of the current block as spatial block vector candidates.

5. A method for sending a bitstream, comprises: determining a prediction mode of a current block; in response to the prediction mode of the current block being an Intra Block Copy (IBC) mode, deriving a list of block vector candidates based on the size of the current block to generate a bitstream; sending the bitstream, wherein, in response to only the size of the current block being greater than a threshold, the list of block vector candidates includes block vectors of neighboring blocks of the current block as spatial block vector candidates.