Image encoding / decoding method and recording medium storing bit stream

By clipping the format and dynamic range limitations of motion vectors, the problem of increased costs in high-resolution image data storage and transmission is solved, enabling more efficient image encoding and decoding while reducing storage and computational complexity.

CN119277097APending Publication Date: 2025-01-07INTELLECTUAL DISCOVERY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411589529.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2018-09-17
Filing Date
2019-09-17
Publication Date
2025-01-07

AI Technical Summary

Technical Problem

With the increasing demand for high-resolution and high-quality image data, existing technologies face the problem of increased costs when sending and storing high-resolution, high-quality image data, and efficient image encoding/decoding technologies are needed to reduce the amount of data.

Method used

By cropping the motion vector, the format of the motion vector is changed to a fixed bit format with increased bit depth, and the time motion vector is scaled and its dynamic range is limited, reducing the need for storing and retrieving data.

Benefits of technology

It improves the efficiency of image encoding/decoding, reduces memory space and memory access bandwidth requirements, and lowers the computational complexity of the encoder and decoder.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119277097A_ABST
    Figure CN119277097A_ABST
Patent Text Reader

Abstract

The present specification discloses an image encoding / decoding method and a recording medium storing a bitstream. An image decoding method of the present invention comprises the steps of: obtaining, from a temporal motion buffer, a motion vector of a corresponding position block included in a reference picture of a current block; changing the format of the obtained motion vector; and deriving a temporal motion vector of the current block from the motion vector whose format has been changed.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of a patent application with application date of September 17, 2019, application number 201980060927.5, and titled “Image encoding / decoding method and device and recording medium for storing bit stream”. Technical Field

[0002] The present invention relates to a method and apparatus for encoding / decoding an image and a recording medium for storing a bit stream. More particularly, the present invention relates to a method and apparatus for encoding / decoding an image using temporal motion information. Background Art

[0003] Recently, the demand for high-resolution and high-quality images such as high-definition (HD) images and ultra-high-definition (UHD) images is increasing in various application fields. As image data becomes high-resolution and high-quality, the amount of data increases relative to existing image data. Therefore, when image data is transmitted using a medium such as a wired / wireless broadband line or when image data is stored using a storage medium in the prior art, the transmission and storage costs increase. In order to solve these problems caused by image data becoming high-resolution and high-quality, efficient image encoding / decoding technology is required for images with higher resolution and quality.

[0004] As image compression techniques, there are various techniques such as an inter-frame prediction technique for predicting pixel values ​​included in a current picture from pictures before or after the current picture, an intra-frame prediction technique for predicting pixel values ​​included in the current picture by using pixel information in the current picture, a transform and quantization technique for compressing the energy of a residual signal, and an entropy coding technique for assigning a short code to a value with a high frequency of occurrence and assigning a long code to a value with a low frequency of occurrence. Such image compression techniques can be used to effectively compress image data and transmit or store the image data. Summary of the invention

[0005] Technical issues

[0006] An object of the present invention is to provide a method and apparatus for encoding / decoding an image with improved compression efficiency by using a clipped motion vector, and a recording medium storing a bit stream.

[0007] The object of the present invention is to provide a method for clipping motion vectors.

[0008] An object of the present invention is to provide a method for transmitting information about a motion vector.

[0009] The object of the present invention is to provide a method for storing and using temporal motion information.

[0010] Technical Solution

[0011] According to a method for decoding an image according to an embodiment of the present invention, the method may include: obtaining a motion vector of a co-located block included in a reference picture of a current block in a temporal motion buffer; changing the format of the obtained motion vector; and deriving the motion vector with the changed format as the temporal motion vector of the current block.

[0012] In the method for decoding an image according to the present invention, the step of changing the format of the obtained motion vector comprises: changing the format of the obtained motion vector to a format with an increased bit depth.

[0013] In the method for decoding an image according to the present invention, the step of changing the format of the obtained motion vector comprises: changing the format of the obtained motion vector into a predetermined format.

[0014] In the method for decoding an image according to the present invention, the format of the obtained motion vector is a floating point format.

[0015] In the method for decoding an image according to the present invention, the step of changing the format of the obtained motion vector comprises: changing the format of the obtained motion vector into a fixed bit format including a sign.

[0016] In the method for decoding an image according to the present invention, the method further includes: scaling the derived temporal motion vector; and limiting the dynamic range of the scaled temporal motion vector.

[0017] In the method for decoding an image according to the present invention, the step of limiting the dynamic range of the scaled temporal motion vector comprises: limiting the dynamic range of the scaled temporal motion vector to a fixed bit depth.

[0018] In the method for decoding an image according to the present invention, the fixed bit depth is 18 bits.

[0019] According to a method for encoding an image according to an embodiment of the present invention, the method may include: obtaining a motion vector of a co-located block included in a reference picture of a current block in a temporal motion buffer; changing the format of the obtained motion vector; and deriving the motion vector with the changed format as the temporal motion vector of the current block.

[0020] In the method for encoding an image according to the present invention, the step of changing the format of the obtained motion vector comprises: changing the format of the obtained motion vector to a format with an increased bit depth.

[0021] In the method for encoding an image according to the present invention, the step of changing the format of the obtained motion vector comprises: changing the format of the obtained motion vector into a predetermined format.

[0022] In the method for encoding an image according to the present invention, the format of the obtained motion vector is a floating point format.

[0023] In the method for encoding an image according to the present invention, the step of changing the format of the obtained motion vector comprises: changing the format of the obtained motion vector into a fixed bit format including a sign.

[0024] In the method for encoding an image according to the present invention, the method further includes: scaling the derived temporal motion vector; and limiting the dynamic range of the scaled temporal motion vector.

[0025] In the method for encoding an image according to the present invention, the step of limiting the dynamic range of the scaled temporal motion vector comprises: limiting the dynamic range of the scaled temporal motion vector to a fixed bit depth.

[0026] In the method for encoding an image according to the present invention, the fixed bit depth is 18 bits.

[0027] In a computer-readable non-transitory recording medium including a bit stream decoded by an image decoding device, wherein the bit stream includes index information indicating a co-located picture in a reference picture of a current block for deriving a temporal motion vector; the image decoding device obtains a co-located picture of a co-located block including the current block by using the index information; and the temporal motion vector is derived by changing the format of a motion vector of the co-located block.

[0028] Beneficial Effects

[0029] According to the present invention, the clipped motion vector may be used to encode / decode an image.

[0030] According to the present invention, the size of a memory space required to store a motion vector can be reduced.

[0031] According to the present invention, the memory access bandwidth required to retrieve data from the memory can be reduced.

[0032] According to the present invention, the size of a required memory space can be reduced by storing and using motion information of a specific reference picture.

[0033] According to the present invention, the encoding and decoding efficiency of images can be improved.

[0034] According to the present invention, the computational complexity of an encoder and a decoder of an image can be reduced. BRIEF DESCRIPTION OF THE DRAWINGS

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

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

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

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

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

[0040] Figure 6 is a diagram illustrating the process of transform and quantization.

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

[0042] Figure 8 is a diagram illustrating an embodiment of encoding / decoding a target picture and a reference picture.

[0043] Fig. 9 is a diagram showing a motion vector predictor index for a reference picture list.

[0044] Fig.10 is a diagram for describing information related to the spatial resolution of a motion vector.

[0045] Fig.11 is a diagram illustrating an example of limiting the dynamic range of a motion vector.

[0046] Figures 12 to 15 is a flow chart illustrating a method of storing a motion vector of a reference picture.

[0047] Fig.16 is a diagram showing an example of quantizing a motion vector.

[0048] Figures 17 to 20 is a diagram illustrating an example of obtaining motion information from a reference picture.

[0049] Fig.21 is a diagram showing information on the bit width of a temporal motion vector component.

[0050] Figure 22 to Figure 26 is a diagram showing information about the bit depth of a temporal motion vector.

[0051] Fig. 27 and Fig.28 is a diagram showing an example of defining the bit width and bit depth of a temporal motion vector at a codec level in a temporal motion vector derivation process.

[0052] Fig.29 is a diagram showing information on the difference in bit width of a temporal motion vector component.

[0053] Fig.30 is a diagram showing an example of defining the dynamic range of a temporal motion vector component at a codec level.

[0054] Figure 31 to Figure 33 is a diagram showing an example of defining the bit width of each component of a temporal motion vector at a codec level.

[0055] Fig.34 is a diagram showing an example of defining the bit width of the temporal motion vector Y component at the codec level.

[0056] Fig.35 is a flowchart illustrating a method of encoding an image using motion vector clipping according to an embodiment of the present invention.

[0057] Fig.36 is a flowchart illustrating a method of decoding an image using motion vector clipping according to an embodiment of the present invention.

[0058] Fig.37 is a diagram illustrating a motion information storage indicator.

[0059] Fig.38 is a diagram showing the same-position direction information and the same-position screen index.

[0060] Fig.39 is a diagram illustrating an example of storing an indicator using motion information.

[0061] Fig.40 is a flowchart illustrating a method of encoding / decoding an image according to an embodiment of the present invention.

[0062] Fig.41 and Fig.42 is a diagram showing information about whether a specific reference picture is used in a current picture and information about whether motion information of the specific reference picture is used in the current picture.

[0063] Fig.43 is a flowchart of an image decoding method according to an embodiment of the present invention. DETAILED DESCRIPTION

[0064] Various modifications may be made to the present invention, and there are various embodiments of the present invention, wherein examples of various embodiments of the present invention will now be provided with reference to the accompanying drawings and described in detail. However, the present invention is not limited thereto, although the exemplary embodiments may be interpreted as including all modifications, equivalents or substitutions within the technical concept and technical scope of the present invention. In various aspects, similar figure numerals refer to the same or similar functions. In the accompanying drawings, the shapes and sizes of the elements may be exaggerated for clarity. In the following detailed description of the present invention, reference is made to the accompanying drawings that illustrate specific embodiments of the present invention in a graphical manner. These embodiments are described in sufficient detail to enable those skilled in the art to implement the present disclosure. Although the various embodiments of the present disclosure are different, they are not necessarily mutually exclusive. For example, without departing from the spirit and scope of the present disclosure, the specific features, structures and characteristics described herein in conjunction with one embodiment may be implemented in other embodiments. In addition, it should be understood that the position or arrangement of each element within each disclosed embodiment may be modified without departing from the spirit and scope of the present disclosure. Therefore, the following detailed description should not be regarded as having a limiting meaning, and the scope of the present disclosure is limited only by the appended claims (when properly interpreted, together with the full range of equivalents claimed by the claims).

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

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

[0067] In addition, the components shown in the embodiments of the present invention are shown independently to represent the characteristic functions that are different from each other. Therefore, this does not mean that each component is composed of a separate hardware or software component unit. In other words, for convenience, each component includes each component in the listed components. Therefore, at least two components of each component can be combined to form a component, or a component can be divided into multiple components to perform each function. If it does not depart from the essence of the present invention, the embodiment in which each component is combined and the embodiment in which a component is divided are also included in the scope of the present invention.

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

[0069] In addition, some components may not be essential components for performing the basic functions of the present invention, but are selective components that only improve its performance. The present invention can be implemented by only including essential components for implementing the essence of the present invention without including components for improving performance. Structures that only include essential components without including selective components that only improve performance are also included in the scope of the present invention.

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

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

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

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

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

[0075] Hereinafter, the target block may be an encoding target block as an encoding target and / or a decoding target block as a decoding target. In addition, the target block may be a current block as a target of current encoding and / or decoding. For example, the terms "target block" and "current block" may be used as the same meaning and may be replaced with each other.

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

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

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

[0079] In an embodiment, each of the specific information, data, flags, indexes, elements, attributes, etc. may have a value. The value of the information, data, flags, indexes, elements, and attributes equal to "0" may represent a logical false or a first predefined value. In other words, the value "0", false, logical false, and the first predefined value may be replaced with each other. The value of the information, data, flags, indexes, elements, and attributes equal to "1" may represent a logical true or a second predefined value. In other words, the value "1", true, logical true, and the second predefined value may be replaced with each other.

[0080] When the variable i or j is used to represent a column, row, or index, 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, the column, row, index, etc. can be counted from 0 or 1.

[0081] Terminology Description

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

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

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

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

[0086] Unit: may refer to a coding and decoding unit. When encoding and decoding an image, a unit may be a region generated by partitioning a single image. In addition, when a single image is partitioned into sub-division units during encoding or decoding, a unit may represent a sub-division unit. That is, an image may be partitioned into a plurality of units. When encoding and decoding an image, a predetermined process for each unit may be performed. A single unit may be partitioned into sub-units having a size smaller than that of the unit. According to the function, a unit may represent a block, a macroblock, a coding tree unit, a coding tree block, a coding unit, a coding block, a prediction unit, a prediction block, a residual unit, a residual block, a transform unit, a transform block, and the like. In addition, in order to distinguish a unit from a block, a unit may include a luminance component block, a chrominance component block associated with the luminance component block, and a syntax element for each color component block. A unit may have various sizes and shapes, and specifically, the shape of a unit may be a two-dimensional geometric figure such as a square, a rectangle, a trapezoid, a triangle, a pentagon, and the like. Also, the unit information may include at least one of a unit type indicating a coding unit, a prediction unit, a transformation unit, etc., and a unit size, a unit depth, an order of encoding and decoding of the unit, and the like.

[0087] Coding tree unit: A single coding tree block configured with a luminance component Y and two coding tree blocks associated with chrominance components Cb and Cr. In addition, the coding tree unit may represent a syntax element including a block and each block. Each coding tree unit may be partitioned by using at least one of a quadtree partitioning method, a binary tree partitioning method, and a ternary tree partitioning method to configure a lower-level unit such as a coding unit, a prediction unit, a transform unit, etc. The coding tree unit may be used as a term for specifying a sample block that becomes a processing unit when encoding / decoding an image as an input image. Here, the quadtree may represent a quadtree.

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

[0089] Coding tree block: may be used as a term used to designate any one of a Y coding tree block, a Cb coding tree block, and a Cr coding tree block.

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

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

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

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

[0094] Parameter set: corresponds to header information among the configurations in the bitstream. At least one of a video parameter set, a sequence parameter set, a picture parameter set, and an adaptation parameter set may be included in the parameter set. In addition, the parameter set may include a slice header, a tile group header, and tile header information. The term "tile group" means a group of tiles and has the same meaning as a slice.

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

[0096] Symbol: At least one of a syntax element, a coding parameter, and a transform coefficient value that can represent a coding / decoding target unit. In addition, the symbol can represent an entropy coding target or an entropy decoding result.

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

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

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

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

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

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

[0103] Reference picture index: may refer to an index indicating a specific reference picture in a reference picture list.

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

[0105] Motion vector: It can be a two-dimensional vector used for inter-frame prediction or motion compensation. The motion vector can represent the offset between the encoding / decoding target block and the reference block. For example, (mvX, mvY) can represent a motion vector. Here, mvX can represent the horizontal component, and mvY can represent the vertical component.

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

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

[0108] Motion vector candidate list: may represent a list consisting of one or more motion vector candidates.

[0109] Motion vector candidate index: may represent an indicator indicating a motion vector candidate in a motion vector candidate list. Alternatively, it may be an index of a motion vector predictor.

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

[0111] Merge candidate list: may represent a list consisting of one or more merge candidates.

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

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

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

[0115] Scaling: may refer to the process of multiplying the level of quantization by a factor. Transform coefficients may be generated by scaling the level of quantization. Scaling may also be referred to as inverse quantization.

[0116] Quantization parameter: may indicate a value used when a transform coefficient is used to generate a quantized level during quantization. The quantization parameter may also indicate a value used when a transform coefficient is generated by scaling the quantized level during inverse quantization. The quantization parameter may be a value mapped to a quantization step size.

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

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

[0119] Transform coefficient: may refer to a coefficient value generated after performing a transform in an encoder. Transform coefficient may refer to a coefficient value generated after performing at least one of entropy decoding and inverse quantization in a decoder. A quantization level obtained by quantizing a transform coefficient or a residual signal or a quantized transform coefficient level may also fall within the meaning of a transform coefficient.

[0120] Quantization level: may represent a value generated by quantizing a transform coefficient or a residual signal in an encoder. Alternatively, the quantization level may represent a value that is a dequantization target subjected to dequantization in a decoder. Similarly, the quantized transform coefficient level as a result of transformation and quantization may also fall within the meaning of the quantization level.

[0121] Non-zero transform coefficient: may refer to a transform coefficient having a value other than zero, or a transform coefficient level or quantization level having a value other than zero.

[0122] Quantization matrix: may refer to a matrix used in a quantization process or an inverse quantization process performed to improve subjective image quality or objective image quality. The quantization matrix may also be referred to as a scaling list.

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

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

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

[0126] Statistical value: The statistical value for at least one of a variable, a coding parameter, a constant value, etc. having a calculable specific value can be one or more of the average value, summed value, weighted average value, weighted sum value, minimum value, maximum value, most frequently occurring value, median value, and interpolation value of the corresponding specific value.

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

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

[0129] Reference Figure 1 , the encoding device 100 may include a motion prediction unit 111, a motion compensation unit 112, an intra-frame prediction unit 120, a switch 115, a subtractor 125, a transform unit 130, a quantization unit 140, an entropy encoding unit 150, an inverse quantization unit 160, an inverse transform unit 170, an adder 175, a filter unit 180 and a reference picture buffer 190.

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

[0131] When the prediction mode is the intra mode, the intra prediction unit 120 may use samples of a block that has been encoded / decoded and is adjacent to the current block as reference samples. The intra prediction unit 120 may perform spatial prediction on the current block by using the reference samples, or may generate prediction samples of the input block by performing spatial prediction. Here, intra prediction may refer to prediction within a frame.

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

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

[0134] When the value of the motion vector is not an integer, the motion prediction unit 111 and the motion compensation unit 112 may generate a prediction block by applying an interpolation filter to a partial area of ​​a reference picture. In order to perform inter-picture prediction or motion compensation on a coding unit, it may be determined which mode among the skip mode, merge mode, advanced motion vector prediction (AMVP) mode, and current picture reference mode is used for motion prediction and motion compensation of a prediction unit included in the corresponding coding unit. Then, inter-picture prediction or motion compensation may be performed differently according to the determined mode.

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

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

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

[0138] The quantization unit 140 may generate a quantization level by quantizing the transform coefficient or the residual signal according to the parameter and output the generated quantization level. Here, the quantization unit 140 may quantize the transform coefficient by using a quantization matrix.

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

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

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

[0142] The coding parameters may include information such as syntax elements (flags, indexes, etc.) that are encoded in the encoder and sent to the decoder by signaling, as well as information derived when performing encoding or decoding. The coding parameters may represent information required when encoding or decoding an image. For example, at least one value or combination of the following items may be included in the coding parameters: unit / block size, unit / block depth, unit / block partition information, unit / block shape, unit / block partition structure, whether to perform quadtree partitioning, whether to perform binary tree partitioning, binary tree partition direction (horizontal or vertical), binary tree partition form (symmetric partitioning or asymmetric partitioning), whether the current coding unit is partitioned by ternary tree partitioning, the direction of ternary tree partitioning (horizontal or vertical), the type of ternary tree partitioning (symmetric type or asymmetric type), whether the current coding unit is partitioned by multi-type tree partitioning, the direction of multi-type tree partitioning direction (horizontal or vertical), type of multi-type tree partition (symmetric type or asymmetric type), tree (binary tree or ternary tree) structure of multi-type tree partition, prediction mode (intra-frame prediction or inter-frame prediction), luminance intra-frame prediction mode / direction, chrominance intra-frame prediction mode / direction, intra-frame partition information, inter-frame partition information, coding block partition flag, prediction block partition flag, transform block partition flag, reference sample point filtering method, reference sample point filter tap, reference sample point filter coefficient, prediction block filtering method, prediction block filter tap, prediction block filter coefficient, prediction block boundary filtering method, prediction block boundary filter tap, prediction block boundary filter coefficient, intra-frame prediction mode, Inter prediction mode, motion information, motion vector, motion vector difference, reference picture index, inter prediction angle, inter prediction indicator, prediction list utilization flag, reference picture list, reference picture, motion vector predictor index, motion vector predictor candidate, motion vector candidate list, whether to use merge mode, merge index, merge candidate, merge candidate list, whether to use skip mode, interpolation filter type, interpolation filter tap, interpolation filter coefficient, motion vector size, representation accuracy of motion vector, transform type, transform size, information on whether the first (first) transform is used, information on whether the second transform is used, first transform index, second transform index , information on whether a residual signal exists, coding block pattern, coding block flag (CBF), quantization parameter, quantization parameter residual, quantization matrix, whether to apply an intra-frame loop filter, intra-frame loop filter coefficients, intra-frame loop filter taps, intra-frame loop filter shape / form, whether to apply a deblocking filter, deblocking filter coefficients, deblocking filter taps, deblocking filter strength, deblocking filter shape / form, whether to apply adaptive sample offset, adaptive sample offset value, adaptive sample offset category, adaptive sample offset type, whether to apply an adaptive loop filter, adaptive loop filter coefficients, adaptive loop filter taps, adaptive loop filter shape / form,Binarization / debinarization method, context model determination method, context model update method, whether to execute normal mode, whether to execute bypass mode, context binary bit, bypass binary bit, valid coefficient flag, last valid coefficient flag, encoding flag for unit of coefficient group, position of last valid coefficient, flag on whether the value of coefficient is greater than 1, flag on whether the value of coefficient is greater than 2, flag on whether the value of coefficient is greater than 3, information on remaining coefficient values, sign information, reconstructed luminance sample, reconstructed chrominance sample, residual luminance sample, residual chrominance sample, luminance transform coefficient, chrominance transform coefficient, quantized luminance level, quantized chrominance level, transform coefficient level scanning method, motion vector search area at decoder side domain size, shape of a motion vector search area at a decoder side, number of motion vector searches at a decoder side, information on a CTU size, information on a minimum block size, information on a maximum block size, information on a maximum block depth, information on a minimum block depth, image display / output order, slice identification information, slice type, slice partition information, tile identification information, tile type, tile partition information, tile group identification information, tile group type, tile group partition information, picture type, bit depth of input samples, bit depth of reconstructed samples, bit depth of residual samples, bit depth of transform coefficients, bit depth of quantization levels, and information on a luminance signal or information on a chrominance signal.

[0143] Here, signaling a flag or an index may mean entropy encoding the corresponding flag or index by an encoder and including it in a bitstream, and may mean entropy decoding the corresponding flag or index from the bitstream by a decoder.

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

[0145] The quantized level may be dequantized in the dequantization unit 160 or may be inversely transformed in the inverse transform unit 170. The dequantized or inversely transformed coefficient or the dequantized and inversely transformed coefficient may be added to the prediction block by the adder 175. By adding the dequantized or inversely transformed coefficient or the dequantized and inversely transformed coefficient to the prediction block, a reconstructed block may be generated. Here, the dequantized or inversely transformed coefficient or the dequantized and inversely transformed coefficient may mean a coefficient on which at least one of dequantization and inverse transformation is performed, and may mean a reconstructed residual block.

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

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

[0148] In order to compensate for the coding error, a suitable offset value may be added to the sample value by using sample adaptive offset. Sample adaptive offset can correct the offset of the deblocked image from the original image in units of samples. A method of applying the offset in consideration of edge information about each sample may be used, or a method of partitioning the samples of the image into a predetermined number of regions, determining the region to which the offset is applied, and applying the offset to the determined region may be used.

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

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

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

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

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

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

[0155] When the prediction mode used in decoding is the intra mode, the switch may be switched to the intra mode. Alternatively, when the prediction mode used in decoding is the inter mode, the switch may be switched to the inter mode.

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

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

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

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

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

[0161] When the inter mode is used, the motion compensation unit 250 may generate a prediction block by performing motion compensation on the current block, wherein the motion compensation uses a motion vector and a reference image stored in the reference picture buffer 270 .

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

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

[0164] In order to effectively partition an image, a coding unit (CU) may be used when encoding and decoding. A coding unit may be used as a basic unit when encoding / decoding an image. In addition, a coding unit may be used as a unit for distinguishing an intra prediction mode from an inter prediction mode when encoding / decoding an image. A coding unit may be a basic unit for prediction, transformation, quantization, inverse transformation, inverse quantization, or encoding / decoding processing of a transform coefficient.

[0165] Reference Figure 3 , the image 300 is partitioned sequentially according to the maximum coding unit (LCU), and the LCU unit is determined as a partition structure. Here, the LCU may be used in the same meaning as the coding tree unit (CTU). Unit partitioning may mean partitioning a block associated with the unit. In the block partition information, information about the unit depth may be included. The depth information may indicate the number or degree of the unit being partitioned or both the number and degree of the unit being partitioned. A single unit may be partitioned into a plurality of lower-level units hierarchically associated with the depth information based on a tree structure. In other words, the unit and the lower-level units generated by partitioning the unit may correspond to a node and a child node of the node, respectively. Each of the partitioned lower-level units may have depth information. The depth information may be information indicating the size of a CU and may be stored in each CU. The unit depth indicates the number and / or degree associated with partitioning the unit. Therefore, the partition information of the lower-level unit may include information about the size of the lower-level unit.

[0166] The partition structure may represent the distribution of coding units (CUs) within the LCU 310. Such distribution may be determined according to whether a single CU is partitioned into multiple (including 2, 4, 8, 16, etc., positive integers equal to or greater than 2) CUs. The horizontal size and vertical size of the CU generated by partitioning may be half of the horizontal size and vertical size of the CU before partitioning, respectively, or may have a size smaller than the horizontal size and vertical size before partitioning, respectively, according to the number of partitions. The CU may be recursively partitioned into multiple CUs. By recursive partitioning, at least one of the height and width of the CU after partitioning may be reduced compared to at least one of the height and width of the CU before partitioning. The partitioning of the CU may be recursively performed until a predefined depth or a predefined size. For example, the depth of the LCU may be 0, and the depth of the minimum coding unit (SCU) may be a predefined maximum depth. Here, as described above, the LCU may be a coding unit having a maximum coding unit size, and the SCU may be a coding unit having a minimum coding unit size. Partitioning starts from the LCU 310, and when the horizontal size or the vertical size or both the horizontal size and the vertical size of the CU are reduced by partitioning, the CU depth increases by 1. For example, for each depth, the size of the non-partitioned CU may be 2N×2N. In addition, in the case of a partitioned CU, a CU of size 2N×2N may be partitioned into four CUs of size N×N. As the depth increases by 1, the size of N may be halved.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[0203] Intra-frame encoding and / or decoding may be performed by using reference samples of neighboring blocks of the current block. The neighboring blocks may be reconstructed neighboring blocks. For example, intra-frame encoding and / or decoding may be performed by using encoding parameters or values ​​of reference samples included in the reconstructed neighboring blocks.

[0204] The prediction block may represent a block generated by performing intra prediction. The prediction block may correspond to at least one of a CU, a PU, and a TU. The unit of the prediction block may have a size of one of a CU, a PU, and a TU. The prediction block may be a square block of a size of 2×2, 4×4, 16×16, 32×32, or 64×64, etc., or may be a rectangular block of a size of 2×8, 4×8, 2×16, 4×16, and 8×16, etc.

[0205] Intra-prediction may be performed according to an intra-prediction mode for the current block. The number of intra-prediction modes that the current block may have may be a fixed value, and may be a value determined differently according to properties of the prediction block. For example, the properties of the prediction block may include the size of the prediction block, the shape of the prediction block, and the like.

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

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

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

[0209] like Figure 7 As shown, at least one of reference sample line 0 to reference sample line 3 can be used for intra prediction of the current block. Figure 7 In the example, the samples of fragment A and fragment F may be filled with the samples of the closest fragment B and fragment E, respectively, instead of being retrieved from the reconstructed neighboring blocks. Index information indicating the reference sample line to be used for intra prediction of the current block may be signaled. When the upper boundary of the current block is the boundary of the CTU, only the reference sample line 0 may be available. Therefore, in this case, the index information may not be signaled. When reference sample lines other than the reference sample line 0 are used, filtering for the prediction block, which will be described later, may not be performed.

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

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

[0212] In the case of intra prediction between color components, a prediction block of a current block of a second color component may be generated based on a corresponding reconstruction block of a first color component. For example, the first color component may be a luminance component, and the second color component may be a chrominance component. For intra prediction between color components, parameters of a linear model between the first color component and the second color component may be derived based on a template. The template may include upper and / or left neighboring samples of the current block and upper and / or left neighboring samples of a reconstruction block of the first color component corresponding thereto. For example, the sample value of the first color component having the maximum value among the samples in the template and the sample value of the second color component corresponding thereto, and the sample value of the first color component having the minimum value among the samples in the template and the sample value of the second color component corresponding thereto may be used to derive the parameters of the linear model. When the parameters of the linear model are derived, the corresponding reconstruction block may be applied to the linear model to generate a prediction block of the current block. Depending on the video format, subsampling may be performed on the reconstruction block of the first color component and the neighboring samples of the corresponding reconstruction block. For example, when one sample of the second color component corresponds to four samples of the first color component, the four samples of the first color component may be subsampled to calculate one corresponding sample. In this case, parameter derivation of the linear model and intra prediction between color components may be performed based on the corresponding subsampled samples. Whether to perform intra prediction between color components and / or the range of the template may be signaled as an intra prediction mode.

[0213] The current block may be partitioned into two sub-blocks or four sub-blocks in the horizontal direction or the vertical direction. The partitioned sub-blocks may be sequentially reconstructed. That is, intra prediction may be performed on the sub-block to generate a sub-prediction block. In addition, inverse quantization and / or inverse transformation may be performed on the sub-block to generate a sub-residual block. The reconstructed sub-block may be generated by adding the sub-prediction block to the sub-residual block. The reconstructed sub-block may be used as a reference sample for intra prediction of the sub-block. The sub-block may be a block including a predetermined number (e.g., 16) or more samples. Thus, for example, when the current block is an 8×4 block or a 4×8 block, the current block may be partitioned into two sub-blocks. In addition, when the current block is a 4×4 block, the current block may not be partitioned into sub-blocks. When the current block has other sizes, the current block may be partitioned into four sub-blocks. Information on whether intra prediction is performed based on sub-blocks and / or partition directions (horizontal or vertical) may be sent by a signal. Intra prediction based on sub-blocks may be performed only when reference sample line 0 is used. When subblock-based intra prediction is performed, filtering for a prediction block, which will be described later, may not be performed.

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

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

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

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

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

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

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

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

[0222] The derivation method of motion information may be different according to the prediction mode of the current block. For example, the prediction mode applied to inter prediction includes AMVP mode, merge mode, skip mode, merge mode with motion vector difference, sub-block merge mode, triangle partition mode, inter-intra combined prediction mode, affine mode, etc. Here, the merge mode may be referred to as motion merge mode.

[0223] For example, when AMVP is used as a prediction mode, at least one of a motion vector of a reconstructed neighboring block, a motion vector of a co-located block, a motion vector of a block adjacent to the co-located block, and a (0,0) motion vector may be determined as a motion vector candidate for the current block, and a motion vector candidate list may be generated by using the motion vector candidate. The motion vector candidate for the current block may be derived by using the generated motion vector candidate list. The motion information of the current block may be determined based on the derived motion vector candidate. The motion vector of the co-located block or the motion vector of a block adjacent to the co-located block may be referred to as a temporal motion vector candidate, and the motion vector of the reconstructed neighboring block may be referred to as a spatial motion vector candidate.

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

[0225] In addition, the encoding apparatus 100 may perform entropy encoding on the resolution information of the calculated MVD. The decoding apparatus 200 may adjust the resolution of the entropy-decoded MVD using the MVD resolution information.

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

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

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

[0229] The merge candidate list may be a list of stored motion information. The motion information included in the merge candidate list may be at least one of the following: motion information of a neighboring block adjacent to the current block (spatial merge candidate), motion information of a co-located block of the current block in a reference picture (temporal merge candidate), new motion information generated by combining motion information present in the merge candidate list, motion information of a block encoded / decoded before the current block (historical-based merge candidate), and a zero merge candidate.

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

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

[0232] The skip mode may be a mode in which the motion information of the neighboring blocks is applied to the current block as it is. When the skip mode is applied, the encoding apparatus 100 may perform entropy encoding on information of the fact of which block's motion information is to be used as the motion information of the current block to generate a bitstream, and may signal the bitstream to the decoding apparatus 200. The encoding apparatus 100 may not signal a syntax element regarding at least any one of the motion vector difference information, the coded block flag, and the transform coefficient level to the decoding apparatus 200.

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

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

[0235] The inter-intra combined prediction mode may mean a mode of deriving a prediction sample of a current block by weighting a prediction sample generated by inter prediction and a prediction sample generated by intra prediction.

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

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

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

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

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

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

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

[0243] The quantized level coefficients may then be dequantized, then inverse transformed a second time as needed, and finally inverse transformed a first time as needed to generate a reconstructed residual signal.

[0244] Inverse mapping in the dynamic range can be performed for the luminance component reconstructed by intra prediction or inter prediction before in-loop filtering. The dynamic range can be divided into 16 equal segments, and the mapping function of each segment can be sent by signal. The mapping function can be sent by signal at the slice level or parallel block group level. The inverse mapping function for performing inverse mapping can be derived based on the mapping function. In-loop filtering, reference picture storage and motion compensation are performed in the inverse mapping area, and the prediction block generated by inter prediction is converted to the mapping area via mapping using the mapping function, and then used to generate the reconstructed block. However, since intra prediction is performed in the mapping area, the prediction block generated by intra prediction can be used to generate the reconstructed block without mapping / inverse mapping.

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

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

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

[0248] Hereinafter, a method of decoding / encoding an image according to an embodiment of the present invention will be described.

[0249] The motion vector prediction method based on advanced motion vector prediction can use not only the motion vector (MV) of the reconstructed block located at the spatial periphery of the encoding / decoding target block, but also the motion vector of the block existing in the reference picture at the same position or corresponding position as the encoding / decoding target block.

[0250] Here, a block existing at the same position as the encoding / decoding target block at or in the reference picture, or at an adjacent position or spatially corresponding position in the same position as the encoding / decoding target block in the reference picture may be referred to as a co-located block. Here, a co-located block may be a block that is necessarily located at the same position as the encoding / decoding target block of the reference picture, and a block that exists at a position similar to the position of the encoding / decoding target block (i.e., a corresponding position). Here, a block having a position similar to the position of the encoding / decoding target block may include a block adjacent to the encoding / decoding target block.

[0251] In addition, the picture that is the derivation target of the temporal motion vector may be referred to as a co-located picture. That is, the co-located picture may refer to a picture that stores a motion vector for the current picture. In addition, the co-located picture may store a motion vector difference for the current picture. In addition, the co-located picture may store a seed vector or an affine control point vector for deriving an affine model for the current picture.

[0252] In the motion information merging method, motion information can be inferred not only from a reconstructed block located in the vicinity of space, but also from a co-located block, and can be used as motion information of an encoding / decoding target block. In this case, the motion information may include at least one or more of a reference picture index, a motion vector, inter-prediction mode information indicating unidirectional or bidirectional, etc. required for inter-prediction, a reference picture list, and prediction mode information about whether to be encoded in an intra-prediction mode or whether to be encoded in an inter-prediction mode.

[0253] The predicted motion vector in the encoding / decoding target block may be a motion vector of a neighboring block spatially adjacent to the encoding / decoding target block and a motion vector of a co-located block which is a block temporally adjacent to the encoding / decoding target block.

[0254] Figure 8 An example of encoding / decoding target pictures and reference pictures is shown.

[0255] exist Figure 8 , block X represents an encoding / decoding target block in the encoding / decoding target picture 801, and blocks A, B, C, D, and E represent reconstructed blocks located around the encoding / decoding target block. Block T in the reference picture 802 indicates a co-located block existing at a position corresponding to that of the encoding / decoding target block.

[0256] Which motion vector is used as a predicted motion vector in an encoding / decoding target block may be determined by a motion vector predictor index.

[0257] like Fig. 9 As shown in , a motion vector predictor index (mvp_idx_l0, mvp_idx_l1) for each reference picture list is transmitted to the decoding device, and the decoding device may use the same motion vector as the motion vector predicted by the encoding device as the predicted motion vector.

[0258] When the encoding / decoding target block is encoded / decoded using the motion vector of the neighboring block spatially adjacent to the encoding / decoding target block, the motion vector may be stored using only a memory having a relatively small size.

[0259] However, when encoding / decoding a coding / decoding target block using a temporal motion vector, since all motion vectors of a reference picture must be stored in a memory, a memory having a relatively large size is required. In addition, the amount of memory access bandwidth required to retrieve data from the memory also increases. Therefore, in an application environment where there is not enough memory space or power consumption should be minimized, such as in a portable receiving terminal, it is necessary to store the temporal motion vector more efficiently.

[0260] Hereinafter, a motion vector storing method for efficiently storing a temporal motion vector will be described.

[0261] As a method of storing the motion vector in the memory, the spatial resolution of the motion vector may be reduced.

[0262] In the above method, the motion vector may be compressed at an arbitrary ratio and then stored in the memory. For example, the number of stored motion vectors may be reduced by storing the motion vectors stored in 4×4 block units in 4×4 or larger block units. Here, in order to adjust the block size of the stored motion vector, information on the compression ratio may be transmitted.

[0263] like Fig.10 As shown in , information related to the spatial resolution of the motion vector can be transmitted in a sequence parameter set, a picture parameter set, a slice header, a tile header, a CTU, and a CU unit.

[0264] Reference Fig.10 , when motion_vector_buffer_comp_flag is 1, motion vector buffer compression processing can be performed.

[0265] motion_vector_buffer_comp_ratio_log2 may indicate a compression ratio of a motion vector buffer compression process. When motion_vector_buffer_comp_ratio_log2 does not exist, motion_vector_buffer_comp_ratio_log2 is inferred to be 0, and the motion vector buffer compression ratio may be expressed as Equation 1.

[0266] [Equation 1]

[0267] MVBufferCompRatio=1< <motion_vector_buffer_comp_ratio_log2

[0268] Here, the spatial resolution may be set to a predetermined fixed value in the encoder / decoder without signaling information about the spatial resolution. Here, the spatial resolution may be at least one of N×M forms (where N and M are positive integers) such as 4×4, 8×8, and 16×16.

[0269] In the encoder or decoder, the motion vector of the reference picture with reduced spatial resolution may be used in at least one of the processes of using the motion vector of the reference picture (such as generating a motion vector candidate list and generating a merge candidate list). Here, the motion vector of the reference picture may represent a temporal motion vector.

[0270] In addition, at least one unit among a sequence, a picture, a slice, a tile, a CTU, and a block may have different spatial resolutions from each other.

[0271] For example, the first picture may have a spatial resolution of a unit of 4×4, and the second picture may have a spatial resolution of a unit of 16×16.

[0272] For example, a first tile in a picture may have a spatial resolution of a unit of 4×4, and a second tile in the picture may have a spatial resolution of a unit of 16×16.

[0273] For example, a first CTU in a picture may have a spatial resolution of a unit of 4×4, and a second CTU in the picture may have a spatial resolution of a unit of 16×16.

[0274] When at least one unit among a sequence, a picture, a slice, a tile, a CTU, and a block has different spatial resolutions from each other, information about the spatial resolution in the corresponding unit may be entropy encoded / decoded.

[0275] For example, when all 4x4 blocks of a 1920x1080 (1080p) picture have different motion vectors, two reference picture lists are used and two reference pictures are used for each list, a total of 4.14 megabytes of memory space may be required to store temporal motion vectors for reference pictures.

[0276] - Bit depth of 32 bits for each motion vector

[0277] (1) Dynamic range of the X component of the motion vector: -32768 to +32767 (bit depth: 16 bits)

[0278] (2) Dynamic range of the Y component of the motion vector: -32768 to +32767 (bit depth: 16 bits)

[0279] - When all 4×4 block units have different motion vectors from each other: 480×270=129600 blocks

[0280] - Use two motion vectors for each block

[0281] - Number of reference picture lists: 2

[0282] - Using two reference pictures for one reference picture list

[0283] 32 bits x 129600 blocks x two motion vectors x two reference picture lists x two reference pictures = 33177600 bits = 4.14 Mbytes

[0284] Considering the above five conditions, 4.14 Mbytes may be required as a memory space for storing the temporal motion vector.

[0285] According to the above-described method of reducing the spatial resolution of motion vectors, the size of the required memory space and the memory access bandwidth can be reduced by using the spatial correlation of the motion vectors.

[0286] When the size of the memory space is reduced to 1 / 4, the size of the memory space required in the above example is reduced to about 1.0 Mbyte. Here, when only 6 bits are used for each component of the motion vector as the bit depth required for storing the motion vector by further limiting the dynamic range of the motion vector, the required memory space can be further reduced to 0.375 Mbyte.

[0287] Therefore, a method of reducing the bit depth of motion vectors will be described below in order to reduce the size of the memory space required to store the motion vectors and the memory access bandwidth required to retrieve data from the memory.

[0288] For example, the bit depth of the motion vectors may be reduced by limiting the dynamic range of the motion vectors.

[0289] As another example, the bit depth of the motion vector can be reduced by changing the format of the motion vector. In addition, the bit depth of the motion vector can be increased by changing the format of the motion vector again.

[0290] Hereinafter, the dynamic range of a motion vector indicates the portion between the minimum and maximum values ​​of the negative component or the positive component of the motion vector relative to zero, and the bit depth indicates the size of a space required to store the motion vector and also indicates the bit width. In addition, unless otherwise specified, the motion vector may indicate a motion vector of a reference picture, that is, a temporal motion vector.

[0291] When each component of the motion vector exceeds the dynamic range, each component may be represented as the minimum or maximum value of the dynamic range. For example, when the X component of the motion vector is 312 and the maximum value of the dynamic range of each component of the motion vector is 255, the X component of the motion vector may be limited to 255.

[0292] Similarly, in the case where the bit depth of each component of the motion vector is 16 bits and the motion vector is (-36, 24), when the bit depth of each component of the motion vector is limited to 6 bits, each component has a dynamic range of -32 to +31, so that the motion vector can be represented as (-32, 24) within the dynamic range.

[0293] In addition, in the case where the bit depth of each component of the motion vector is 16 bits and the motion vector is (-49, 142), when the bit depth of each component of the motion vector is limited to 9 bits, each component has a dynamic range of -256 to +255, so that the motion vector can be represented as unchanged (-49, 142).

[0294] Fig.11 is a diagram illustrating an example of limiting the dynamic range of a motion vector.

[0295] Reference Fig.11 , when the dynamic range of a motion vector having a dynamic range of -4096 to +4095 is limited to -128 to +127, the bit depth can be reduced from 13 bits to 8 bits.

[0296] Each component of the temporal motion vector may be clipped (such as Equation 2 and Equation 3) and stored at a bit depth of N bits, where N is a positive integer.

[0297] [Equation 2]

[0298] clippedMV_X=min(1<<(N-1)-1, max(-1<<(N-1), MV_X))

[0299] [Equation 3]

[0300] clippedMV_Y=min(1<<(N-1)-1, max(-1<<(N-1), MV_Y))

[0301] Wherein, MV_X is the X component of the motion vector, MV_Y is the Y component of the motion vector, min(a,b) is an operation that outputs the smaller value of a and b, and max(a,b) is an operation that outputs the larger value of a and b. clippedMV_X and clippedMV_Y are the X component and Y component of the clipped temporal motion vector, respectively, and are stored in the memory to be used as the temporal motion vector of the encoding / decoding target block.

[0302] For example, as shown in Table 1, when the size of the memory space is 48 bytes and a bit depth of 16 bits is used for each component of a motion vector, a total of 12 motion vectors may be stored.

[0303]

Table 1

[0304] MV1-X MV1-Y MV2-X MV2-Y MV3-X MMV3-Y MV4-X MV4-Y MV5-X MV5-Y MV6-X MV6-Y MV7-X MV7-Y MV8-X MV8-Y MV9-X MV9-Y MV10-X MV10-Y MV11-X MV11-Y MV12-X MV12-Y

[0305] However, when a bit depth of only 8 bits is used for each component of a motion vector, as shown in Table 2, a total of 24 motion vectors may be stored.

[0306]

Table 2

[0307] MV1_X MV1_Y MV2-X MV2-Y MV3_X MV3-Y MV4-X MV4-Y MV5-X MV5-Y MV6-X MV6-Y MV7-X MV7-Y MV8-X MV8-Y MV9-X MV9-Y MV10-X MV10-Y MV11-X MV11-Y MV12-X MV12-Y MV13-X MV13-Y MV14-X MV14-Y MV15-X MV15-Y MV16-X MV16-Y MV17-X MV17-Y MV18-X MV18-Y MV19-X MV19-Y MV20-X MV20-Y MV21-X MV21-Y MV22-X MV22-Y MV23-X MV23-Y MV24-X MV24-Y

[0308] Therefore, when an image reconstructed in an encoding device and / or a decoding device is stored in a decoded picture buffer (DPB) through an in-loop filtering process such as a deblocking filter or an adaptive loop filter, a motion vector of a reference picture can be saved by limiting the dynamic range of the motion vector. Here, the decoded picture buffer may represent Figure 1 or Figure 2 The reference picture buffer.

[0309] In addition, when the motion vector of the reference picture in the encoding device and / or the decoding device is used for at least one of the processes using the motion vector of the reference picture (such as the generation of the motion vector candidate list and the generation of the merge candidate list), the dynamic range of the motion vector of the reference picture may be limited. Here, the limited dynamic range may be a range fixed to the encoding device / decoding device. For example, the fixed dynamic range may be an N-bit depth.

[0310] In addition, in addition to the temporal motion vector, the dynamic range of at least one of the following items may be limited: a spatial motion vector derived from the AMVP mode and the merge mode, a differential motion vector derived from the merge mode with a motion vector difference, a sub-block motion vector derived from the sub-block merge mode, a motion vector derived from the triangulation mode, an affine control point motion vector derived from the affine inter-frame mode, and a corrected motion vector derived by correcting the motion information in the decoding device itself. Here, the limited dynamic range may be a range fixed to the encoding device / decoding device. For example, the fixed dynamic range may be an N-bit depth.

[0311] Furthermore, in the present invention, at least one of the embodiments of the present invention may be applied to at least one of a block vector, a motion vector difference, and a block vector difference, instead of a motion vector. That is, at least one of the embodiments of the present invention corresponding to a motion vector may be equally applied to a block vector, a motion vector difference, and a block vector difference.

[0312] For example, at least one dynamic range of a block vector, a motion vector difference, and a block vector difference may be limited. Here, the limited dynamic range may be a range fixed to the encoding device / decoding device. For example, the fixed dynamic range may be an N bit depth. N may be a positive integer, such as 18.

[0313] When the bit depth N is 18, the limited dynamic range can be -2 17 to 2 17 -1, -2 17 The minimum value of the dynamic range can be represented, and 2 17 -1 represents the maximum value of the dynamic range.

[0314] The decoding apparatus 200 may automatically correct the derived motion information. The decoding apparatus 200 may search for a predefined area based on a reference block indicated by the derived motion information to derive motion information having a minimum SAD as corrected motion information.

[0315] I. Processing of Clipping Motion Vectors

[0316] When the slice type (slice_type) is not an I picture, a process of clipping each component of a motion vector may be performed. The motion vector clipping process may be performed in units of a tree block or a maximum coding unit (LCU) after the filtering process is completed.

[0317] In the motion vector clipping process, the input is the top left pixel position (xP, yP) of the prediction unit in the current picture and the motion vector matrices MvL0 and MvL1, and the output is the clipped motion vector matrices CMvL0 and CMvL1.

[0318] The operations of Equation 4 to Equation 7 may be performed on matrices MvL0, MvL1, CMvL0, and CMvL1.

[0319] [Equation 4]

[0320] mvLX=MvLX[xP,yP]

[0321] [Equation 5]

[0322] cmvLX[0]=Clip3(-1<<(TMVBitWidth-1), 1<<(TMVBitWidth-1)-1, mvLX[0])

[0323] [Equation 6]

[0324] cmvLX[1]=Clip3(-1<<(TMVBitWidth-1), 1<<(TMVBitWidth-1)-1, mvLX[1])

[0325] [Equation 7]

[0326] CMvLX[xP,yP]=cmvLX

[0327] Here, TMVBitWidth represents the bit depth of the motion vector, and Clip3(a, b, c) may represent a function of clipping c in such a manner as to exist in the range between a and b.

[0328] II. Processing of storing motion vectors

[0329] Figures 12 to 15 is a flow chart illustrating a method of storing a motion vector of a reference picture.

[0330] Reference Fig.12 , a motion vector of a reference picture may be stored using an image buffer for storing a decoded picture and a motion vector buffer for storing a motion vector. Here, the decoded picture may undergo an in-loop filtering process (S1210), and the motion vector may undergo a dynamic range limiting process (S1220) to be stored (S1240).

[0331] In addition, refer to Fig.13 , an image buffer and a motion vector buffer are used together, wherein the motion vector may undergo a dynamic range limitation process (S1320) and a spatial resolution reduction process (S1330) to be stored (S1340).

[0332] In addition, reference Fig.14, the decoded picture undergoes an in-loop filtering process (S1410) to be stored in an image buffer (S1440), and a motion vector undergoes a dynamic range limitation process (S1420) to be stored in a motion vector buffer (S1450).

[0333] In addition, refer to Fig.15 , the decoded picture undergoes an in-loop filtering process (S1510) to be stored in an image buffer (S1540), and the motion vector undergoes a dynamic range limitation process (S1520) and a spatial resolution reduction process (S1530) to be stored (S1550).

[0334] In addition, Fig.13 and Fig.15 In the embodiment, the dynamic range limiting process (S1320, S1520) and the spatial resolution reducing process (S1330, S1530) are not limited to the described order but may be changed.

[0335] In addition, the dynamic range may be limited differently for each component of the motion vector to further reduce the memory access bandwidth. For example, only one of the dynamic range of the X component and the dynamic range of the Y component may be limited, or the dynamic range of the Y component may be further limited relative to the dynamic range of the X component.

[0336] Information indicating the limited dynamic range of the motion vector is set to a fixed value predetermined in the encoding device and the decoding device, or is transmitted through at least one of a sequence parameter set, a picture parameter set (PPS), a tile header, a slice header, a CTU, a block, etc., and the decoding device may perform the same restriction on the dynamic range of the temporal motion vector in at least one of a sequence, a picture, a tile, a slice, a CTU, and a block. Here, the bit depth may be transmitted together, wherein the bit depth is the size of the memory space required to store the motion vector represented in the dynamic range. In addition, the temporal motion vector may be efficiently stored according to the motion characteristics of the image by using the dynamic range transmitted through at least one of a sequence parameter, a picture parameter set, a slice header, a tile header, a CTU, a block, etc., instead of using a fixed-size bit depth to store the motion vector. In the encoding device or the decoding device, the motion vector of the reference picture with a limited dynamic range may be used in at least one of the processes of using the motion vector of the reference picture (such as the generation of a motion vector candidate list and the generation of a merge candidate list). The dynamic range may be represented by an N-bit value. Wherein N may be 0 or a positive integer.

[0337] Here, in at least one unit of a sequence, a picture, a slice, a tile, a CTU, and a block, there may be different dynamic ranges.

[0338] For example, the first picture may have a dynamic range of 16 bits, and the second picture may have a dynamic range of 32 bits.

[0339] For example, a first tile in a picture may have a dynamic range of 16 bits, and a second tile in the picture may have a dynamic range of 32 bits.

[0340] For example, a first CTU in a picture may have a dynamic range of 16 bits, and a second CTU in the picture may have a dynamic range of 32 bits.

[0341] When at least one unit among a sequence, a picture, a slice, a tile, a CTU, and a block has dynamic ranges different from each other, information about the dynamic range in the corresponding unit may be entropy encoded / decoded.

[0342] In addition, the motion vector may be quantized and stored. When the motion vector is quantized and stored, the accuracy of the motion vector is reduced. Quantization methods include uniform quantization with equal step sizes, non-uniform quantization with unequal step sizes, and the like. The quantization step size is set to a fixed value predetermined in the encoding device and the decoding device, or information indicating the quantization step size is determined from the encoding device to the decoding device through at least one of a sequence parameter set, a picture parameter set, a parallel block header, a slice header, a CTU, a block, and the like. In the decoding device, the quantized motion vector may be used as is or in a dequantized manner.

[0343] Fig.16 is a diagram showing an example of quantizing a motion vector.

[0344] Reference Fig.16 , when the motion vector has a component value of 32 to 48, the motion vector is quantized to 40. In the encoding device or the decoding device, quantization is performed when the motion vector of the reference picture is stored, and in at least one of the processes using the motion vector of the reference picture (such as generating a motion vector candidate list and generating a merge candidate list), the quantized motion vector of the reference picture is inversely quantized and used. The step size can be represented by an N value. Here, N can be 0 or a positive integer.

[0345] Here, at least one unit of a sequence, a picture, a slice, a tile, a CTU, and a block may have different step sizes from each other.

[0346] For example, the first picture may have a step size of 1, and the second picture may have a step size of 2.

[0347] For example, a first tile in a picture may have a stride of 1, and a second tile in the picture may have a stride of 2.

[0348] For example, the first CTU in the picture may have a stride of 1, and the second CTU in the picture may have a stride of 2.

[0349] When at least one unit among a sequence, a picture, a slice, a tile, a CTU, and a block has different step sizes from each other, information about the step size in the corresponding unit may be entropy encoded / decoded.

[0350] Furthermore, the motion vector may be stored at a limited representation resolution. The representation resolution may represent an integer pixel unit (1 pixel unit) or a fractional pixel unit (1 / 2 pixel unit, 1 / 4 pixel unit, 1 / 8 pixel unit, 1 / 16 pixel unit, etc.).

[0351] For example, the resolution of the motion vector processed in units of 1 / 4 pixels may be stored in integer pixels. Information indicating the resolution of the motion vector is set to a fixed value predetermined in the encoding device and the decoding device, or may be transmitted from the encoding device to the decoding device through at least one of a sequence parameter set, a picture parameter set, a parallel block header, a slice header, a CTU, a block, etc.

[0352] In an encoding device or a decoding device, a motion vector of a reference picture is stored by limiting the representation resolution, and in at least one of processes (such as generating a motion vector candidate list and generating a merge candidate list) using the motion vector of the reference picture, the motion vector of the reference picture with the limited resolution may be reconstructed in the motion vector before limiting the resolution. For example, a motion vector of 1 / 16 pixel units may be stored as a motion vector of 1 / 4 pixel units at a limited resolution, and a motion vector stored in 1 / 4 pixel units may be reconstructed as a 1 / 16 pixel unit in at least one of processes using the motion vector of the reference picture. The representation resolution may be represented as a value M / N. Here, M and N may be 0 or a positive integer.

[0353] Here, at least one of a sequence, a picture, a slice, a tile, a CTU, and a block may have different representation resolutions from each other.

[0354] For example, the first screen may have a representation resolution of 1 / 16 pixel units, and the second screen may have a representation resolution of 1 / 4 pixel units.

[0355] For example, a first tile in a picture may have a representation resolution of 1 / 16 pixel units, and a second tile in the picture may have a representation resolution of 1 / 4 pixel units.

[0356] For example, a first CTU in a picture may have a representation resolution of 1 / 16 pixel units, and a second CTU in the picture may have a representation resolution of 1 / 4 pixel units.

[0357] When at least one unit among a sequence, a picture, a slice, a tile, a CTU, and a block has different representation resolutions from each other, information about the representation resolution in the corresponding unit may be entropy encoded / decoded.

[0358] In addition, the motion vector may be stored by changing the format of the motion vector. Here, the format of the motion vector is a format representing a motion vector component, and may include a fixed point format, a floating point format, a signed n-bit format, and the like.

[0359] For example, a motion vector component in a signed 18-bit format is changed to a motion vector component in a 6-bit mantissa and 4-bit exponent format by using a floating point format. That is, by changing the format of the motion vector component, the bit depth of the motion vector can be reduced from 18 bits to 10 bits.

[0360] More specifically, the encoding device or decoding device may transform the motion vector value used in the inter-frame prediction of the current block into a floating point format, and then store the transformed value in a memory. The value transformed into the floating point format may be transformed back to the motion vector value, and then used for the inter-frame prediction of the adjacent block. In detail, the encoding device or decoding device may transform the motion vector value represented by N bits into an M-bit floating point format. In this case, the M bits may include R mantissa bits and P exponent part bits. For example, N, M, R and P may be positive integers, and may be 18, 10, 6 and 4, respectively.

[0361] For example, a motion vector used in inter prediction of a current block may be transformed into a floating point format according to Equation 8 below.

[0362] [Equation 8]

[0363] s=mv[compIdx]>>17

[0364] f=Floor(Log2((mv[compIdx]^s)|31))-4

[0365] mask=(-1< <f)>>1

[0366] round=(1< <f)>>2

[0367] mv[compIdx]=(mv[compIdx]+round)&mask

[0368] Here, mv[] may represent a motion vector value used in inter prediction of the current block, and compIdx may be a value indicating a component type of the motion vector. For example, compIdx may be an index value indicating an x ​​value or a y value of a motion vector, an index value indicating a luminance component or a chrominance component of a motion vector, or an index value indicating a prediction direction (e.g., L0 or L1). In addition, Floor() may be a function that discards digits after a decimal point.

[0369] The format of the motion vector is set to a fixed format predetermined in the encoding device and the decoding device, or can be sent from the encoding device to the decoding device through at least one of a sequence parameter set, a picture parameter set, a parallel block header, a slice header, a CTU, a block, etc.

[0370] Furthermore, at least one of dynamic range limitation processing, spatial resolution reduction processing, quantization processing, representation resolution limitation processing, and format change processing of motion vectors is performed only on some of the temporal motion vectors stored in the memory.

[0371] When the dynamic range of a motion vector is stored by limiting the dynamic range of the motion vector, the dynamic range of the motion vector may be stored in the memory by adding information on the memory. For example, when the dynamic range of the motion vector is -128 to +127, a flag 1 may be additionally stored, and when the dynamic range of the motion vector is set to -32 to +31, a flag 0 may be additionally stored. Here, the flag information may be stored together with the motion vector, or may be stored in a memory other than the memory storing the motion vector. When the flag information and the motion vector are stored in different memories from each other, the flag information may be randomly accessed to find out in which dynamic range a specific motion vector is stored. In addition, information about which dynamic ranges some motion vectors are stored is sent through at least one of a sequence parameter set, a picture parameter set, a parallel block header, a CTU, a block, a slice header, etc., thereby allowing the decoder to be executed similarly to the encoder.

[0372] When the spatial resolution of the motion vector is stored by reducing the spatial resolution of the motion vector, the spatial resolution of the motion vector can be stored in the memory by adding information on the memory. For example, when the block size of the motion vector is 4×4, a flag 1 can be additionally stored, and when the block size of the motion vector is 16×16, a flag 0 can be additionally stored. Here, the flag information can be stored together with the motion vector, or can be stored in a memory other than the memory storing the motion vector. When the flag information and the motion vector are stored in different memories from each other, the flag information can be randomly accessed to find out in which block size a specific motion vector is stored. In addition, information about which block size some motion vectors are stored in is sent through at least one of a sequence parameter set, a picture parameter set, a parallel block header, a CTU, a block, a slice header, etc., thereby allowing the decoder to be executed similarly to the encoder.

[0373] When the motion vector is quantized and then stored, the resolution of the motion vector can be stored in the memory by adding information on the memory. For example, when the step size of the motion vector is 4, a flag 1 can be stored additionally, and when the step size of the motion vector is 1, a flag 0 can be stored additionally. Here, the flag information can be stored together with the motion vector, or can be stored in a memory other than the memory storing the motion vector. When the flag information and the motion vector are stored in different memories from each other, the flag information can be randomly accessed to find out at which step size a specific motion vector is stored. In addition, information about at which step size some motion vectors are stored is sent through at least one of a sequence parameter set, a picture parameter set, a parallel block header, a CTU, a block, a slice header, etc., thereby allowing the decoder to be executed similarly to the encoder.

[0374] When the representation resolution of the motion vector is stored by limiting the representation resolution of the motion vector, the representation resolution of the motion vector can be stored in the memory by adding information on the memory. For example, when the representation resolution is an integer unit, a flag 1 can be stored additionally, and when the representation resolution is a 1 / 4 pixel unit, a flag 0 can be stored additionally. Here, the flag information can be stored together with the motion vector, or can be stored in a memory other than the memory storing the motion vector. When the flag information and the motion vector are stored in different memories from each other, the flag information can be randomly accessed to find out at which representation resolution a specific motion vector is stored. In addition, information about at which representation resolution some motion vectors are stored is sent through at least one of a sequence parameter set, a picture parameter set, a parallel block header, a CTU, a block, a slice header, etc., thereby allowing the decoder to be executed similarly to the encoder.

[0375] In addition, when the motion information is stored in the memory, the motion information may be stored by reducing the spatial resolution of the motion vector. In this case, the motion information may include at least one or more of a reference picture index, a motion vector, inter-prediction mode information indicating unidirectional or bidirectional, etc. required for inter-prediction, a reference picture list, and prediction mode information about whether to be encoded in an intra-prediction mode or whether to be encoded in an inter-prediction mode.

[0376] For example, motion information of a prediction unit having a maximum partition or block size among multiple pieces of motion information of a specific region may be stored in a memory as representative motion information. In this case, the specific region may include a region within an encoding / decoding target block and a region of a neighboring block. In addition, the specific region may be a region including a block in which motion information is stored when the entire picture or slice is divided by a predetermined size.

[0377] For example, representative motion information may be stored in a memory after excluding motion information encoded by a motion information merging method, an encoding information skipping method, or the like from among pieces of motion information included in a specific region.

[0378] For example, the most frequently occurring motion information among the plurality of pieces of motion information included in the specific region may be stored in the memory as representative motion information. Here, the number of occurrences of the motion information may be calculated for each block size.

[0379] For example, motion information of a specific position among multiple pieces of motion information included in a specific area may be stored. Here, the specific position may be a position included in the specific area, and may be a fixed position of the specific area. In addition, the specific position may be selected as one of the multiple positions. When multiple positions are used, a priority may be determined for each position, and the motion information may be stored in a memory according to the priority. In addition, according to the priority of each position, it may be checked whether the motion information exists in the corresponding position, and when a motion vector exists, the motion information of the corresponding position may be stored.

[0380] For example, when multiple pieces of motion information included in a specific area are stored in a memory, and there is no motion information outside the boundary of a slice or a picture, a block encoded in an intra-prediction mode, or a block encoded in a pulse code modulation (PCM) mode, the motion information of the corresponding position may not be stored in the memory.

[0381] For example, when the motion information at a specific position is stored, a statistical value such as a median or average value of the motion information of inter-prediction encoded blocks around the corresponding position may be stored in the memory.

[0382] When the motion information of a specific position is stored in the above example, when there is no motion information of the corresponding position, the motion information of the same position block, the motion information of the first coding block, or the motion information of the neighboring block can be used as the motion information of the corresponding position. Here, the specific position can be a sample point position or a block position in the block around the encoding / decoding target block. For example, when there is no motion information of a specific position, a statistical value such as the median or average value of the motion information of the inter-frame prediction encoded blocks around the position can be stored in a memory. For example, when there is no motion information of a specific position, the average value of the motion information of the neighboring blocks of the corresponding position can be stored in a memory. When calculating the median and the average value, when the motion information of the neighboring block is different from one or more of the reference picture index, the reference picture list, and the inter-frame prediction mode information, the size of the motion vector can be adjusted according to the reference picture index, the reference picture list, the inter-frame prediction mode information, the picture display count, etc.

[0383] III. Processing of Derived Motion Vectors

[0384] When motion information is stored in a memory using the above-mentioned motion information method, and motion information of a reference picture is used in a motion vector prediction method, an advanced motion vector prediction method, or a motion information merging method, the stored motion information may be obtained.

[0385] For example, motion information of a position in a reference picture corresponding to the position of a coding / decoding target block may be obtained. In this case, the position in the reference picture corresponding to the position of the coding / decoding target block may be a fixed position in a specific area or a relative position relative to the position of the coding / decoding target block.

[0386] Figures 17 to 20 is a diagram illustrating an example of obtaining motion information from a reference picture.

[0387] exist Figures 17 to 20 , block X represents an encoding / decoding target block in the encoding / decoding target pictures 1710, 1810, 1910, and 2010, and block A, block B, block C, block D, and block E represent reconstructed blocks located around the encoding / decoding target block.

[0388] The block T in the reference pictures 1720 , 1820 , 1920 , and 2020 indicates a co-located block corresponding to the encoding / decoding target block.

[0389] Fig. 20 A block Y in the reference picture 2020 indicates a block corresponding to a position other than the encoding / decoding target block.

[0390] Reference Fig.17, motion information in a position corresponding to the upper left pixel position among the positions of the encoding / decoding target block X in the reference picture can be obtained.

[0391] Reference Fig.18 , motion information in a position corresponding to the center pixel position among the positions of the encoding / decoding target block X in the reference picture can be obtained.

[0392] Reference Fig.19 , motion information in a position corresponding to the lower right pixel position among the positions of the encoding / decoding target block X in the reference picture can be obtained.

[0393] Reference Fig. 20 , motion information in a position corresponding to a position other than the encoding / decoding target block X in the reference picture can be obtained.

[0394] By using the motion information stored in the memory (ie, the motion information of the reference picture), encoding / decoding methods such as motion vector prediction, advanced motion vector prediction, motion information merge, and motion information merge skip may be performed.

[0395] The motion vector is stored in a memory using at least one of a method of limiting the dynamic range of the motion vector, a method of reducing the spatial resolution of the motion vector, a method of quantizing the motion vector, a method of reducing the resolution of the representation of the motion vector, and a method of changing the format of the motion vector, and the stored motion vector can be used for motion vector prediction and motion information merging of the encoding / decoding target block.

[0396] The process of obtaining the motion vector of the reference picture from the memory may be referred to as the process of deriving the temporal motion vector. In the process of deriving the temporal motion vector, TMVbitWidth represents the bit width of the temporal motion vector stored in the memory.

[0397] In the process of deriving the temporal motion vector, the input is the upper left pixel position (xP, yP) of the prediction unit in the current picture, the horizontal length nPSW and vertical length nPSH of the luma prediction unit, and the reference picture index refldsLX of the current prediction unit partition, and the output is the motion vector prediction value mxLXCl and the flag availableFlagLXCol indicating its existence.

[0398] RefPicOrderCnt(pic,refidx,LX) is a function that outputs the PicOrderCnt of the reference picture RefPicListX[refidx] of pic. Where X is 0 or 1. The PicOrderCnt of the reference picture exists until the picture is deemed "non-existent". Clip3(a,b,c) represents a function that clips c so that it is in the range between a and b.

[0399] When the slice type (slice_type) is a B slice and collocated_from_l0_flag is 0, ColPic with the same-position partition becomes RefPicList1[0]; and when the slice type is a P slice or collocated_from_l0_flag is 1, ColPic with the same-position partition becomes RefPicList0[0].

[0400] ColPu and (xPCol, yPCol) which is the position of colPu are derived in the following order.

[0401] 1. The lower right luma component position (xPRb, yPRb) of the current prediction unit is defined as Equation 9 and Equation 10.

[0402] [Equation 9]

[0403] xPRb=xP+nPSW

[0404] [Equation 10]

[0405] yPRb=yP+nPSH

[0406] 2. When colPu is encoded in intra prediction mode or colPu does not exist,

[0407] (1) The central luma component position (xPCtr, yPCtr) of the current prediction unit is defined as Equation 11 and Equation 12.

[0408] [Equation 11]

[0409] xPCtr=(xP+(nPSW>>1)-1

[0410] [Equation 12]

[0411] yPCtr=(yP+(nPSH>>1)-1

[0412] (2) Set colPu in the prediction unit containing the position ((xPCtr>>4)<<4,(yPCtr>>4)<<<4) in colPic.

[0413] 3. (xPCol, yPCol) becomes the value of the upper left luminance component position of colPu from the upper left luminance component position of colPic.

[0414] mvLXCol and availableFlagLXCol are derived as follows.

[0415] 1. When colPu is encoded in intra prediction mode or colPu does not exist, each component of mvLXCol is 0 and availableFlagLXCol is also 0.

[0416] 2. Otherwise, when colPu is not encoded in intra prediction mode and colPu exists, mvLXCol and refIdxCol are derived as follows.

[0417] (1) When predFlagL0[xPCol][yPCol] is 0, the motion vector mvCol is determined to be MvL1[xPCol][yPCol], and the reference picture index refIdxCol is determined to be RefIdxL1[xPCol][yPCol].

[0418] (2) Otherwise, when PredFlagL0[xPCol][yPCol] is 1, the following processing is performed.

[0419] 1) When PredFlagL1[xPCol][yPCol] is 0, the motion vector mvCol is determined to be MvL0[xPCol][yPCol], and the reference picture index refIdxCol is determined to be RefIdxL0[xPCol][yPCol].

[0420] 2) Otherwise, that is, if PredFlagL1[xPCol][yPCol] is 1, the following processing is performed.

[0421] aX becomes 0 or 1, and the following allocation processing is performed.

[0422] i. RefIdxColLX is assigned to RefIdxLX[xPCol][yPCol].

[0423] ii. When PicOrderCnt(colPic) is less than PicOrderCnt(currPic) and RefPicOrderCnt(colPic,RefIdxColLX,LX) is greater than PicOrderCnt(currPic), or when PicOrderCnt(colPic) is greater than PicOrderCnt(currPic) and RefPicOrderCnt(colPic,RefIdxColLX,LX) is less than PicOrderCnt(currPic), MvXCross is assigned 1.

[0424] iii. Otherwise, when PicOrderCnt(colPic) is less than PicOrderCnt(currPic) and RefPicOrderCnt(colPic,RefIdxColLX,LX) is less than PicOrderCnt(currPic), or when PicOrderCnt(colPic) is greater than PicOrderCnt(currPic) and RefPicOrderCnt(colPic,RefIdxColLX,LX) is greater than PicOrderCnt(currPic), MvXCross is assigned to 1.

[0425] b. When one of the following conditions is satisfied, the motion vector mvCol, the reference picture index refIdxCol, and ListCol are determined to be MvL1[xPCol][yPCol], RefIdxColL1, and L1, respectively.

[0426] i.MV0Cross is 0, MV1Cross is 1.

[0427] ii. Mv0Cross is the same as Mv1Cross, and the reference picture list is L1.

[0428] c. Otherwise, the motion vector mvCol, the reference picture index refIdxCol and ListCol are determined as MvL0[xPCol][yPCol], RefIdxColL0 and L0 respectively.

[0429] 3) availableFlagLXCol is 1, and the operations of Equation 13 or Equation 14 to Equation 19 are performed.

[0430] a. When PicOrderCnt(colPic)-RefPicOrderCnt(colPic,refIdxCol,ListCol) is the same as PicOrderCnt(currPic)-RefPicOrderCnt(currPic,refIdxLX,LX),

[0431] [Equation 13]

[0432] mvLXCol=Clip3(-1<<(TMVBitWidth-1), 1<<(TMVBitWidth-1)-1, mvCol)

[0433] b. Otherwise,

[0434] [Equation 14]

[0435] tx=(16384+Abs(td / 2)) / td

[0436] [Equation 15]

[0437] DistScaleFactor=Clip3(-1024, 1023, (tb*tx+32)>>6)

[0438] [Equation 16]

[0439]

[0440] [Equation 17]

[0441]

[0442] Here, td and tb are as shown in Equation 18 and Equation 19.

[0443] [Equation 18]

[0444] td=Clip3(-128, 127, PicOrderCnt(colPic)-RefPicOrderCnt(colPic, refIdxCol, ListCol))

[0445] [Equation 19]

[0446] tb=Clip3(-128, 127, PicOrderCnt(currPic)-RefPicOrderCnt(currPic, refIdxLX, LX))

[0447] That is, referring to Equation 14 to Equation 17, mvLXCol is derived as a scaled version of the motion vector mvCol.

[0448] In addition, even if the motion vector is clipped within the dynamic range, when the clipped motion vector is scaled, the motion vector may be outside the dynamic range again. Therefore, after deriving the scaled motion vector, the dynamic range of the motion vector may be limited. Here, Equation 16 and Equation 17 may be replaced by Equation 20 and Equation 21, respectively.

[0449] [Equation 20]

[0450]

[0451] [Equation 21]

[0452] Additionally, the format of the motion vector obtained from the co-located block in the reference picture may be changed and then derived as a temporal motion vector.

[0453] For example, the temporal motion vector can be derived by changing the motion vector component of the 6-bit mantissa and 4-bit exponent format to a motion vector component of the signed 18-bit format. That is, by changing the format of the motion vector component, the bit depth of the motion vector can be increased from 10 bits to 18 bits.

[0454] For example, TMVBitWidth for limiting the dynamic range of the scaled motion vector may be fixed to M bits and applied to the encoding device / decoding device. Here, M may be a positive integer, for example, 18.

[0455] In detail, when the scaled motion vector value stored in the memory is not included in the predetermined range, the encoding device or the decoding device may determine the scaled motion vector value of the current block as the minimum value or the maximum value of the predetermined range to use the minimum value or the maximum value of the predetermined range in the inter-frame prediction of the current block. Specifically, when the scaled motion vector value stored in the memory is less than the minimum value of the predetermined range, the encoding device or the decoding device may determine the scaled motion vector value as the minimum value of the predetermined range, and use the minimum value of the predetermined range for the inter-frame prediction of the current block. In addition, when the scaled motion vector value is greater than the maximum value of the predetermined range, the encoding device or the decoding device may determine the scaled motion vector value as the maximum value of the predetermined range, and use the maximum value of the predetermined range for inter-frame prediction. In addition, when the scaled motion vector value of the current block is not included in the predetermined range, the encoding device or the decoding device may determine the scaled motion vector value as the minimum value or the maximum value of the predetermined range, and store the determined value in the memory. For example, the predetermined range may be -2 N to 2 N -1. Here, N can be a positive integer, for example, 17. When N is 17, -2N can have values ​​-131072, and 2 N -1 can have the value 131071.

[0456] In the encoder and the decoder, the format of the motion vector obtained from the same position block in the reference picture is changed to derive the temporal motion vector having the changed format. In this case, the bit depth of the temporal motion vector having the changed format can be higher than the bit depth of the temporal motion vector before the format is changed.

[0457] The scaled motion vector may be derived by performing scaling on the format-changed temporal motion vector.

[0458] The final temporal motion vector may be derived by limiting the dynamic range for the scaled motion vector. Here, when the dynamic range is limited, a clipping process may be performed.

[0459] The scaling process and the cropping process may be sequentially performed as two processes, and may be performed as one integrated process.

[0460] The final temporal motion vector may be reformatted again and used as a motion vector for a reference picture. Here, the bit depth of the reformatted temporal motion vector may be lower than the bit depth of the temporal motion vector before the reformatting.

[0461] IV. Method for transmitting information for clipping temporal motion vector in a decoding device

[0462] Hereinafter, a method of transmitting information required to clip a temporal motion vector in a decoding device in the same manner as an encoding device will be described.

[0463] The TMVBitWidth in the above-mentioned temporal motion vector derivation process may be transmitted from the encoding device to the decoding device through at least one of a sequence parameter set, a picture parameter set, a slice header, a tile header, a CTU, a block, and the like.

[0464] Fig.21 bit_width_temporal_motion_vector_minus8 indicates the bit width of the temporal motion vector component. When bit_width_temporal_motion_vector_minus8 is not present, it is inferred to be 0, and the bit width of the temporal motion vector component can be expressed as Equation 22.

[0465] [Equation 22]

[0466] TMVBitWidth=bit_width_temporal_motion_vector_minus8+8

[0467] 1. First information transmission method (when compressing motion vectors and limiting the bit depth of motion vectors)

[0468] Reference Fig. 22 , when motion_vector_buffer_comp_flag is 1, motion vector buffer compression processing can be performed.

[0469] motion_vector_buffer_comp_ratio_log2 represents a compression ratio of a motion vector buffer compression process. When motion_vector_buffer_comp_ratio_log2 does not exist, it is inferred to be 0, and the motion vector buffer compression ratio can be expressed as Equation 23.

[0470] [Equation 23]

[0471] MVBufferCompRatio=1<<motion_vector_buffer_comp_ratio_log2

[0472] Reference Fig. 22 , when bit_depth_temporal_motion_vector_constraint_flag is 1, temporal motion vector bit depth restriction processing can be performed.

[0473] bit_depth_temporal_motion_vector_minus8 indicates the bit depth of the temporal motion vector. When bit_depth_temporal_motion_vector_minus8 is not present, it is inferred to be 0, and the bit depth of the temporal motion vector can be expressed as Equation 24.

[0474] [Equation 24]

[0475] TMVBitDepth=bit_depth_temporal_motion_vector_minus8+8

[0476] 2. Second information transmission method (when the bit depth of the motion vector is limited)

[0477] Reference Fig.23 , when bit_depth_temporal_motion_vector_constraint_flag is 1, temporal motion vector bit depth restriction processing can be performed.

[0478] Bit_depth_temporal_motion_vector_minus8 indicates the bit depth of the temporal motion vector. When bit_depth_temporal_motion_vector_minus8 is not present, it is inferred to be 0, and the bit depth of the temporal motion vector can be expressed as Equation 25.

[0479] [Equation 25]

[0480] TMVBitDepth=bit_depth_temporal_motion_vector_minus8+8

[0481] 3. Third information transmission method (when the bit depth of the motion vector is limited)

[0482] Fig.24 bit_depth_temporal_motion_vector_minus8 represents the bit depth of the temporal motion vector. When bit_depth_temporal_motion_vector_minus8 does not exist, it is inferred to be 0, and the bit depth of the temporal motion vector can be expressed as Equation 26.

[0483] [Equation 26]

[0484] TMVXBitDepth=bit_depth_temporal_motion_vector_x_minus8+8

[0485] 4. Fourth information transmission method (when the bit depth for each of the X component and the Y component of the motion vector is limited)

[0486] Reference Fig.25 , when bit_depth_temporal_motion_vector_constraint_flag is 1, temporal motion vector bit depth restriction processing can be performed.

[0487] bit_depth_temporal_motion_vector_x_minus8 represents the bit depth of the X component of the temporal motion vector. When bit_depth_temporal_motion_vector_x_minus8 is not present, it is inferred to be 0, and the bit depth of the temporal motion vector can be expressed as Equation 27.

[0488] [Equation 27]

[0489] TMVXBitDepth=bit_depth_temporal_motion_vector_x_minus8+8

[0490] bit_depth_temporal_motion_vector_y_minus8 represents the bit depth of the Y component of the temporal motion vector. When bit_depth_temporal_motion_vector_x_minus8 is not present, it is inferred to be 0, and the bit depth of the temporal motion vector can be expressed as Equation 28.

[0491] [Equation 28]

[0492] TMVXBitDepth=bit_depth_temporal_motion_vector_x_minus8+8

[0493] 5. Fifth information transmission method (when compressing motion vectors and limiting the bit depth of motion vectors)

[0494] Reference Fig.26 , when motion_vector_buffer_comp_flag is 1, motion vector buffer compression processing can be performed.

[0495] motion_vector_buffer_comp_ratio_log2 represents a compression ratio of a motion vector buffer compression process. When motion_vector_buffer_comp_ratio_log2 does not exist, it is inferred to be 0, and the motion vector buffer compression ratio can be expressed as Equation 29.

[0496] [Equation 29]

[0497] MVBufferCompRatio=1<<motion_vector_buffer_comp_ratio_log2

[0498] V. Defining Dynamic Range via Image Codec Level

[0499] The dynamic range of the temporal motion vector may not be transmitted through at least one of a sequence parameter set, a picture parameter set, a slice header, a tile header, a CTU, a block, etc., but may be defined by the level of the image codec. The encoding device and the decoding device may use the level information to determine the limited dynamic range of the motion vector.

[0500] Furthermore, a dynamic range and / or a bit depth of each of the X component and the Y component of the motion vector may be differently defined in levels, and minimum and maximum values ​​of the corresponding components may be defined.

[0501] Fig. 27 This is an example of defining TMVBitWidth by level in the above-mentioned temporal motion vector derivation process.

[0502] Reference Fig. 27 , TMVBitWidth can be set to MaxTMVBitWidth defined by level. Here, MaxTMVBitWidth represents the maximum bit width of a motion vector when the temporal motion vector is stored in a memory.

[0503] In addition, TMVBitWidth may be defined by level, and a delta value of the defined value may be transmitted through at least one of a sequence parameter set, a picture parameter set, a slice header, a parallel block header, a CTU, a block, etc. That is, TMVBitWidth may be set to a value obtained by adding a delta value transmitted by at least one of a sequence parameter set, a picture parameter set, a slice header, a parallel block header, a CTU, a block, etc. to MaxTMVBitWidth defined by level. Here, TMVBitWidth represents the bit width of a motion vector when a temporal motion vector is stored in a memory.

[0504] Fig.28 is an example of defining TMVBitDepth by level in the temporal motion vector derivation process described above.

[0505] Reference Fig.28 ,TMVBitDepth may be set to MaxTMVBitDepth defined by level. Here, MaxTMVBitDepth represents the maximum bit depth of a motion vector when the temporal motion vector is stored in a memory.

[0506] In addition, TMVBitDepth is defined by level, and a delta value of the defined value may be transmitted by at least one of a sequence parameter set, a picture parameter set, a slice header, a parallel block header, a CTU, a block, etc. That is, TMVBitDepth may be set to a value obtained by adding a delta value transmitted by at least one of a sequence parameter set, a picture parameter set, a slice header, a parallel block header, a CTU, a block, etc. to MaxTMVBitDepth defined by level. In this case, TMVBitDepth indicates the bit depth of a motion vector when a temporal motion vector is stored in a memory.

[0507] Fig.29delta_bit_width_temporal_motion_vector_minus8 represents the difference in the bit width of the temporal motion vector component. When delta_bit_width_temporal_motion_vector_minus8 does not exist, it is inferred to be 0, and the bit width of the temporal motion vector component can be expressed as Equation 30.

[0508] [Equation 30]

[0509] TMVXBitWidth=delta_bit_width+temporal_motion_vector_minus8+MaxTMVBitWidth

[0510] Furthermore, the dynamic range of each component of the temporal motion vector can be expressed as Fig.30 The levels shown in are defined.

[0511] In addition, if Figure 31 to Figure 33 As shown in , the bit width of each component of the temporal motion vector can be defined in levels.

[0512] In addition, the bit width of the Y component of the temporal motion vector can be as follows Fig.34 The levels shown in are defined.

[0513] In addition, the dynamic range of the temporal motion vector may be defined as a predetermined fixed value agreed upon in the encoding device and the decoding device without transmitting information about the limitation of the motion vector, or may be stored in the form of a fixed bit depth.

[0514] When TMVBitWidth is fixed to the same value in the encoding device and the decoding device, TMVBitWidth may be a positive integer such as 4, 6, 8, 10, 12, 14, 16, etc. Here, TMVBitWidth represents the bit width of the temporal motion vector when the temporal motion vector is stored in the memory.

[0515] Fig.35 is a flow chart showing a method for encoding an image using motion vector clipping according to an embodiment of the present invention. Fig.35 The image encoding method includes a cropping step S3510, a storage step S3520 and an encoding step S3530.

[0516] The image encoding device and / or the decoding device clips the motion vector of the reference picture within a predetermined dynamic range (S3510). As described in “I. Processing of clipping motion vectors”, the motion vector outside the dynamic range can be represented as the minimum value or the maximum value of the dynamic range. Therefore, as described in “IV. Method for sending information for clipping temporal motion vectors in a decoding device” and “V. Defining dynamic range via the level of an image codec”, the motion vector of the reference picture can be clipped to a predetermined dynamic range by limiting the bit depth by the level of the image codec and / or a set of sequence parameters, or by limiting the dynamic range by the level of the image codec.

[0517] As described in "II. Motion vector storage process", the image encoding apparatus and / or decoding apparatus stores the motion vector of the cropped reference picture in a buffer (S3520). The motion vector may be stored in the buffer together with the decoded picture or separately.

[0518] The image encoding device encodes the motion vector of the encoding target block by using the motion vector of the stored reference picture (S3530). As described in "III. Processing of deriving motion vector", the advanced motion vector prediction method can use not only the motion vector of the reconstructed block located in the spatial vicinity of the encoding / decoding target block, but also the motion vector of the block in the reference picture that exists in the same position or corresponding position as the encoding / decoding target block. The motion vector of the block existing in the same position or corresponding position can be used. Therefore, the motion vector of the encoding target block can be not only the motion vector of the neighboring block adjacent to the encoding target block, but also the motion vector of the reference picture, that is, the temporal motion vector.

[0519] In addition, since the dynamic range of the X component and the dynamic range of the Y component of the motion vector of the reference picture may be defined differently from each other, each component of the motion vector of the reference picture may be clipped to the dynamic range.

[0520] In addition, a method of limiting the dynamic range of the motion vector of the reference picture and a method of compressing the motion vector of the reference picture may be used. Here, the compression of the motion vector may mean a format change of the above-mentioned motion vector.

[0521] When limiting the dynamic range of the motion vector of the reference picture or compressing the motion vector of the reference picture, a flag indicating the level and / or sequence parameter set of the image codec, etc. may be defined.

[0522] In addition, by using the motion information stored in the memory (ie, the motion information of the reference picture), encoding methods such as motion vector prediction, advanced motion vector prediction, motion information merge, motion information merge skip, etc. can be performed.

[0523] Fig.36is a flowchart illustrating a method of decoding an image using motion vector clipping according to an embodiment of the present invention.

[0524] Reference Fig.36 The image decoding method includes a cropping step S3610, a storage step S3620, a derivation step S3630 and a decoding step S3640.

[0525] Fig.36 The clipping step S3610 and the storage step S3620 are the same as the above-mentioned "I. Processing of clipping motion vectors" and "II. Processing of storing motion vectors". Fig.35 The trimming step S3510 and the storage step S3520 are similar. In addition, Fig.36 The derivation step S3630 uses the above-mentioned "III. Processing of deriving motion vectors" and is Fig.35 Therefore, the detailed description thereof will be omitted.

[0526] The image decoding device performs inter-frame prediction decoding using the motion vector of the decoding target block (S3640). The image decoding device stores at least one motion vector in a memory using at least one of a method of limiting the dynamic range of the motion vector, a method of reducing the spatial resolution of the motion vector, a method of quantizing the motion vector, and a method of reducing the representation resolution of the motion vector, and uses the stored motion vector for motion vector prediction and motion information merging of the decoding target block.

[0527] In addition, by using the motion information stored in the memory (ie, the motion information of the reference picture), decoding methods such as motion vector prediction, advanced motion vector prediction, motion information merge, motion information merge skip, etc. can be performed.

[0528] In the above-described embodiment, when the motion vector of the current block is stored in the line buffer / memory, the motion vector before correction is performed on the motion vector may be stored in the line buffer / memory. Here, the motion vector may be referred to as the motion vector before correction. That is, the motion vector determined from the motion vector candidate list, the merge candidate list, and the sub-block unit merge candidate list may be stored before the motion compensation process of the current block. Correction may mean that the motion vector value may be changed by a predetermined rule during or before the motion compensation process in the encoder / decoder.

[0529] In addition, in the above-mentioned embodiment, when the motion vector of the current block is stored in the temporal motion vector buffer / memory, the motion vector after correction is performed on the motion vector may be stored in the temporal motion vector buffer / memory. Here, the motion vector may be referred to as a motion vector after correction. That is, the motion vector corrected during the motion compensation process of the current block or before the motion compensation process of the current block may be stored.

[0530] In the case of an intra block copy mode in which the current block uses a block vector so that a reconstructed area in the current image is used as a prediction block, at least one of the embodiments regarding the motion vector may be applied to the block vector of the current block. That is, when the block mode is the intra block copy mode, the embodiment in which the motion vector in the above-mentioned embodiment is replaced with the block vector may be applied.

[0531] In order to reduce the memory required to store the motion information of the reference picture, the motion information of the specific picture may be stored. In this case, the stored motion information of the specific picture may be used in at least one of the processes using the motion vector of the reference picture (such as generating a motion vector candidate list of blocks in the current picture / slice / tile and generating a merge candidate list).

[0532] The specific picture may represent a co-located picture. That is, the motion information of the co-located picture may be used in an encoding / decoding process using the motion information, such as inter-frame prediction of a picture to be encoded / decoded later. Here, the specific picture may represent a specific reference picture. Here, the motion information of the reference picture may represent temporal motion information. In addition, the motion vector of the reference picture may represent a temporal motion vector. The encoding / decoding process using the motion information, such as inter-frame prediction, may represent at least one of the encoding / decoding processes using the temporal motion vector.

[0533] The specific picture for the current picture / slice / tile may be at least one picture for each reference picture list. In addition, the specific picture for the current picture / slice / tile may be at least one picture for a plurality of reference picture lists.

[0534] In order to store the motion information of the specific picture, entropy encoding / decoding may be performed on a motion information storage indicator regarding whether at least one motion information in a picture, a slice, a tile, a CTU, a block is stored in at least one unit of the picture, the slice, the tile, the CTU, the block. The motion information storage indicator may be signaled in at least one of a picture parameter set, a slice header, a tile header, a CTU unit, and a block unit. The motion information storage indicator may be signaled using a high-level syntax element.

[0535] like Fig.37As shown in the example of , a motion information storage indicator (motion_info_stored_flag) indicating that motion information is stored in a picture parameter set of a current picture may be signaled so that the motion information of the current picture may be used for encoding / decoding a picture to be subsequently encoded / decoded.

[0536] For example, when the motion information storage indicator is a first value, this may indicate that the motion information is stored in the corresponding unit, and when the motion information storage indicator is a second value, this may indicate that the motion information is not stored in the corresponding unit. Here, the first value may indicate 1, and the second value may indicate 0. The motion information storage indicator may be signaled when at least one type of the current picture, slice, or tile is B, P, may not be signaled when at least one type of the current picture, slice, or tile is I, and may be inferred to be the second value.

[0537] When the motion information storage indicator is a first value, the picture may be used as a co-located picture of a picture to be subsequently encoded / decoded. In addition, when the motion information storage indicator is a second value, the corresponding picture may not be used as a co-located picture of a picture to be subsequently encoded / decoded.

[0538] like Fig.38 As shown in the example of , at least one of the same position direction information (collocated_from_l0_flag) and the same position picture index (collocated_ref_idx) in the picture to be subsequently encoded / decoded may be entropy encoded / decoded in at least one of the picture parameter set, the slice header, the parallel block header, the CTU unit, and the block unit. Here, the same position direction information may indicate whether the same position picture exists in the L0 reference picture list or the L1 reference picture list, and the same position picture index may indicate an index indicating the same position picture in the reference picture list. The same position picture index may be sent with a signal when at least one type of the current picture, the slice, or the parallel block is B or P, and may not be sent with a signal when at least one type of the current picture, the slice, or the parallel block is I, and may be inferred to be a value of 0.

[0539] exist Fig.38 In the slice_type parameter, slice_type may indicate the type of slice type among I, B, and P, and num_ref_idx_l0_active_minus1 and num_ref_idx_l1_active_minus1 may refer to the number of reference pictures in L0 and L1 reference picture lists.

[0540] Here, a co-located picture list for each of the L0 direction and the L1 direction is configured with a picture having a motion information storage indicator with a first value, and a co-located picture index may be entropy encoded / decoded to indicate a picture used as a co-located picture in the list. Here, the co-located picture index may be entropy encoded / decoded in a picture to be subsequently encoded / decoded. Here, a list consisting of pictures having a motion information storage indicator with a first value may be referred to as a co-located picture list.

[0541] In addition, a co-located picture list is configured with a picture having a motion information storage indicator with a first value, and entropy encoding / decoding is performed on the co-located picture index without performing entropy encoding / decoding on the co-located direction information, thereby indicating a picture used as the co-located picture in the list.

[0542] In addition, when there is at least one picture in the co-located picture list, the co-located picture index may be entropy encoded / decoded.

[0543] In addition, at least one co-located picture may be determined. For example, multiple co-located pictures may be used in encoding / decoding of a picture to be subsequently encoded / decoded. In this case, at least one co-located picture index may be entropy encoded / decoded in one picture.

[0544] A picture having a motion information storage indicator having a first value may be identified before configuring the co-located picture list.

[0545] The order of the co-located pictures can be arranged in the configured co-located picture list. In this case, the pictures can be sorted in the list in ascending order of the absolute value of the difference between the POC value of the co-located picture and the POC value of the current picture. In addition, the pictures can be sorted in the list in descending order of the absolute value of the difference between the POC value of the co-located picture and the POC value of the current picture.

[0546] The co-located picture list may be configured with pictures having the motion information storage indicator having a second value.

[0547] Fig.39 is a diagram illustrating an example of storing an indicator using motion information.

[0548] As in Fig.39In an example of , a motion information storage indicator may be signaled for each picture. In this case, when the motion information storage indicator indicates 1 as a first value, motion information of the picture may be stored. A co-located picture list may be configured with pictures having stored motion information. When there is at least one picture in the co-located picture list, a co-located picture index may be signaled. When there are multiple pictures in the co-located picture list, a co-located picture index for a picture selected as a co-located picture among the multiple pictures may be entropy encoded / decoded.

[0549] Fig.39 It is shown that there is one co-located picture list, but the present invention is not limited thereto, and at least one co-located picture list may be used. In addition, the same number of co-located picture lists as the number of reference picture lists may be used. In addition, when two or more co-located picture lists are used, the co-located direction information may be entropy encoded / decoded to indicate which co-located picture list is used. In this case, when three or more co-located picture lists are used, the co-located direction information may be entropy encoded / decoded in an index form rather than a flag form.

[0550] The number information of the same position pictures indicating the number of pictures included in the same position picture list can be sent to the decoder by signal from the encoder, and can be a value preset in the encoder and the decoder. For example, the number of the same position pictures can be fixed, and N is used in the encoder and the decoder. Here, N can be 0 or a positive integer. In addition, when a new same position picture is added to the same position picture list, the first added same position picture can be deleted from the list, and the new same position picture can be added to the list. The same position picture list can be managed in a first-in-first-out (FIFO) manner. In addition, the same position picture that is first added to the same position picture list can be assigned an index with a maximum value, and the same position picture that is last added can be assigned an index with a minimum value. On the contrary, the same position picture that is first added to the same position picture list can be assigned an index with a minimum value, and the same position picture that is last added can be assigned an index with a maximum value.

[0551] Fig.40 is a flowchart illustrating a method of encoding / decoding an image according to an embodiment of the present invention.

[0552] Reference Fig.40 The image encoding / decoding method includes a step of entropy encoding / decoding a motion information storage indicator (S4010), a step of configuring / arranging a list of same-position pictures (S4020), a step of entropy encoding / decoding a same-position picture index (S4030), and a step of performing motion compensation using a motion vector of the same-position picture (S4040).

[0553] exist Fig.40 In the step (S4010) of entropy encoding / decoding the motion information storage indicator, according to at least one of the above embodiments, entropy encoding / decoding of the motion information storage indicator may be performed for each picture.

[0554] In the step of configuring / arranging the co-located picture list ( S4020 ), the co-located picture list may be configured according to at least one of the above-described embodiments, and if necessary, the pictures in the co-located picture list may be arranged.

[0555] In the step of entropy encoding / decoding the co-located picture index ( S4030 ), entropy encoding / decoding the co-located picture index may be performed according to at least one of the above embodiments.

[0556] In the step of performing motion compensation using the motion vector of the co-located picture (S4040), a motion vector candidate list or a merge candidate list may be configured by using the motion vector of the co-located picture according to at least one of the embodiments, or motion compensation may be performed based on the motion vector.

[0557] As in Fig.41 In the example of , information about whether a specific reference picture is used in the current picture and information about whether motion information of the specific reference picture is used in the current picture may be entropy encoded / decoded together. That is, information about whether a specific reference picture is used in the current picture and information about whether motion information of the specific reference picture is used in the current picture may be signaled as one syntax element.

[0558] Reference Fig.41 When describing information related to the present invention, used_by_curr_pic_flag[j] may indicate that, in the case of a first value of 1, the jth reference picture is used in the current picture and the motion information of the reference picture is used, and in the case of a second value of 0, the jth reference picture is not used in the current picture and the motion information of the reference picture is not used.

[0559] Similarly, used_by_curr_pic_s0_flag[i] may indicate that, in the case of a first value of 1, the i-th reference picture is used in the current picture and the motion information of the reference picture is used, and in the case of a second value of 0, the i-th reference picture is not used in the current picture and the motion information of the reference picture is not used.

[0560] In addition, used_by_curr_pic_s1_flag[i] may indicate that, in the case of a first value of 1, the i-th reference picture is used in the current picture and the motion information of the reference picture is used, and in the case of a second value of 0, the i-th reference picture is not used in the current picture and the motion information of the reference picture is not used.

[0561] Here, at least one process of marking, constructing, and managing reference pictures may be equally applied to motion information of reference pictures.

[0562] For example, when a specific reference picture is marked as not used in the current picture, the motion information of the reference picture may also be marked as not used in the current picture.

[0563] For example, when a specific reference picture is marked as being used in a current picture, the motion information of the reference picture may also be marked as being used in the current picture.

[0564] For example, according to a method configured when a specific reference picture is configured as a reference picture list, motion information of the reference picture may also be configured as a reference picture list or a co-located picture list.

[0565] For example, when a specific reference picture is sequentially changed in a reference picture list, motion information of the reference picture may also be sequentially changed in the reference picture list or the collocated picture list according to the changing method.

[0566] As in Fig.42 In the example of , information about whether a specific reference picture is used in the current picture and information about whether motion information of the specific reference picture is used in the current picture may be separately entropy encoded / decoded. That is, information about whether a specific reference picture is used in the current picture and information about whether motion information of the specific reference picture is used in the current picture may be signaled as different syntax elements from each other.

[0567] Reference Fig.42 , when describing information related to the present invention, motion_used_by_curr_pic_flag[j] may indicate that, in case of a first value of 1, motion information of the j-th reference picture in the current picture is used, and in case of a second value of 0, motion information of the j-th reference picture in the current picture is not used.

[0568] Likewise, motion_used_by_curr_pic_s0_flag[i] may indicate that, in case of a first value of 1, the motion information of the i-th reference picture in the current picture is used, and in case of a second value of 0, the motion information of the i-th reference picture in the current picture is not used.

[0569] Also, motion_used_by_curr_pic_s1_flag[i] may indicate that, in case of a first value of 1, the motion information of the i-th reference picture in the current picture is used, and in case of a second value of 0, the motion information of the i-th reference picture in the current picture is not used.

[0570] Here, at least one process of marking, constructing, and managing the reference picture may be applied separately from the motion information of the reference picture.

[0571] For example, when a specific reference picture is marked as not used in the current picture, the motion information of the reference picture may be marked as used in the current picture or marked as not used in the current picture.

[0572] For example, when a specific reference picture is marked as being used in a current picture, motion information of the reference picture may be marked as being used in the current picture or marked as not being used in the current picture.

[0573] For example, when a specific reference picture is configured using a reference picture list, motion information of the reference picture may also be configured with or without the reference picture list or the co-located picture list.

[0574] Furthermore, when a specific reference picture is changed in sequence in a reference picture list, motion information of the reference picture may or may not be changed in sequence in the reference picture list or the collocated picture list.

[0575] When the reference picture is a short-term reference picture, the motion information of the reference picture may be stored. In addition, when the reference picture is a long-term reference picture, the motion information of the reference picture may not be stored.

[0576] Without signaling a motion information storage indicator, the encoder / decoder may store motion information of a specific picture according to a value of a specific parameter. Here, when the motion information of a specific picture is stored, the motion information of the specific picture may be used in a picture that is subsequently encoded / decoded.

[0577] For example, when the temporal layer ID of a specific picture is less than M, the motion information of the specific picture may be stored. Here, M may be 0 or a positive integer.

[0578] For example, when an absolute value of a difference between a picture order count (POC) of a specific picture and a POC of a current picture is less than J, the motion information of the specific picture may be stored. Here, J may be 0 or a positive integer.

[0579] Without signaling the motion information storage indicator, when a specific picture is included in at least one of the L0 directional reference picture list and the L1 directional reference picture list, motion information of the specific picture may be stored.

[0580] When the motion information is stored in the current image according to the precision of the predetermined motion vector, the motion vector precision information may be entropy encoded / decoded. The motion vector precision information may indicate that the motion vector is stored in at least one unit of integer pixel units, 2 integer pixel units, 4 integer pixel units, 1 / 2 pixel units, 1 / 4 pixel units, 1 / 8 pixel units, 1 / 16 pixel units, etc. Here, not only the motion vector precision of the pixel unit may be present, but also the motion vector precision of N pixel units or 1 / N pixel units may be present. Here, N may be a positive integer. The encoder / decoder may store the motion information according to the motion vector precision information. When the motion information storage indicator is a first value, the motion vector precision information may be entropy encoded / decoded. In addition, the motion vector precision may be entropy encoded / decoded in the form of a flag or an index, and may be entropy encoded / decoded in the form of a flag or an index for several selected units among several units predetermined in the encoder / decoder.

[0581] The encoder and the decoder in the above-described embodiments enable only pictures having a motion information storage indicator of the first value to be determined as co-located pictures used in the encoding / decoding process.

[0582] In the above-described embodiments, when a picture to be subsequently encoded / decoded is a current picture, the current picture may be referred to as a previously encoded / decoded picture.

[0583] In the above-described embodiment, L0 motion information and L1 motion information of the reference picture may be stored, but the present invention is not limited thereto. Only L0 motion information may be stored or only L1 motion information may be stored.

[0584] In the above embodiment, L0 motion information and L1 motion information of the reference picture, and at least 7 motion information of the first L0 motion information, the second L0 motion information, the first L1 motion information, the second L1 motion information, the L2 motion information, and the L3 motion information may be stored. Here, the first L0 motion information and the first L1 motion information may be basic motion information of a specific block, and the second L0 motion information, the second L1 motion information, the L2 motion information, and the L3 motion information may be additional motion information in addition to the basic motion information of the specific block. For example, the additional motion information may be peripheral motion information of the specific block or motion information additionally used for motion compensation.

[0585] In the above-mentioned embodiments, it has been described that the co-located picture in which the motion information is stored in picture units, but the present invention is not limited thereto, and the motion information may be stored in at least one unit of a picture, a slice, a tile, a CTU, and a block.

[0586] Fig.43 is a flowchart illustrating an image decoding method according to an embodiment of the present invention.

[0587] Reference Fig.43 , the image decoding apparatus may obtain, in the temporal motion buffer, a motion vector of a co-located block included in a reference picture of a current block (S4301).

[0588] Also, the image decoding apparatus may change the format of the motion vector obtained in step S4301 (S4302).

[0589] In step S4302, the format of the obtained motion vector may be changed to a format having an increased bit depth.

[0590] In addition, in step S4302, the format of the obtained motion vector may be changed to a predetermined format. Here, the predetermined format may be a fixed bit format including a sign. For example, the predetermined format may be an 18-bit format including a sign.

[0591] In addition, the format of the obtained motion vector may be a floating point format. For example, the motion vector obtained from the temporal motion buffer may be in a 10-bit floating point format (or a 6-bit mantissa and 4-bit exponent format).

[0592] In step S4302, the image decoding apparatus may derive the motion vector whose format is changed in step S4302 as a temporal motion vector of the current block (S4303).

[0593] In addition, the image decoding device may further perform the steps of scaling the derived temporal motion vector and limiting the dynamic range of the scaled temporal motion vector after step S4303.

[0594] Here, the step of limiting the dynamic range of the scaled temporal motion vector may limit the dynamic range of the scaled temporal motion vector to a fixed bit depth. For example, the fixed bit depth may be 18 bits.

[0595] Referenced above Fig.43 A method for decoding an image is described. Fig.43 The described video decoding method is similar to the description of the video encoding method of the present invention, so redundant description is omitted.

[0596] A bit stream generated by the image encoding method of the present invention may be temporarily stored in a computer-readable non-transitory recording medium, and may be decoded by the above-mentioned image decoding method.

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

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

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

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

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

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

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

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

[0605] For example, when the temporal layer of the current image is the lowest layer, the above embodiment may be applied. For example, when the temporal layer identifier of the current image is equal to or greater than 1, the above embodiment may be applied. For example, when the temporal layer of the current image is the highest layer, the above embodiment may be applied.

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

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

[0608] The embodiments include various aspects of the examples. All possible combinations for various aspects may not be described, but those skilled in the art will be able to recognize different combinations. Therefore, the present invention may include all substitutions, modifications and changes within the scope of the claims.

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

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

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

[0612] Industrial Applicability

[0613] The present invention can be used in an apparatus for encoding / decoding an image.

Claims

1. A method for decoding an image, the method comprising: Constructing a motion vector candidate list of the current block, the motion vector candidate list including spatial motion vector candidates and temporal motion vector candidates; The motion vector of the current block is obtained by adding the motion vector predictor selected from the motion vector predictor list and the motion vector difference, Among them, the spatial motion vector candidate is derived from the motion vector of the spatial neighboring blocks of the current block. The temporal motion vector candidate is derived from the modified motion vector of the same-position block as the current block. The modified motion vector of the same-position block is obtained by the following steps: changing the representation format of the motion vector of the same-position block obtained from the temporal motion buffer, and Therein, changing the representation format is performed for deriving temporal motion vector candidates, but is not applied for deriving spatial motion vector candidates.

2. The method of claim 1, wherein: The bit length of the modified motion vector is larger than the motion vector of the co-located block obtained from the temporal motion buffer.

3. The method of claim 1, wherein: The motion vector in the floating point format is changed into a modified motion vector of a fixed bit length by changing the representation format.

4. The method of claim 3, further comprising: Scaling the modified temporal motion vector of the co-located block; and The scaled modified motion vectors are clipped within the dynamic range of the fixed bit length.

5. The method of claim 3, wherein: The motion vector in the floating point format consists of a 6-bit signed mantissa and a 4-bit exponent, and the fixed bit length is 18 bits.

6. A method for encoding an image, the method comprising: Constructing a motion vector candidate list of the current block, the motion vector candidate list including spatial motion vector candidates and temporal motion vector candidates; Get the motion vector of the current block; encoding a motion vector difference derived by subtracting a motion vector predictor selected from a list of motion vector predictors from the motion vector, Among them, the spatial motion vector candidate is derived from the motion vector of the spatial neighboring blocks of the current block. The temporal motion vector candidate is derived from the modified motion vector of the same-position block as the current block. The modified motion vector of the same-position block is obtained by the following steps: changing the representation format of the motion vector of the same-position block obtained from the temporal motion buffer, and Therein, changing the representation format is performed for deriving temporal motion vector candidates, but is not applied for deriving spatial motion vector candidates.

7. A computer-readable non-transitory recording medium comprising a bit stream encoded by an encoding method, the encoding method comprising: Constructing a motion vector candidate list of the current block, the motion vector candidate list including spatial motion vector candidates and temporal motion vector candidates; Get the motion vector of the current block; encoding a motion vector difference derived by subtracting a motion vector predictor selected from a list of motion vector predictors from the motion vector, Among them, the spatial motion vector candidate is derived from the motion vector of the spatial neighboring blocks of the current block. The temporal motion vector candidate is derived from the modified motion vector of the same-position block as the current block. The modified motion vector of the same-position block is obtained by the following steps: changing the representation format of the motion vector of the same-position block obtained from the temporal motion buffer, and Therein, changing the representation format is performed for deriving temporal motion vector candidates, but is not applied for deriving spatial motion vector candidates.