Image decoding method and image encoding method

JP2025027032AActive Publication Date: 2025-02-26ELECTRONICS & TELECOMM RES INST
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
JP2024206209
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Priority Date
2016-05-24
Filing Date
2024-11-27
Publication Date
2025-02-26
Estimated Expiration
2037-05-23

AI Technical Summary

Benefits of technology

【0015】 本発明では、画像の符号化/復号効率を向上させるために組み合わせ動きベクトル候補を用いて動き補償を行う方法及び装置が提供される。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2025027032000001_ABST
    Figure 2025027032000001_ABST
Patent Text Reader

Abstract

To provide image encoding / decoding method and apparatus that perform motion compensation using motion vector prediction.SOLUTION: An image decoding method includes deriving a first motion vector by summing a first motion vector predictor and a first motion vector differential, deriving a second motion vector by summing a second motion vector predictor and a second motion vector differential, determining a first reference image and a second reference image, obtaining a first prediction block and a second prediction block from the first reference image and the second reference image on the basis of the first motion vector and the second motion vector, and obtaining a final prediction block on the basis of the first prediction block and the second prediction block. The difference information is explicitly signaled only for the first motion vector differential, and when the difference information is explicitly signaled only for the first motion vector differential, the size of the second motion vector differential is derived to be the same as the size of the first motion vector differential.SELECTED DRAWING: Figure 13
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present invention relates to an image encoding / decoding method and apparatus, and more particularly to a method and apparatus for performing motion compensation using motion vector prediction. [Background technology]

[0002] Recently, the demand for high-resolution, high-quality images, for example, HD (High Definition) images and UHD (Ultra High Definition) images, is increasing in various application fields. As the resolution and quality of image data increases, the amount of data increases relatively compared to conventional image data. Therefore, when the image data is transmitted using conventional media such as wired or wireless broadband lines or stored using conventional storage media, the transmission and storage costs increase. In order to solve the problems that arise with the increase in the resolution and quality of image data, a highly efficient image encoding / decoding technology for images with higher resolution and image quality is required.

[0003] There are various image compression techniques, such as inter-prediction techniques that predict pixel values ​​contained in a current picture from pictures before or after the current picture, intra-prediction techniques that predict pixel values ​​contained in a current picture using pixel information in the current picture, transformation and quantization techniques for compressing the energy of residual signals, and entropy coding techniques that assign short codes to values ​​that occur frequently and long codes to values ​​that occur less frequently. By using such image compression techniques, image data can be effectively compressed and transmitted or stored.

[0004] In conventional motion compensation, only spatial motion vector candidates, temporal motion vector candidates, and zero motion vector candidates are added to a motion vector candidate list and used, and only unidirectional prediction and bidirectional prediction are used, so there is a limit to improving coding efficiency. Summary of the Invention [Problem to be solved by the invention]

[0005] The present invention can provide a method and apparatus for performing motion compensation using combined motion vector candidates to improve image encoding / decoding efficiency.

[0006] The present invention provides a method and apparatus for performing motion compensation using unidirectional prediction, bidirectional prediction, tridirectional prediction, and quaternary prediction to improve image encoding / decoding efficiency. [Means for solving the problem]

[0007] The image decoding method of the present invention may include the steps of generating a plurality of motion vector candidate lists according to an inter prediction direction of a current block, deriving a plurality of motion vectors for the current block using the plurality of motion vector candidate lists, determining a plurality of predictive blocks for the current block using the plurality of motion vectors, and obtaining a final predictive block for the current block based on the plurality of predictive blocks.

[0008] The image encoding method of the present invention may include the steps of generating a plurality of motion vector candidate lists according to an inter prediction direction of a current block, deriving a plurality of motion vectors for the current block using the plurality of motion vector candidate lists, determining a plurality of predictive blocks for the current block using the plurality of motion vectors, and obtaining a final predictive block for the current block based on the plurality of predictive blocks.

[0009] In the image decoding / encoding method, the inter-prediction direction indicates one-way or multi-way prediction, and the multi-way prediction may include prediction in three or more directions.

[0010] In the image decoding / encoding method, the motion vector candidate list may be generated for each reference image list.

[0011] In the image decoding / encoding method, the motion vector candidate list may include at least one of spatial motion vector candidates derived from spatially neighboring blocks of the current block, temporal motion vector candidates derived from corresponding position blocks of the current block, and motion vector candidates of predefined values.

[0012] In the image decoding / encoding method, the motion vector candidate list may include a combined motion vector candidate generated by combining two or more of the spatial motion vector candidate, the temporal motion vector candidate, and the predefined value motion vector candidate.

[0013] In the image decoding / encoding method, the final predicted block may be determined based on a weighted sum of the multiple predicted blocks.

[0014] In the image decoding / encoding method, weights applied to the plurality of predicted blocks may be determined based on a weighted prediction value and a weighted differential value. Effect of the Invention

[0015] In the present invention, a method and apparatus for performing motion compensation using combined motion vector candidates to improve image encoding / decoding efficiency is provided.

[0016] The present invention provides a method and apparatus for performing motion compensation using unidirectional prediction, bidirectional prediction, tridirectional prediction, and quaternary prediction to improve image encoding / decoding efficiency. [Brief description of the drawings]

[0017] [Figure 1] 1 is a block diagram showing a configuration of an embodiment of an encoding device to which the present invention is applied. [Diagram 2] 1 is a block diagram showing a configuration of a decoding device according to an embodiment of the present invention; [Diagram 3]FIG. 2 is a schematic diagram showing an image division structure when encoding and decoding an image. [Figure 4] FIG. 2 is a diagram showing the form of a prediction unit (PU) that can be included in a coding unit (CU). [Diagram 5] A diagram showing the form of a transform unit (TU) that can be included in a coding unit (CU). [Figure 6] FIG. 1 is a diagram for explaining an embodiment of an intra-prediction process. [Figure 7] FIG. 1 is a diagram for explaining an embodiment of an inter prediction process. [Figure 8] FIG. 13 is a diagram illustrating a transform set according to an intra prediction mode. [Figure 9] FIG. 11 is a diagram for explaining a conversion process. [Figure 10] FIG. 2 is a diagram illustrating scanning of quantized transform coefficients. [Figure 11] FIG. 13 is a diagram for explaining block division. [Figure 12] 1 is a flowchart illustrating an image coding method according to the present invention. [Figure 13] 2 is a flowchart illustrating an image decoding method according to the present invention. [Figure 14] 11 is a diagram for explaining an example of deriving spatial motion vector candidates for a current block. FIG. [Figure 15] 11 is a diagram for explaining an example of deriving a temporal motion vector candidate for a current block; FIG. [Figure 16] FIG. 13 illustrates an example of scaling a motion vector of a corresponding position block to derive a candidate temporal motion vector for a current block. [Figure 17] FIG. 13 is a diagram showing an example in which a motion vector candidate list is generated. [Figure 18] FIG. 13 is a diagram showing an example of adding a motion vector having a predetermined value to a motion vector candidate list. [Figure 19] FIG. 13 is a diagram showing an example in which a motion vector candidate is removed from a motion vector candidate list. [Figure 20]FIG. 13 is a diagram showing an example of a motion vector candidate list. [Figure 21] FIG. 13 illustrates an example of deriving a predicted motion vector candidate for a current block from a motion vector candidate list. [Figure 22A] FIG. 13 illustrates a syntax for information about motion compensation. [Figure 22B] FIG. 13 illustrates a syntax for information about motion compensation. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0018] Since the present invention can be modified in various ways and can have various embodiments, a specific embodiment is illustrated in the drawings and described in detail in the detailed description. However, this does not limit the present invention to a specific embodiment, and it should be understood that it includes all modifications, equivalents, or alternatives within the spirit and technical scope of the present invention. In the drawings, similar reference symbols indicate the same or similar functions in various aspects. The shape and size of elements in the drawings may be exaggerated for more clear explanation. The detailed description of the exemplary embodiments described below refers to the attached drawings showing specific embodiments as examples. These embodiments are described in sufficient detail to enable those skilled in the art to implement the embodiments. It should be understood that the various embodiments are different from each other, but are not necessarily mutually exclusive. For example, the specific shapes, structures, and characteristics described herein can be realized in various embodiments without departing from the spirit and scope of the present invention in relation to one embodiment. It should also be understood that the position or arrangement of individual components in each disclosed embodiment can be changed without departing from the spirit and scope of the embodiment. Accordingly, the following detailed description is not to be taken in a limiting sense, and the scope of the exemplary embodiments is limited only by the appended claims, if properly recited, and to the full extent of equivalents to which those claims are entitled.

[0019] In the present invention, the terms "first", "second", etc. may be used to describe various components, but these components should not be limited by the above terms. These terms are used only to distinguish one component from another. For example, a first component can be named a second component, and similarly, a second component can be named a first component, without departing from the scope of the present invention. The term "and / or" includes any combination of two or more related listed items or two or more related listed items.

[0020] When a component of the present invention is described as being "coupled" or "connected" to another component, it should be understood that the component may be directly coupled or connected to the other component, but there may be other components between them. In contrast, when a component is described as being "directly coupled" or "directly connected" to another component, it should be understood that there are no other components between them.

[0021] The components shown in the embodiments of the present invention are illustrated independently to show different characteristic functions, and do not mean that each component is composed of separate hardware or a single software unit. That is, each component is included in each component for convenience of explanation, and at least two components among the components can be combined to form a single component, or each component can be divided into multiple components to perform a function, and such integrated and separated embodiments of each component are also included in the scope of the present invention as long as they do not deviate from the essence of the present invention.

[0022] The terms used in the present invention are merely used to describe certain embodiments and are not intended to limit the present invention. A singular expression includes a plural expression unless the context clearly indicates otherwise. In the present invention, the terms "include" or "have" specify the presence of features, numbers, steps, operations, components, parts, or combinations thereof described in the specification, and should be understood not to preclude the presence or additional possibility of one or more other features, numbers, steps, operations, components, parts, or combinations thereof. In other words, in the present invention, the content described as "including" a specific configuration does not exclude configurations other than the corresponding configuration, and means that additional configurations may be included in the implementation of the present invention or the technical idea of ​​the present invention.

[0023] Some components of the present invention may not be essential components performing essential functions in the present invention, but may be optional components merely for improving performance. The present invention can be realized by including only components essential for realizing the essence of the present invention, excluding components merely used for improving performance, and a structure including only essential components, excluding optional components merely used for improving performance, is also included in the scope of the present invention.

[0024] Hereinafter, the embodiments of the present invention will be described in detail with reference to the drawings. In describing the embodiments of the present specification, if it is determined that a detailed description of related known configurations or functions may obscure the gist of the specification, the detailed description will be omitted, and the same reference numerals will be used for the same components in the drawings, and duplicate descriptions of the same components will be omitted.

[0025] In the following, an image may mean one picture constituting a video, or may refer to the video itself. For example, "encoding and / or decoding an image" may mean "encoding and / or decoding a video" or "encoding and / or decoding one of the images constituting a video." Here, a picture may have the same meaning as an image.

[0026] Terminology

[0027] Encoder: Can refer to a device that performs encoding.

[0028] Decoder: Can refer to a device that performs decoding.

[0029] Parsing: Parsing can refer to determining the value of a syntax element by entropy decoding, or it can refer to entropy decoding itself.

[0030] Block: An MxN array of samples, where M and N are positive integer values, and a block can generally refer to a two-dimensional array of samples.

[0031] Sample: A basic unit constituting a block, which can express values ​​from 0 to 2Bd-1 depending on the bit depth (Bd). In the present invention, the terms picture element and pixel can be used interchangeably with sample.

[0032] Unit: may refer to a unit of image encoding and decoding. In image encoding and decoding, a unit may be an area generated by dividing an image. Also, when an image is divided into smaller units for encoding or decoding, a unit may refer to the divided units. In image encoding and decoding, a predefined process may be performed for each unit. A unit may be further divided into subunits having a smaller size than the unit. Depending on the function, a unit may refer to 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 transform unit, a transform block, etc. Also, a unit may refer to including a luma component block, a corresponding chroma component block, and a syntax element for each block in order to distinguish and indicate the unit from a block. The unit may have various sizes and shapes, and in particular, the shape of the unit may include not only a rectangle but also geometric shapes that can be expressed two-dimensionally, such as a square, a trapezoid, a triangle, a pentagon, etc. Also, the unit information may include at least one of a unit type indicating a coding unit, a prediction unit, a transform unit, etc., a unit size, a unit depth, a unit encoding and decoding order, etc.

[0033] Reconstructed Neighbor Unit: This can refer to a unit that has already been encoded or decoded and reconstructed spatially / temporally around a unit to be encoded / decoded. In this case, the reconstructed neighbor unit can refer to a reconstructed neighbor block.

[0034] Neighbor block: This may refer to a block adjacent to the block to be coded / decoded. The block adjacent to the block to be coded / decoded may refer to a block whose boundary is adjacent to the block to be coded / decoded. The neighbor block may refer to a block located at an adjacent vertex of the block to be coded / decoded. The neighbor block may also refer to a reconstructed neighbor block.

[0035] Unit Depth: This refers to the degree to which a unit is divided. In a tree structure, the root node has the shallowest depth, and the leaf node has the deepest depth.

[0036] Symbol: This can refer to a syntax element of a unit to be coded / decoded, a coding parameter, a value of a transform coefficient, etc.

[0037] Parameter Set: This may correspond to header information among structures in a bitstream, and may include at least one of a video parameter set, a sequence parameter set, a picture parameter set, and an adaptation parameter set. In addition, the parameter set may include slice header and tile header information.

[0038] Bitstream: Can mean a string of bits that contains encoded image information.

[0039] Prediction unit: A basic unit for performing inter prediction or intra prediction and compensation therefor. One prediction unit may be divided into a plurality of partitions having a small size. In this case, each of the plurality of partitions may be a basic unit for performing the prediction and compensation, and the partition into which the prediction unit is divided may also be a prediction unit. The prediction unit may have various sizes and shapes, and in particular, the shape of the prediction unit may include not only a rectangle but also geometric shapes that can be expressed two-dimensionally, such as a square, a trapezoid, a triangle, and a pentagon.

[0040] Prediction Unit Partition: This may refer to the shape in which a prediction unit is divided.

[0041] Reference Picture List: This can refer to a list containing one or more reference pictures used for inter prediction or motion compensation. Types of reference picture lists can include LC (List Combined), L0 (List 0), L1 (List 1), L2 (List 2), L3 (List 3), etc. Inter prediction can use one or more reference picture lists.

[0042] Inter Prediction Indicator: This may mean the inter prediction direction (unidirectional prediction, bidirectional prediction, etc.) of a block to be coded / decoded during inter prediction, may mean the number of reference images used when a block to be coded / decoded generates a predicted block, or may mean the number of predicted blocks used when a block to be coded / decoded performs inter prediction or motion compensation.

[0043] Reference Picture Index: This may refer to an index to a particular reference picture from a reference picture list.

[0044] Reference Picture: This can refer to an image that a specific unit refers to for inter prediction or motion compensation, and a reference picture can also be called a reference picture.

[0045] Motion Vector: A two-dimensional vector used in inter prediction or motion compensation, which may indicate an offset between a picture to be coded / decoded and a reference picture. For example, (mvX, mvY) may indicate a motion vector, where mvX indicates the horizontal component and mvY indicates the vertical component.

[0046] Motion Vector Candidate: This can refer to a unit that is a prediction candidate when predicting a motion vector, or the motion vector of that unit.

[0047] Motion Vector Candidate List: This may refer to a list constructed using motion vector candidates.

[0048] Motion Vector Candidate Index: An indicator that indicates a motion vector candidate in a motion vector candidate list, and can also be called an index of a motion vector predictor.

[0049] Motion Information: This can refer to information including at least one of a motion vector, a reference image index, an inter prediction indicator, reference image list information, a reference image, a motion vector candidate, a motion vector candidate index, etc.

[0050] Merge Candidate List: This may refer to a list constructed using merge candidates.

[0051] Merge Candidate: may include spatial merge candidates, temporal merge candidates, combined merge candidates, combined bi-predictive merge candidates, zero merge candidates, etc., and the merge candidate may include motion information such as prediction type information, a reference picture index for each list, and a motion vector.

[0052] Merge Index: This may refer to information indicating a merge candidate in a merge candidate list. Also, the merge index may indicate a block from which the merge candidate is derived among blocks reconstructed to be adjacent to the current block spatially / temporally. Also, the merge index may indicate at least one of the motion information held by the merge candidate.

[0053] Transform Unit: A basic unit for performing residual signal coding / decoding such as transformation, inverse transformation, quantization, inverse quantization, and transform coefficient coding / decoding, and one transform unit can be divided into multiple transform units of smaller size. Transform units can have various sizes and shapes, and in particular, the shape of a transform unit can include geometric shapes that can be expressed two-dimensionally, such as not only rectangles but also squares, trapezoids, triangles, and pentagons.

[0054] Scaling: can refer to the process of multiplying transform coefficient levels by a factor, resulting in transform coefficients. Scaling can also be called dequantization.

[0055] Quantization Parameter: This can refer to a value used when scaling a transform coefficient level in quantization and inverse quantization. In this case, the quantization parameter can be a value mapped to a quantization step size.

[0056] Delta Quantization Parameter: This may refer to a difference value between a predicted quantization parameter and a quantization parameter of a unit to be coded / decoded.

[0057] Scan: This can refer to a method of sorting the order of coefficients in a block or matrix. For example, sorting a two-dimensional array into a one-dimensional array is called a scan, and sorting a one-dimensional array into a two-dimensional array can also be called a scan or inverse scan.

[0058] Transform Coefficient: A coefficient value generated after transformation. In the present invention, the quantized transform coefficient level obtained by applying quantization to a transform coefficient may also be included in the meaning of the transform coefficient.

[0059] Non-zero Transform Coefficient: This can refer to a transform coefficient whose magnitude of a transform coefficient value is not zero, or a transform coefficient level whose magnitude of a value is not zero.

[0060] Quantization Matrix: A matrix used in quantization or inverse quantization to improve the subjective or objective image quality of an image. A quantization matrix can also be called a scaling list.

[0061] Quantization Matrix Coefficient: It can refer to each element in a quantization matrix. The quantization matrix coefficient can also be called a matrix coefficient.

[0062] Default Matrix: This may refer to a predetermined quantization matrix that is predefined in the encoder and decoder.

[0063] Non-default Matrix: This may refer to a quantization matrix that is not predefined in the encoder and decoder and is transmitted / received by the user.

[0064] Coding Tree Unit: Can be composed of one luminance (Y) coding tree block and two associated chrominance (Cb, Cr) coding tree blocks. Each coding tree unit can be divided using one or more partitioning methods such as quad tree, binary tree, etc. to compose subunits such as coding units, prediction units, and transform units. Can be used as a term to indicate pixel blocks that are the processing units in image decoding / encoding processes, such as division of an input image.

[0065] Coding Tree Block: A term that can be used to refer to any of the Y coding tree block, the Cb coding tree block, and the Cr coding tree block.

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

[0067] The encoding device 100 may be a video encoding device or an image encoding device. A video may include one or more images. The encoding device 100 may encode one or more images of a video in a time-sequential manner.

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

[0069] The encoding device 100 may perform encoding on an input image in intra mode and / or inter mode. The encoding device 100 may generate a bitstream through encoding on the input image and output the generated bitstream. When an intramode is used as a prediction mode, the switch 115 may be switched to intra. When an intermode is used as a prediction mode, the switch 115 may be switched to inter. Here, the intramode may mean an intra prediction mode, and the intermode may mean an inter prediction mode. The encoding device 100 may generate a prediction block for an input block of an input image. After the prediction block is generated, the encoding device 100 may encode a residual between the input block and the prediction block. The input image may be referred to as a current image currently being encoded. The input block may be referred to as a current block currently being encoded or a block to be encoded.

[0070] When the prediction mode is the intra mode, the intra prediction unit 120 may also use pixel values ​​of a block already encoded in the vicinity of the current block as reference pixels. The intra prediction unit 120 may perform spatial prediction using the reference pixels and generate a prediction sample for an input block through spatial prediction. Here, intra prediction may refer to intra prediction.

[0071] When the prediction mode is an inter mode, the motion prediction unit 111 can search for an area that best matches the input block in a reference image in the motion prediction process, and can derive a motion vector using the searched area. The reference image can be stored in the reference picture buffer 190.

[0072] The motion compensation unit 112 may generate a prediction block by performing motion compensation using a motion vector. Here, the motion vector may be a two-dimensional vector used for inter prediction. Also, the motion vector may indicate an offset between a current image and a reference image. Here, the inter prediction may mean an inter frame prediction.

[0073] The motion prediction unit 111 and the motion compensation unit 112 may generate a prediction block by applying an interpolation filter to a part of a reference image when the value of a motion vector does not have an integer value. In order to perform inter prediction or motion compensation, it may be determined whether a motion prediction and motion compensation method of a prediction unit included in a corresponding coding unit is a skip mode, a merge mode, an AMVP mode, or a current picture reference mode, based on a coding unit, and inter prediction or motion compensation may be performed according to each mode. Here, the current picture reference mode may mean a prediction mode using an already reconstructed area in a current picture to which a coding target block belongs. In order to identify the already reconstructed area, a motion vector for the current picture reference mode may be defined. Whether or not a coding target block is coded in the current picture reference mode may be coded using a reference image index of the coding target block.

[0074] The subtractor 125 may use the difference between the input block and the predicted block to generate a residual block, also referred to as a residual signal.

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

[0076] By applying quantization to the transform coefficients, a quantized transform coefficient level can be generated. Hereinafter, in the embodiments, the quantized transform coefficient level may also be referred to as a transform coefficient.

[0077] The quantization unit 140 may generate a quantized transform coefficient level by quantizing the transform coefficient based on the quantization parameter, and may output the quantized transform coefficient level. In this case, the quantization unit 140 may quantize the transform coefficient using a quantization matrix.

[0078] The entropy coding unit 150 can generate a bitstream by performing entropy coding based on a probability distribution on a value calculated by the quantization unit 140 or a coding parameter value calculated in the coding process, and can output the bitstream. The entropy coding unit 150 can perform entropy coding on information for decoding the image in addition to information on pixels of the image. For example, the information for decoding the image can include syntax elements, etc.

[0079] When entropy coding is applied, a small number of bits are assigned to symbols having a high occurrence probability, and a large number of bits are assigned to symbols having a low occurrence probability to represent the symbols, thereby reducing the size of a bit string for a symbol to be coded. Thus, the compression performance of image coding can be improved through entropy coding. The entropy coding unit 150 can use coding methods such as exponential Golomb, CAVLC (Context-Adaptive Variable Length Coding), and CABAC (Context-Adaptive Binary Arithmetic Coding) for entropy coding. For example, the entropy coding unit 150 can perform entropy coding using a variable length coding / code (VLC) table. In addition, the entropy coding unit 150 can derive a binarization method for a target symbol and a probability model for a target symbol / bin, and then perform arithmetic coding using the derived binarization method or probability model.

[0080] The entropy coding unit 150 may change two-dimensional block shape coefficients into one-dimensional vectors through a transform coefficient scanning method in order to code transform coefficient levels. For example, the entropy coding unit 150 may change the two-dimensional block shape coefficients into one-dimensional vectors by scanning the coefficients of the block using upright scanning. Instead of upright scanning, vertical scanning, which scans two-dimensional block shape coefficients in a column direction, or horizontal scanning, which scans two-dimensional block shape coefficients in a row direction, may be used depending on the size of the transform unit and the intra prediction mode. That is, it may be determined which scanning method is used among upright scanning, vertical scanning, and horizontal scanning, depending on the size of the transform unit and the intra prediction mode.

[0081] The coding parameters may include not only information encoded by an encoder and transmitted to a decoder like syntax elements, but also information derived in an encoding or decoding process, and may refer to information required for encoding or decoding an image. For example, the coding parameters may include a block size, a block depth, block partition information, a unit size, a unit depth, a unit partition information, a quadtree partition flag, a binary tree partition flag, a binary tree partition direction, an intra prediction mode, an intra prediction direction, a reference sample filtering method, a prediction block boundary filtering method, a filter tap, a filter coefficient, an inter prediction mode, motion information, a motion vector, a reference image index, an inter prediction direction, an inter prediction indicator, a reference image list, a motion vector prediction, a motion vector candidate list, whether or not a motion merge mode is used, a motion merge candidate, a motion merge candidate list, whether or not a skip mode is used, a type of an interpolation filter, a size of a motion vector, a precision of a motion vector representation, a type of transformation, a transformation size, information on whether or not an additional (secondary) transformation is used, information on the presence or absence of a residual signal, a coded block pattern, a coded block flag, and the like. The coding parameters may include at least one value or a combination form of an in-loop filter flag, quantization parameter, quantization matrix, in-loop filter information, information on whether to apply an in-loop filter, in-loop filter coefficient, binarization / de-binarization method, context model, context bin, bypass bin, transform coefficient, transform coefficient level, transform coefficient level scanning method, image display / output order, slice identification information, slice type, slice division information, tile identification information, tile type, tile division information, picture type, bit depth, and information on a luminance signal or a chrominance signal.

[0082] The residual signal may mean a difference between an original signal and a predicted signal. Alternatively, the residual signal may be a signal generated by transforming the difference between an original signal and a predicted signal. Alternatively, the residual signal may be a signal generated by transforming and quantizing the difference between an original signal and a predicted signal. The residual block may be a block-based residual signal.

[0083] When the encoding device 100 performs encoding using inter prediction, the encoded current image can be used as a reference image for other images to be processed later. Thus, the encoding device 100 can further decode the encoded current image and store the decoded image as a reference image. For decoding, inverse quantization and inverse transformation can be performed on the encoded current image.

[0084] The quantized coefficients may be dequantized in an inverse quantization unit 160 and inverse transformed in an inverse transform unit 170. The dequantized and inverse transformed coefficients may be combined with a prediction block via an adder 175. A reconstructed block may be generated by combining the dequantized and inverse transformed coefficients with the prediction block.

[0085] The reconstructed block may pass through a 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 block or the reconstructed image. The filter unit 180 may also be referred to as an in-loop filter.

[0086] The deblocking filter can remove block noise that occurs at the boundary between blocks. In order to determine whether to perform the deblocking filter, it can be determined whether to apply the deblocking filter to the current block based on pixels included in several columns or rows included in the block. When applying the deblocking filter to the block, a strong filter or a weak filter can be applied according to the required deblocking filtering strength. In addition, when applying the deblocking filter, horizontal filtering and vertical filtering can be processed in parallel during vertical filtering and horizontal filtering.

[0087] The sample adaptive offset can add an appropriate offset value to a pixel value to compensate for encoding errors. The sample adaptive offset can correct the offset between a deblocked image and an original image on a pixel-by-pixel basis. In order to perform offset correction for a specific picture, a method of dividing pixels included in an image into a certain number of regions, determining a region to be offset, and applying an offset to the corresponding region, or a method of applying an offset by considering edge information of each pixel can be used.

[0088] The adaptive loop filter can perform filtering based on a value obtained by comparing a reconstructed image with an original image. After dividing pixels included in an image into predetermined groups, a filter to be applied to the group is determined, and filtering can be performed differentially for each group. Information related to whether or not to apply an adaptive loop filter can be transmitted for each coding unit (CU) of a luminance signal, and the shape and filter coefficients of the adaptive loop filter applied can be different depending on each block. In addition, an adaptive loop filter of the same type (fixed type) can be applied regardless of the characteristics of the block to which it is applied.

[0089] The reconstructed blocks that have passed through the filter unit 180 can be stored in a reference picture buffer 190.

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

[0091] The decoding device 200 may be a video decoding device or an image decoding device.

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

[0093] The decoding device 200 can receive a bitstream output from the encoding device 100. The decoding device 200 can perform decoding on the bitstream in an intra mode or an inter mode. The decoding device 200 can also generate a reconstructed image through decoding and output the reconstructed image.

[0094] If the prediction mode used for decoding is an intra mode, the switch may be switched to intra. If the prediction mode used for decoding is an inter mode, the switch may be switched to inter.

[0095] The decoding device 200 can obtain a reconstructed residual block from the input bitstream 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, which is a block to be decoded, by adding the reconstructed residual block and the prediction block. The block to be decoded may also be referred to as a current block.

[0096] The entropy decoding unit 210 may generate symbols by performing entropy decoding based on a probability distribution for the bit stream. The generated symbols may include symbols in the form of quantized transform coefficient levels. Here, the entropy decoding method may be similar to the above-mentioned entropy coding method. For example, the entropy decoding method may be an inverse process of the above-mentioned entropy coding method.

[0097] The entropy decoding unit 210 may convert one-dimensional vector form coefficients into two-dimensional block form coefficients according to a transform coefficient scanning method in order to decode transform coefficient levels. For example, the two-dimensional block form coefficients may be converted by scanning the coefficients of a block using upright scanning. Depending on the size of the transform unit and the intra prediction mode, vertical scanning or horizontal scanning may be used instead of upright scanning. That is, depending on the size of the transform unit and the intra prediction mode, it may be determined which scanning method is used among upright scanning, vertical scanning, and horizontal scanning.

[0098] The quantized transform coefficient levels may be inverse quantized by the inverse quantization unit 220 and inverse transformed by the inverse transform unit 230. A reconstructed residual block may be generated as a result of the inverse quantization and inverse transformation of the quantized transform coefficient levels. In this case, the inverse quantization unit 220 may apply a quantization matrix to the quantized transform coefficient levels.

[0099] When the intra mode is used, the intra prediction unit 240 can generate a prediction block by performing spatial prediction using pixel values ​​of already decoded blocks neighboring the block to be decoded.

[0100] When the inter mode is used, the motion compensation unit 250 may generate a prediction block by performing motion compensation using a motion vector and a reference image stored in the reference picture buffer 270. When a value of a motion vector does not have an integer value, the motion compensation unit 250 may generate a prediction block by applying an interpolation filter to a part of an area in a reference image. To perform motion compensation, it may be determined whether a motion compensation method of a prediction unit included in a corresponding coding unit is a skip mode, a merge mode, an AMVP mode, or a current picture reference mode, based on a coding unit, and motion compensation may be performed according to each mode. Here, the current picture reference mode may mean a prediction mode using an already reconstructed area in a current picture to which a decoding target block belongs. A motion vector for the current picture reference mode may be used to identify the already reconstructed area. A flag or index indicating whether a decoding target block is a block encoded in a current picture reference mode may be signaled, or may be inferred using a reference image index of the decoding target block. The current picture for the current picture reference mode may be located at a fixed position (e.g., the position where the reference picture index is 0 or the last position) in the reference picture list for the block to be decoded, or may be variably located in the reference picture list, and for this purpose, a separate reference picture index indicating the position of the current picture may be signaled.

[0101] The reconstructed residual block and the prediction block may be added via an adder 255. A block generated by adding the reconstructed residual block and the prediction block may pass through a filter unit 260. The filter unit 260 may 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 may output the reconstructed image. The reconstructed image may be stored in a reference picture buffer 270 and used for inter prediction.

[0102] 3 is a schematic diagram showing an image division structure when encoding and decoding an image, which illustrates an embodiment in which one unit is divided into multiple sub-units.

[0103] In order to efficiently divide an image, a coding unit (CU) can be used in encoding and decoding. Here, a coding unit may refer to a coding unit. A unit may be a term that collectively indicates 1) a syntax element and 2) a block including image samples. For example, "division of a unit" may mean "division of a block corresponding to the unit." Block division information may include information regarding the depth of the unit. The depth information may indicate the number of times and / or the degree to which the unit is divided.

[0104] Referring to FIG. 3, an image 300 is sequentially divided into Largest Coding Unit (LCU) units, and a division structure is determined for each LCU. Here, LCU can be used synonymously with Coding Tree Unit (CTU). One unit can be hierarchically divided with depth information based on a tree structure. Each divided subunit can have depth information. The depth information indicates the number and / or degree to which a unit is divided, and can therefore include information regarding the size of the subunit.

[0105] The partition structure may refer to the distribution of coding units (CUs) within the LCU 310. A CU may be a unit for efficiently coding an image. Such a distribution may be determined by whether or not a single CU is partitioned into a plurality of CUs (a positive integer equal to or greater than 2, including 2, 4, 8, 16, etc.). The width and height of a CU generated by partitioning may be half the width and height of the CU before partitioning, respectively, or may have a smaller size than the width and height of the CU before partitioning depending on the number of partitions. The partitioned CU may be recursively partitioned into a plurality of CUs with reduced widths and heights in a similar manner.

[0106] At this time, the division of the CU may be performed recursively up to a predetermined depth. The depth information is information indicating the size of the CU, and may be stored for each CU. For example, the depth of the LCU may be 0, and the depth of the smallest coding unit (SCU) may be a predefined maximum depth. Here, as described above, the LCU may be a coding unit having a maximum coding unit size, and the SCU may be a coding unit having a minimum coding unit size.

[0107] Splitting starts with LCU 310, and each time the width and height of the CU decrease due to splitting, the depth of the CU increases by 1. For each depth, an unsplit CU can have a size of 2Nx2N. For split CUs, a 2Nx2N CU can be split into multiple NxN CUs. The size of N is reduced by half each time the depth increases by 1.

[0108] For example, when one coding unit is divided into four coding units, the width and height of the four divided coding units may be half the size of the width and height of the coding unit before division. As an example, when a coding unit of 32x32 size is divided into four coding units, each of the divided four coding units may have a size of 16x16. When one coding unit is divided into four coding units, it can be said that the coding unit is divided into a quad-tree shape.

[0109] For example, when one coding unit is divided into two coding units, the width or height of the two divided coding units may be half the size of the width or height of the coding unit before the division. As an example, when a coding unit of 32x32 size is divided vertically into two coding units, each of the divided coding units may have a size of 16x32. As an example, when a coding unit of 32x32 size is divided horizontally into two coding units, each of the divided coding units may have a size of 32x16. When one coding unit is divided into two coding units, it can be said that the coding unit is divided in the form of a binary-tree.

[0110] Referring to FIG. 3, an LCU with a depth of 0 may be 64x64 pixels. 0 may be the minimum depth. An SCU with a depth of 3 may be 8x8 pixels. 3 may be the maximum depth. In this case, a CU of 64x64 pixels, which is an LCU, may be represented with a depth of 0. A CU of 32x32 pixels may be represented with a depth of 1. A CU of 16x16 pixels may be represented with a depth of 2. A CU of 8x8 pixels, which is an SCU, may be represented with a depth of 3.

[0111] In addition, information on whether a CU is divided can be expressed using division information of the CU. The division information can be 1-bit information. All CUs except SCUs can include division information. For example, if the value of the division information is 0, the CU may not be divided, and if the value of the division information is 1, the CU may be divided.

[0112] FIG. 4 is a diagram showing the form of a prediction unit PU that can be included in a coding unit CU.

[0113] Among the CUs divided from the LCU, the CUs that are not further divided may be divided into one or more Prediction Units (PUs). This process may also be referred to as division.

[0114] A PU may be a basic unit for prediction. A PU can be encoded and decoded in either a skip mode, an inter mode, or an intra mode. A PU can be divided in various ways depending on the mode.

[0115] Also, the coding unit is not split into prediction units, and the coding unit and the prediction unit can have the same size.

[0116] In skip mode, there may be no partitioning within a CU, as shown in Figure 4. In skip mode, a 2Nx2N mode 410 of the same size as a CU can be supported without partitioning.

[0117] In the inter mode, eight division modes can be supported within a CU. For example, in the inter mode, 2Nx2N mode 410, 2NxN mode 415, Nx2N mode 420, NxN mode 425, 2NxnU mode 430, 2NxnD mode 435, nLx2N mode 440, and nRx2N mode 445 can be supported. In the intra mode, 2Nx2N mode 410 and NxN mode 425 can be supported.

[0118] A coding unit can be divided into one or more prediction units, and a prediction unit can also be divided into one or more prediction units.

[0119] For example, when one prediction unit is divided into four prediction units, the width and height of the divided four prediction units may have half the size of the width and height of the prediction unit before division. As an example, when a prediction unit of 32x32 size is divided into four prediction units, each of the divided four prediction units may have a size of 16x16. When one prediction unit is divided into four prediction units, it can be said that the prediction unit is divided into a quad-tree shape.

[0120] For example, when one prediction unit is divided into two prediction units, the width or height of the two divided prediction units may be half the size of the width or height of the prediction unit before division. As an example, when a prediction unit of 32x32 size is vertically divided into two prediction units, each of the divided two prediction units may have a size of 16x32. As an example, when a prediction unit of 32x32 size is horizontally divided into two prediction units, each of the divided two prediction units may have a size of 32x16. When one prediction unit is divided into two prediction units, it can be said that the prediction unit is divided in the form of a binary-tree.

[0121] FIG. 5 is a diagram showing the form of a transform unit TU that can be included in a coding unit CU.

[0122] A transform unit (TU) may be a basic unit used for transform, quantization, inverse transform, and inverse quantization processing within a CU. A TU may have a shape such as a square or a rectangle. A TU may be determined depending on the size and / or shape of a CU.

[0123] Among the CUs divided from an LCU, a CU that is not further divided into CUs may be divided into one or more TUs. In this case, the division structure of the TU may be a quad-tree structure. For example, as shown in FIG. 5, one CU 510 may be divided once or more according to a quad-tree structure. When one CU is divided once or more, it is said to be divided recursively. Through the division, one CU 510 may be composed of TUs of various sizes. Alternatively, the CU may be divided into one or more TUs based on the number of vertical lines and / or horizontal lines dividing the CU. A CU may be divided into symmetric TUs or asymmetric TUs. For the division into asymmetric TUs, information on the size / shape of the TU may be signaled or may be derived from information on the size / shape of the CU.

[0124] Also, the coding unit is not divided into transform units, and the coding unit and the transform unit can have the same size.

[0125] A coding unit can be divided into one or more transform units, and a transform unit can also be divided into one or more transform units.

[0126] For example, when one transform unit is divided into four transform units, the width and height of the four divided transform units may be half the size of the width and height of the transform unit before the division. As an example, when a transform unit of 32x32 size is divided into four transform units, each of the divided four transform units may have a size of 16x16. When one transform unit is divided into four transform units, it can be said that the transform unit is divided into a quad-tree.

[0127] For example, when one transform unit is divided into two transform units, the width or height of the two divided transform units may be half the size of the width or height of the transform unit before the division. As an example, when a transform unit of 32x32 size is divided vertically into two transform units, each of the two divided transform units may have a size of 16x32. As an example, when a transform unit of 32x32 size is divided horizontally into two transform units, each of the two divided transform units may have a size of 32x16. When one transform unit is divided into two transform units, it can be said that the transform unit is divided into a binary-tree.

[0128] When performing the transform, the residual block may be transformed using at least one of a plurality of predefined transform methods. For example, the predefined transform methods may include a discrete cosine transform (DCT), a discrete sine transform (DST), or a KLT. Which transform method is applied to transform the residual block may be determined using at least one of inter prediction mode information, intra prediction mode information, and a size / shape of a transform block of a prediction unit, and in certain cases, information indicating the transform method may be signaled.

[0129] FIG. 6 is a diagram for explaining an embodiment of the intra prediction process.

[0130] The intra prediction mode may be a non-directional mode or a directional mode. The non-directional mode may be a DC mode or a planar mode, and the directional mode may be a prediction mode having a specific direction or angle, the number of which may be one or more, M. The directional mode may be expressed by at least one of a mode number, a mode value, a mode number, and a mode angle.

[0131] The number of intra prediction modes may be one or more, N, including the non-directional and directional modes.

[0132] The number of intra prediction modes may vary depending on the block size, for example, 67 when the block size is 4x4 or 8x8, 35 when the block size is 16x16, 19 when the block size is 32x32, and 7 when the block size is 64x64.

[0133] The number of intra prediction modes may be fixed to N regardless of the block size, for example, at least one of 35 or 67 regardless of the block size.

[0134] The number of intra prediction modes may vary depending on the type of color component, for example, whether the color component is a luma signal or a chroma signal.

[0135] Intra coding and / or decoding may be performed using sample values ​​or coding parameters contained in neighboring reconstructed blocks.

[0136] In order to encode / decode the current block using intra prediction, a step of checking whether samples included in neighboring reconstructed blocks can be used as reference samples for the block to be encoded / decoded may be performed. If there is a sample that cannot be used as a reference sample for the block to be encoded / decoded, at least one of the samples included in the neighboring reconstructed blocks may be used as a reference sample for the block to be encoded / decoded by copying and / or interpolating the sample value to the sample that cannot be used as a reference sample.

[0137] During intra prediction, a filter may be applied to at least one of a reference sample or a predicted sample based on at least one of an intra prediction mode and a size of a block to be coded / decoded. In this case, the block to be coded / decoded may refer to a current block, and may refer to at least one of a coding block, a predicted block, and a transformed block. The type of filter applied to a reference sample or a predicted sample may vary depending on at least one of an intra prediction mode or a size / shape of a current block. The type of filter may vary depending on at least one of a filter tap number, a filter coefficient value, or a filter strength.

[0138] Among intra prediction modes, non-directional planar mode can generate a prediction block of a target encoding / decoding block by generating sample values ​​in the prediction block as a weighted sum of the upper reference sample of the current sample, the left reference sample of the current sample, the upper right reference sample of the current block, and the lower left reference sample of the current block depending on the sample position.

[0139] Among intra prediction modes, the non-directional DC mode may generate a prediction block of a target encoding / decoding block as an average value of an upper reference sample of a current block and a left reference sample of the current block, and may perform filtering using reference sample values ​​for one or more upper rows and one or more left columns adjacent to the reference sample in the encoding / decoding block.

[0140] In the case of a plurality of angular modes among the intra prediction modes, a prediction block may be generated using upper right and / or lower left reference samples, and the angular modes may have different directions from each other. Interpolation of real numbers may also be performed to generate the prediction sample values.

[0141] To perform the intra prediction method, the intra prediction mode of a current prediction block may be predicted from the intra prediction mode of a prediction block existing in the neighborhood of the current prediction block. When predicting the intra prediction mode of the current prediction block using mode information predicted from the neighboring intra prediction mode, if the intra prediction modes of the current prediction block and the neighboring prediction block are the same, information that the intra prediction modes of the current prediction block and the neighboring prediction block are the same may be transmitted using predetermined flag information, and if the intra prediction modes of the current prediction block and the neighboring prediction block are different from each other, entropy coding may be performed to encode intra prediction mode information of a block to be coded / decoded.

[0142] FIG. 7 is a diagram for explaining an embodiment of the inter prediction process.

[0143] The rectangles in FIG. 7 may indicate images (or pictures). Also, the arrows in FIG. 7 may indicate prediction directions. That is, the images may be coded and / or decoded according to the prediction directions. Each image may be classified into an I-picture (Intra Picture), a P-picture (Uni-predictive Picture), a B-picture (Bi-predictive Picture), etc., according to its coding type. Each picture may be coded and decoded according to its coding type.

[0144] If the image to be coded is an I picture, the image can be intra-coded on the image itself without inter prediction. If the image to be coded is a P picture, the image can be coded via inter prediction or motion compensation using a reference image only in the forward direction. If the image to be coded is a B picture, the image can be coded via inter prediction or motion compensation using a reference picture in both the forward and backward directions, and can be coded via inter prediction or motion compensation using a reference picture in either the forward or backward direction. Here, when an inter prediction mode is used, the encoder can perform inter prediction or motion compensation, and the decoder can perform the corresponding motion compensation. Images of P pictures and B pictures coded and / or decoded using a reference image can be considered as images using inter prediction.

[0145] Next, inter prediction according to the embodiment will be specifically described.

[0146] Inter prediction or motion compensation can be performed using reference pictures and motion information, and inter prediction can also use skip mode as described above.

[0147] The reference picture may be at least one of a picture before the current picture or a picture after the current picture. In this case, the inter prediction may perform prediction for a block of the current picture based on the reference picture. Here, the reference picture may mean an image used for predicting a block. In this case, an area in the reference picture may be specified by using a reference picture index (refIdx) indicating the reference picture and a motion vector (to be described later), etc.

[0148] In the inter prediction, a reference picture and a reference block corresponding to a current block in the reference picture may be selected, and a prediction block for the current block may be generated using the selected reference block. The current block may be a block currently being encoded or decoded among blocks in the current picture.

[0149] The motion information can be derived from the inter prediction process by each of the encoding device 100 and the decoding device 200. The derived motion information can be used to perform the inter prediction. In this case, the encoding device 100 and the decoding device 200 can improve the efficiency of encoding and / or decoding by using the motion information of a reconstructed neighboring block and / or the motion information of a collocated block. The collocated block may be a block corresponding to the spatial position of the block to be encoded / decoded in a collocated picture that has already been reconstructed. The reconstructed neighboring block may be a block in the current picture and may be a block that has already been reconstructed through encoding and / or decoding. The reconstructed block may be a neighboring block adjacent to the block to be encoded / decoded and / or a block located at an outer corner of the block to be encoded / decoded. Here, the block located at the outer corner of the block to be encoded / decoded may be a block vertically adjacent to the neighboring block horizontally adjacent to the block to be encoded / decoded, or a block horizontally adjacent to the neighboring block vertically adjacent to the block to be encoded / decoded.

[0150] Each of the encoding device 100 and the decoding device 200 may determine a block that is located at a position spatially corresponding to the block to be coded / decoded in the co-located picture, and may determine a predetermined relative position based on the determined block. The predetermined relative position may be an internal and / or external position of the block that is located at a position spatially corresponding to the block to be coded / decoded. Also, each of the encoding device 100 and the decoding device 200 may derive the co-located block based on the determined predetermined relative position. Here, the co-located picture may be any one of at least one reference picture included in a reference picture list.

[0151] The derivation method of the motion information may vary depending on the prediction mode of the block to be encoded / decoded. For example, prediction modes applied for inter prediction may include Advanced Motion Vector Prediction (AMVP) and merge mode. Here, the merge mode may be referred to as a motion merge mode.

[0152] For example, when AMVP is applied as a prediction mode, each of the encoding device 100 and the decoding device 200 can generate a motion vector candidate list using the motion vector of the reconstructed neighboring block and / or the motion vector of the co-located block. The motion vector of the reconstructed neighboring block and / or the motion vector of the co-located block can be used as a motion vector candidate. Here, the motion vector of the co-located block can be called a temporal motion vector candidate, and the motion vector of the reconstructed neighboring block can be called a spatial motion vector candidate.

[0153] The bitstream generated by the encoding device 100 may include a motion vector candidate index. That is, the encoding device 100 may generate a bitstream by entropy coding the motion vector candidate index. The motion vector candidate index may indicate an optimal motion vector candidate selected from among the motion vector candidates included in a motion vector candidate list. The motion vector candidate index may be transmitted from the encoding device 100 to the decoding device 200 via a bitstream.

[0154] The decoding device 200 can entropy decode the motion vector candidate index from the bitstream, and use the entropy decoded motion vector candidate index to select a motion vector candidate for the block to be decoded from among the motion vector candidates included in the motion vector candidate list.

[0155] The encoding device 100 can calculate a motion vector difference (MVD) between a motion vector of a block to be encoded and a motion vector candidate, and can entropy code the MVD. The bitstream can include the entropy coded MVD. The MVD can be transmitted from the encoding device 100 to the decoding device 200 via the bitstream. At this time, the decoding device 200 can entropy decode the received MVD from the bitstream. The decoding device 200 can derive a motion vector of the block to be decoded by the sum of the decoded MVD and the motion vector candidate.

[0156] The bitstream may include a reference image index indicating a reference picture, etc. The reference image index may be entropy coded and transmitted from the coding device 100 to the decoding device 200 via a bitstream. The decoding device 200 may predict a motion vector of a block to be decoded using motion information of neighboring blocks, and may derive a motion vector of the block to be decoded using the predicted motion vector and a motion vector differential. The decoding device 200 may generate a prediction block for the block to be decoded based on the derived motion vector and reference image index information.

[0157] Another example of a motion information derivation method is a merge mode. The merge mode may mean merging of motions for multiple blocks. The merge mode may mean applying motion information of one block to other blocks together. When the merge mode is applied, each of the encoding device 100 and the decoding device 200 may generate a merge candidate list using the motion information of the reconstructed neighboring blocks and / or the motion information of the collocated blocks. The motion information may include at least one of 1) a motion vector, 2) a reference image index, and 3) an inter prediction indicator. The prediction indicator may be unidirectional (L0 prediction, L1 prediction) or bidirectional.

[0158] At this time, the merge mode may be applied on a CU or PU basis. When the merge mode is performed on a CU or PU basis, the encoding device 100 may entropy-encode predefined information to generate a bitstream and then transmit the bitstream to the decoding device 200. The bitstream may include predefined information. The predefined information may include 1) a merge flag, which is information indicating whether or not to perform the merge mode for each block partition, and 2) a merge index, which is information regarding which block among neighboring blocks adjacent to the encoding target block is to be merged with. For example, the neighboring blocks of the encoding target block may include a left neighboring block of the encoding target block, an upper neighboring block of the encoding target block, and a temporal neighboring block of the encoding target block.

[0159] The merge candidate list may indicate a list in which motion information is stored. The merge candidate list may be generated before the merge mode is performed. The motion information stored in the merge candidate list may be at least one of motion information of a neighboring block adjacent to the encoding / decoding target block, motion information of a block collocated with the encoding / decoding target block in a reference image, new motion information generated by combining motion information already present in the merge candidate list, and a zero merge candidate. Here, the motion information of the neighboring block adjacent to the encoding / decoding target block may be called a spatial merge candidate, and the motion information of a block collocated with the encoding / decoding target block in a reference image may be called a temporal merge candidate.

[0160] The skip mode may be a mode in which motion information of a neighboring block is applied to a current block to be coded / decoded as is. The skip mode may be any of the modes used in inter prediction. When the skip mode is used, the coding device 100 may entropy code information on which block's motion information is to be used as the motion information of the current block to be coded, and transmit the information to the decoding device 200 via a bitstream. The coding device 100 may not transmit other information to the decoding device 200. For example, the other information may be syntax element information. The syntax element information may include at least one of motion vector differential information, a coded block flag, and a transform coefficient level.

[0161] Residual signals generated after intra- or inter-prediction may be transformed into the frequency domain through a transform process as part of a quantization process. In this case, the primary transform to be performed may be DCT type 2 (DCT-II) or various DCT and DST kernels, and these transform kernels may be separable transforms that perform 1D transforms in the horizontal and / or vertical directions on the residual signal, or may be 2D non-separable transforms.

[0162] As an example, the DCT and DST types used for conversion can be adaptively used for 1D conversion, such as DCT-II, DCT-V, DCT-VIII, DST-I, and DST-VII, as shown in the table below. For example, as shown in the examples of Tables 1 and 2, a transform set can be configured to derive the DCT or DST type used for conversion.

[0163] [Table 1]

[0164] [Table 2]

[0165] For example, as shown in FIG. 8, after defining different transform sets in the horizontal or vertical direction according to the intra prediction mode, the encoder / decoder may perform transform and / or inverse transform using the intra prediction mode of the currently encoded / decoded block and the transform included in the corresponding transform set. In this case, the transform set may be defined in the encoder / decoder based on the same rule, rather than being entropy coded / decoded. In this case, entropy coding / decoding indicating which transform among the transform sets has been used may be performed. For example, when the size of a block is 64x64 or less, a total of three transform sets are configured according to the intra prediction mode as shown in the example of Table 2, and a total of nine multiple transform methods are combined using three transforms each for the horizontal direction and the vertical direction, and the residual signal is coded / decoded using the optimal transform method, thereby improving coding efficiency. In this case, truncated unary binarization may be used to entropy code / decode information regarding which transform among the three transforms belonging to one transform set has been used. At this time, for at least one of the vertical transform and the horizontal transform, information indicating which transform from the transform set has been used can be entropy coded / decoded.

[0166] After the above-mentioned primary transform is completed, the encoder may perform a secondary transform to increase the energy concentration of transformed coefficients as in the example of FIG. 9. The secondary transform may also perform a separable transform that performs a one-dimensional transform in the horizontal and / or vertical directions, respectively, or may perform a two-dimensional non-separable transform, and the used transform information may be transmitted or may be implicitly derived in the encoder / decoder according to the current and neighboring coding information. For example, a transform set for the secondary transform may be defined as in the primary transform, and the transform set may be defined based on the same rules in the encoder / decoder, rather than being entropy coded / decoded. In this case, information indicating which transform of the transform set was used may be transmitted and may be applied to at least one of the residual signals by intra or inter prediction.

[0167] At least one of the number or types of transform candidates may differ for each transform set, and at least one of the number or types of transform candidates may be variably determined taking into account at least one of the position, size, division type, prediction mode (intra / inter mode), or directionality / non-directivity of the intra prediction mode of the block (CU, PU, ​​TU, etc.).

[0168] In the decoder, a secondary inverse transform can be performed depending on whether or not to perform a secondary inverse transform, and a primary inverse transform can be performed depending on whether or not to perform a primary inverse transform from the result of the secondary inverse transform.

[0169] The above-mentioned primary and secondary transforms may be applied to at least one of the signal components of the luminance / chrominance components, or may be applied depending on the size / shape of any coding block, and an index indicating whether or not a given coding block is used and the primary / secondary transform used may be entropy coded / decoded, or may be implicitly derived by the encoder / decoder based on at least one of the current / neighboring coding information.

[0170] Residual signals generated after intra or inter prediction undergo a quantization process after primary and / or secondary transformation. The quantized transform coefficients undergo an entropy coding process. At this time, the quantized transform coefficients may be scanned diagonally, vertically, and horizontally based on at least one of an intra prediction mode or a minimum block size / shape, as shown in FIG. 10.

[0171] In addition, the entropy decoded quantized transform coefficients may be inverse scanned and arranged in a block format, and at least one of inverse quantization and inverse transform may be performed on the block. At this time, at least one of diagonal scan, horizontal scan, and vertical scan may be performed as the inverse scanning method.

[0172] For example, when the size of the current coding block is 8x8, the residual signal for the 8x8 block may be entropy coded by scanning the quantized transform coefficients for each of four 4x4 sub-blocks according to at least one of the three scanning order methods shown in Fig. 10 after the first transform, the second transform and the quantized transform coefficients may be inverse scanned and entropy decoded. The inverse scanned quantized transform coefficients become transform coefficients after inverse quantization, and at least one of the second inverse transform or the first inverse transform may be performed to generate a reconstructed residual signal.

[0173] In a video encoding process, as shown in Fig. 11, one block may be split, and an indicator corresponding to split information may be signaled. In this case, the split information may be at least one of a split flag (split_flag), a quad / binary tree flag (QB_flag), a quad tree split flag (quadtree_flag), a binary tree split flag (binarytree_flag), and a binary tree split type flag (Btype_flag). Here, split_flag may be a flag indicating whether a block is split, QB_flag may be a flag indicating whether a block is split in a quad tree or binary tree, quadtree_flag may be a flag indicating whether a block is split in a quad tree, binarytree_flag may be a flag indicating whether a block is split in a binary tree, and Btype_flag may be a flag indicating vertical or horizontal split when a block is split in a binary tree.

[0174] When the split flag is 1, it indicates that the tree has been split, and when the split flag is 0, it indicates that the tree has not been split. In the case of the quad / binary tree flag, when the flag is 0, it indicates a quad tree split, and when the flag is 1, it indicates a binary tree split, or conversely, when the flag is 0, it indicates a binary tree split, and when the flag is 1, it indicates a quad tree split. In the case of the binary tree split type flag, when the flag is 0, it indicates a horizontal split, and when the flag is 1, it indicates a vertical split, or conversely, when the flag is 0, it indicates a vertical split, and when the flag is 1, it indicates a horizontal split.

[0175] For example, the partition information for FIG. 11 can be derived by signaling at least one of quadtree_flag, binarytree_flag, and Btype_flag as shown in Table 3 below.

[0176] [Table 3]

[0177] For example, the split flag for FIG. 11 can be derived by signaling at least one of split_flag, QB_flag, and Btype_flag, as shown in Table 4 below.

[0178] [Table 4]

[0179] The division method can be divided only into quadtrees or only into binary trees depending on the size / shape of the block. In this case, the split_flag can represent a flag indicating quadtree division or binary tree division. The size / shape of the block can be derived according to the depth information of the block, and the depth information can be signaled.

[0180] If the size of the block falls within a predetermined range, it may be possible to divide it only in a quadtree manner. Here, the predetermined range may be defined as at least one of the size of the maximum block or the size of the minimum block that can be divided only in a quadtree manner. Information indicating the size of the maximum / minimum block for which quadtree division is permitted may be signaled via a bitstream, and the information may be signaled in units of at least one of a sequence, a picture parameter, or a slice (segment). Alternatively, the size of the maximum / minimum block may be a fixed size that is predetermined for an encoder / decoder. For example, if the size of the block falls within a range of 256x256 to 64x64, it may be possible to divide it only in a quadtree manner. In this case, the split_flag may be a flag indicating whether or not quadtree division is permitted.

[0181] If the size of the block falls within a predetermined range, it can be divided only in a binary tree. Here, the predetermined range can be defined as at least one of the maximum block size and the minimum block size that can be divided only in a binary tree. Information indicating the maximum / minimum block size for which the binary tree division is permitted can be signaled via a bitstream, and the information can be signaled in units of at least one of a sequence, a picture parameter, or a slice (segment). Alternatively, the maximum / minimum block size may be a fixed size that is predetermined for an encoder / decoder. For example, if the size of the block falls within a range of 16x16 to 8x8, it can be divided only in a binary tree. In this case, the split_flag can be a flag indicating whether or not the binary tree division is permitted.

[0182] After one block is divided into a binary tree, if the divided block is to be further divided, it can only be divided into a binary tree.

[0183] If the width or height of the divided block is a size that cannot be further divided, the one or more indicators may not be signaled.

[0184] In addition to the above-mentioned quadtree-based binary tree division, quadtree-based division after binary tree division is possible.

[0185] Based on the above, the image encoding / decoding method using motion vectors according to the present invention will be described in detail.

[0186] FIG. 12 is a flowchart showing an image coding method according to the present invention, and FIG. 13 is a flowchart showing an image decoding method according to the present invention.

[0187] 12, the encoding device can derive motion vector candidates (S1201) and generate a motion vector candidate list based on the derived motion vector candidates (S1202). Once the motion vector candidate list is generated, a motion vector can be determined using the generated motion vector candidate list (S1203), and motion compensation can be performed using the motion vector (S1204). Thereafter, the encoding device can entropy code information related to motion compensation (S1205).

[0188] 13, the decoding device entropy decodes information related to motion compensation received from the encoding device (S1301) and can derive motion vector candidates (S1302). The decoding device then generates a motion vector candidate list based on the derived motion vector candidates (S1303) and can determine a motion vector using the generated motion vector candidate list (S1304). After that, the decoding device can perform motion compensation using the motion vector (S1305).

[0189] Each step shown in FIG. 12 and FIG. 13 will now be described in detail.

[0190] First, the steps of deriving motion vector candidates will be specifically described (S1201, S1302).

[0191] The motion vector candidates for the current block may include at least one of spatial motion vector candidates or temporal motion vector candidates.

[0192] The spatial motion vector of the current block may be derived from a reconstructed block neighboring the current block. For example, the motion vector of a reconstructed block neighboring the current block may be determined as a spatial motion vector candidate for the current block.

[0193] FIG. 14 is a diagram for explaining an example of deriving spatial motion vector candidates for a current block.

[0194] 14, spatial motion vector candidates for a current block may be derived from neighboring blocks adjacent to the current block X. Here, the neighboring blocks adjacent to the current block may include at least one of block B1 adjacent to the upper side of the current block, block A1 adjacent to the left side of the current block, block B0 adjacent to the upper right corner of the current block, block B2 adjacent to the upper left corner of the current block, and block A0 adjacent to the lower left corner of the current block.

[0195] If a motion vector exists in a neighboring block adjacent to the current block, the motion vector of the neighboring block may be determined as a spatial motion vector candidate of the current block. Whether or not a motion vector of a neighboring block exists or whether or not the motion vector of the neighboring block is available as a spatial motion vector candidate of the current block may be determined based on whether or not a neighboring block exists or whether or not the neighboring block is coded through inter prediction. In this case, whether or not a motion vector of a neighboring block exists or whether or not the motion vector of the neighboring block is available as a spatial motion vector candidate of the current block may be determined according to a predetermined priority order. As an example, in the example shown in FIG. 14, the availability of a motion vector may be determined in the order of blocks at positions A0, A1, B0, B1, and B2.

[0196] When a reference block of a current block and a reference image of a neighboring block having a motion vector are different from each other, a motion vector of the neighboring block that has been scaled may be determined as a spatial motion vector candidate of the current block. Here, the scaling may be performed based on at least one of a distance between a current image and a reference image referenced by the current block, and a distance between a current image and a reference image referenced by the neighboring block. As an example, a spatial motion vector candidate of the current block may be derived by scaling a motion vector of the neighboring block by a difference value between a distance between a current image and a reference image referenced by the current block, and a distance between a current image and a reference image referenced by the neighboring block.

[0197] Even if the reference image list of the current block is different from the reference image list of the neighboring block, it is possible to determine whether to scale the motion vector of the neighboring block depending on whether the reference images of the current block and the neighboring block are the same. Here, the reference image list may include at least one of List0 (L0), List1 (L1), List2 (L2), and List3 (L3).

[0198] In summary, the spatial motion vector candidate can be derived by considering at least one of the following: availability of the block, whether it is coded in intra prediction mode, whether the reference image list of the current block is the same as that of the current block, or whether the reference image of the current block is the same as that of the current block. If the neighboring block is available and is not coded in intra prediction mode, the spatial motion vector candidate of the current block can be generated in the manner illustrated in Table 5 below.

[0199] [Table 5]

[0200] As shown in Table 5, even if the reference image lists of the current block and the neighboring block are different from each other, if the reference images of the current block and the neighboring block are the same, the motion vector of the neighboring block can be determined as a spatial motion vector candidate of the current block.

[0201] In contrast, if the reference images of the current block and the neighboring block are different, the motion vector of the neighboring block can be determined as a spatial motion vector candidate for the current block by scaling it, regardless of whether the reference image list of the current block and the reference image list of the neighboring block are identical.

[0202] When deriving spatial motion vector candidates for a current block from neighboring blocks, the derivation order of spatial motion vector candidates for the current block may be determined taking into consideration whether the reference images of the current block and the neighboring blocks are the same. As an example, spatial vector candidates may be preferentially derived from neighboring blocks having the same reference image as the current block, and if the number of derived spatial motion vector candidates (or the number of derived motion vector candidates) is equal to or less than a predetermined maximum value, spatial vector candidates may be derived from neighboring blocks having a reference image different from that of the current block.

[0203] Alternatively, the spatial motion vector prediction candidates for the current block may be determined taking into consideration whether the current block and the neighboring blocks have the same reference image and the positions of the neighboring blocks.

[0204] For example, a spatial motion vector candidate for the current block may be derived from a neighboring block (A0, A1) adjacent to the left side of the current block depending on whether the reference image is identical, and then a spatial motion vector candidate for the current block may be derived from a neighboring block (B0, B1, B2) adjacent to the upper side of the current block depending on whether the reference image is identical. Table 6 illustrates an example of the derivation order of spatial motion vector candidates for the current block.

[0205] [Table 6]

[0206] The maximum number of spatial motion vector candidates for the current block may be preset so that the same value is used in the encoding device and the decoding device. Alternatively, the encoding device may encode information indicating the maximum number of spatial motion vector candidates for the current block and transmit it to the decoding device via a bitstream. As an example, the encoding device may encode "maxNumSpatialMVPCand" indicating the maximum number of spatial motion vector candidates for the current block and transmit it to the decoding device via a bitstream. In this case, "maxNumSpatialMVPCand" may be set to a positive integer including 0. For example, "maxNumSpatialMVPCand" may be set to 2.

[0207] The candidate temporal motion vectors for the current block can be derived from reconstructed blocks included in a co-located picture of the current image, which may be an image that has been coded / decoded before the current image and has a different temporal order from the current image.

[0208] FIG. 15 is a diagram for explaining an example of deriving temporal motion vector candidates for the current block.

[0209] 15, in a collocated picture of the current image, a temporal motion vector candidate for the current block may be derived from a block including an external position of a block corresponding to the same spatial position as the current block X, or a block including an internal position of a block corresponding to the same spatial position as the current block X. As an example, a temporal motion vector candidate for the current block X may be derived from a block H adjacent to the lower left corner of a block C corresponding to the same spatial position as the current block, or a block C3 including the center point of block C. Block H or block C3, etc., used to derive a temporal motion vector candidate for the current block may be referred to as a "collocated block."

[0210] If a temporal motion vector candidate for the current block can be derived from block H including an external position of block C, block H can be set as the corresponding position block of the current block. In this case, the temporal motion vector of the current block can be derived based on the motion vector of block H. On the other hand, if a temporal motion vector candidate for the current block cannot be derived from block H, block C3 including an internal position of block C can be set as the corresponding position block of the current block. In this case, the temporal motion vector of the current block can be derived based on the motion vector of block C3. If a temporal motion vector of the current block cannot be derived from block H and block C3 (e.g., if block H and block C3 are all intra-coded), a temporal motion vector candidate for the current block may not be derived or may be derived from a block at a position different from block H and block C3.

[0211] As another example, the temporal motion vector candidates for the current block may be derived from multiple blocks in the corresponding position image. For example, multiple temporal motion vector candidates for the current block may be derived from block H and block C3.

[0212] In Fig. 15, it is illustrated that a temporal motion vector candidate for a current block can be derived from a block adjacent to the lower left corner of the corresponding position block or a block including a center point of the corresponding position block. However, the position of the block for deriving a temporal motion vector candidate for the current block is not limited to the example shown in Fig. 15. As an example, a temporal prediction candidate for the current block can be derived from a block adjacent to the upper / lower boundary, left / right boundary, or one corner of the corresponding position block, or can be derived from a block including a specific position within the corresponding position block (e.g., a block adjacent to a corner boundary of the corresponding position block).

[0213] A temporal motion vector candidate for the current block may be determined by considering the reference image list (or prediction direction) of a block located inside or outside the current block and the corresponding position block.

[0214] As an example, when the reference image list available to the current block is L0 (i.e., when the inter prediction indicator indicates PRED_L0), a motion vector of a block located inside or outside the corresponding position block that uses L0 as a reference image can be derived as a temporal motion vector candidate for the current block. That is, when the reference image list available to the current block is LX (where X is an integer indicating an index of the reference image list, such as 0, 1, 2, or 3), a motion vector of a block located inside or outside the corresponding position block that uses LX as a reference image can be derived as a temporal motion vector candidate for the current block.

[0215] Even when the current block uses multiple reference image lists, a temporal motion vector candidate for the current block can be determined by considering whether the reference image lists of the current block and blocks located inside or outside the corresponding position block are the same.

[0216] As an example, when the current block performs bidirectional prediction (i.e., when the inter prediction indicator is PRED_BI), among blocks located inside or outside the corresponding position block, a motion vector of a block using L0 and L1 as reference images may be derived as a temporal motion vector candidate for the current block. When the current block performs three-way prediction (i.e., when the inter prediction indicator is PRED_TRI), among blocks located inside or outside the corresponding position block, a motion vector of a block using L0, L1, and L2 as reference images may be derived as a temporal motion vector candidate for the current block. When the current block performs four-way prediction (i.e., when the inter prediction indicator is PRED_QUAD), among blocks located inside or outside the corresponding position block, a motion vector of a block using L0, L1, L2, and L3 as reference images may be derived as a temporal motion vector candidate for the current block.

[0217] Alternatively, when the current block is set to perform multi-directional prediction using any of the reference images, a candidate temporal motion predictor vector for the current block can be determined by taking into consideration whether the external block has the same reference picture list and the same prediction direction as the current block.

[0218] As an example, when the current block performs bidirectional prediction with respect to the L0 reference picture list (i.e., when the inter prediction indicator for list L0 is PRED_BI), a motion vector of a block located inside or outside the corresponding position block that performs bidirectional prediction with respect to L0 using L0 as a reference image can be derived as a candidate temporal motion vector for the current block.

[0219] Candidate temporal motion vectors may also be derived based on at least one of the coding parameters.

[0220] The temporal motion vector candidate can be preliminarily derived when the number of derived spatial motion vector candidates is smaller than the maximum number of motion vector candidates, thereby omitting the process of deriving the temporal motion vector candidate when the number of derived spatial motion vector candidates reaches the maximum number of motion vector candidates.

[0221] As an example, when the maximum number of motion vector candidates is two and the two derived spatial motion vector candidates have different values, the process of deriving a temporal motion vector candidate can be omitted.

[0222] As another example, the temporal motion vector candidates of the current block may be derived based on the maximum number of temporal motion vector candidates. Here, the maximum number of temporal motion vector candidates may be preset so that the same value is used in the encoding device and the decoding device. Alternatively, information indicating the maximum number of temporal motion vector candidates of the current block may be coded via a bitstream and transmitted to the decoding device. As an example, the encoding device may code 'maxNumTemporalMVPCand' indicating the maximum number of temporal motion vector candidates of the current block and transmit it to the decoding device via a bitstream. In this case, 'maxNumTemporalMVPCand' may be set as a positive integer including 0. For example, 'maxNumTemporalMVPCand' may be set to 1.

[0223] When the distance between the current image in which the current block is included and the reference image of the current block is different from the distance between the corresponding position picture in which the corresponding position block is included and the reference image of the corresponding position block, the temporal motion vector candidate for the current block can be obtained by scaling the motion vector of the corresponding position block.

[0224] FIG. 16 shows an example of scaling the motion vectors of a corresponding position block to derive candidate temporal motion vectors for a current block.

[0225] The motion vector of the corresponding position vector can be scaled based on at least one of the difference value (td) between the POC (Picture order count), which indicates the display order of the corresponding position image, and the POC of the reference image of the corresponding position block, and the difference value (tb) between the POC of the current image and the POC of the reference image of the current block.

[0226] Prior to scaling, td or tb may be adjusted so that td or tb is within a predetermined range. For example, when the predetermined range is -128 to 127, if td or tb is smaller than -128, td or tb may be adjusted to -128. If td or tb is larger than 127, td or tb may be adjusted to 127. If td or tb is within the range of -128 to 127, td or tb is not adjusted.

[0227] A scaling factor DistScaleFactor can be calculated based on td or tb. In this case, the scaling factor can be calculated based on the following Equation 1.

[0228]

number

[0229] In the formula, Abs() denotes the absolute value function, and the output value of the function is the absolute value of the input value.

[0230] The value of the scaling factor DistScaleFactor calculated based on Equation 1 can be adjusted to be within a predetermined range. For example, DistScaleFactor can be adjusted to be within the range of -1024 to 1023.

[0231] A temporal motion vector candidate of the current block can be determined by scaling the motion vector of the corresponding position block using the scaling factor. For example, the temporal motion vector candidate of the current block can be determined by the following Equation 2.

[0232]

number

[0233] In the formula, Sign() is a function that outputs sign information of the value included in (). For example, if Sign(-1), - is output. In Equation 2, mvCol represents the motion vector of the corresponding position block, i.e., the temporal motion vector predictor before scaling.

[0234] Next, the steps of generating a motion vector candidate list based on the derived motion vector candidates will be described (S1202, S1303).

[0235] Generating the motion vector candidate list may include adding or removing motion vector candidates from the motion vector candidate list, and adding combined motion vector candidates to the motion vector candidate list.

[0236] Considering the step of adding or removing a derived motion vector candidate to a motion vector candidate list, the encoding device and the decoding device can add the derived motion vector candidate to the motion vector candidate list in the order in which the motion vector candidates are derived.

[0237] The generated motion vector candidate list may be determined according to the inter prediction direction of the current block. For example, one motion vector candidate list may be generated for each reference image list, or one motion vector candidate list may be generated for each reference image. A plurality of reference image lists or a plurality of reference images may share one motion vector candidate list.

[0238] In the embodiments described below, it is assumed that the motion vector candidate list mvpListLX means the motion vector candidate list corresponding to the reference image list L0, L1, L2, and L3. For example, the motion vector candidate list corresponding to the reference image list L0 can be called mvpListL0.

[0239] The number of motion vector candidates included in the motion vector candidate list may be set so that the encoding device and the decoding device use the same preset value, or the maximum number of motion vector candidates included in the motion vector candidate list may be coded by the encoding device and transmitted to the decoding device via a bitstream.

[0240] As an example, the maximum number of motion vector candidates that the motion vector candidate list mvpListLX can include, maxNumMVPCandList, may be a positive integer including 0. As an example, maxNumMVPCandList may be an integer such as 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, or 16. When maxNumMVPCandList is 2, it means that a maximum of two motion vector candidates can be included in the mvpListLX. Thus, the index value of the motion vector candidate added first to the mvpListLX may be set to 0, and the index value of the motion vector candidate added next may be set to 1. The number of maximum motion vector candidates may be defined for each motion vector candidate list. It may also be defined in common to all motion vector candidate lists. For example, the maximum motion vector candidates of mvpListL0 and mvpListL1 may have different values ​​or the same value.

[0241] FIG. 17 is a diagram showing an example of how a motion vector candidate list is generated.

[0242] Assume that a spatial motion vector candidate (1,0) that is not spatially scaled is derived from a block at position A1 shown in (b) of Figure 17, and a scaled temporal motion vector candidate (2,3) is derived from a block at position H shown in (a) of Figure 17. In this case, as in the example shown in (c) of Figure 17, the spatial motion vector candidate derived from the block at position A1 and the temporal motion vector candidate derived from the block at position H may be sequentially included in a motion vector candidate list.

[0243] The derived motion vector candidates may be included in the motion vector candidate list according to a predetermined order. As an example, after the spatial motion vector candidate is added to the motion vector candidate list, if the number of motion vector candidates included in the motion vector candidate list is smaller than the maximum number of motion vector candidates, the temporal motion vector candidate may be added to the motion vector candidate list. Conversely, the temporal motion vector candidate may be added to the motion vector candidate list with a higher priority than the spatial motion vector candidate. In this case, the spatial motion vector candidate may be selectively added to the motion vector candidate list depending on whether it is the same as the temporal motion vector candidate.

[0244] In addition, the encoding device and the decoding device can assign an index for identifying each motion vector candidate in the order in which they were added to the motion vector candidate list. In (c) of Fig. 17, the index value of the motion vector candidate derived from the block at position A1 is set to 0, and the index value of the motion vector candidate derived from the block at position H is set to 1.

[0245] A motion vector having a predetermined value other than the spatial motion vector candidate and the temporal motion vector candidate may be added to the motion vector candidate list. For example, if the number of motion vector candidates included in the motion vector list is less than the maximum number of motion vector candidates, a motion vector having a value of 0 may be added to the motion vector candidate list.

[0246] FIG. 18 is a diagram showing an example of adding a motion vector having a predetermined value to a motion vector candidate list.

[0247] 18, "numMVPCandLX" indicates the number of motion vector candidates included in the motion vector candidate list mvpListLX. As an example, numMVPCandL0 may indicate the number of motion vector candidates included in the motion vector candidate list mvpListL0.

[0248] In addition, maxNumMVPCand indicates the maximum number of motion vector candidates that can be included in the motion vector candidate list mvpListLX. numMVPCandLX and maxNumMVPCand can have integer values ​​including 0.

[0249] If numMVPCandLX is smaller than maxNumMVPCand, a motion vector having a predetermined value may be added to the motion vector candidate list, and the numMVPCandLX value may be increased by 1. In this case, the motion vector added to the motion vector candidate list may have a fixed value and may be added to the end of the motion vector candidate list. As an example, the motion vector having a predetermined value added to the motion vector candidate list may be a zero motion vector candidate having a value of (0,0).

[0250] As an example, as shown in (a) of Figure 18, if numMVPCandLX is 1 and maxNumMVPCand is 2, the numMVPCandLX value can be increased by 1 while adding one zero motion vector candidate having a (0,0) value to the motion vector candidate list.

[0251] When the difference between maxNumMVPCand and numMVPCandLX is 2 or more, a motion vector having a predetermined value can be included in the motion vector candidate list repeatedly by the difference value.

[0252] As an example, if maxNumMVPCand is 2 and numMVPCandLX is 0, a motion vector having a predetermined value may be repeatedly added to the motion vector candidate list until numMVPCandLX becomes equal to maxNumMVPCand. In (b) of Figure 18, two zero motion vector candidates having a value of (0,0) are illustrated as being added to the motion vector candidate list.

[0253] As another example, a motion vector of a predetermined value may be included in a motion vector candidate list only if the motion vector candidate list does not include any motion vector candidates that are the same as the motion vector of the predetermined value.

[0254] As an example, if numMVPCandLX is smaller than maxNumMVPCand and the motion vector candidate list does not include a motion vector with (0,0), a motion vector with (0,0) can be added to the motion vector candidate list and numMVPCandLX can be increased by 1, as shown in the example (c) of Figure 18.

[0255] In Fig. 18, the value of the predetermined motion vector added to the motion vector candidate list is (0,0) as an example, but the value of the predetermined motion vector added to the motion vector candidate list is not limited to the illustrated example. Also, as in the example shown in (b) of Fig. 18, when multiple predetermined motion vector candidates are added, the multiple predetermined motion vectors added to the motion vector candidate list may have different values.

[0256] The encoding device and the decoding device can also adjust the size of the motion vector candidate list by removing a motion vector candidate included in the motion vector candidate list.

[0257] For example, the encoding device and the decoding device may check whether the same motion vector candidate exists in the motion vector candidate list, and if the same motion vector candidate exists in the motion vector candidate list, the remaining motion vector candidates, except for the motion vector candidate with the smallest motion vector candidate index, may be removed from the motion vector candidate list.

[0258] The determination of identity between motion vector candidates may be applied only between spatial motion vectors or only between temporal motion vectors, or may be applied between spatial and temporal motion vectors.

[0259] When the number of motion vector candidates included in the motion vector candidate list is greater than the maximum number of motion vector candidates that the motion vector candidate list can contain, motion vector candidates equal to the difference between the number of motion vector candidates included in the motion vector candidate list and the maximum number of motion vector candidates can be removed from the motion vector candidate list.

[0260] FIG. 19 is a diagram showing an example in which a motion vector candidate is removed from the motion vector candidate list.

[0261] If numMVPCandLX is equal to or greater than maxNumMVPCand, motion vector candidates having index values ​​greater than maxNumMVPCand-1 may be removed from the motion vector candidate list.

[0262] As an example, in the example shown in Figure 19, when numMVPCandLX is 3 and maxNumMVPCand is 2, the motion vector candidate (4,-3) assigned an index 2, which is greater than maxNumMVPCand-1, is illustrated as being removed from the motion vector candidate list.

[0263] Next, the step of adding the combined motion vector candidate to the motion vector candidate list will be described.

[0264] When the number of motion vector candidates included in the motion vector candidate list is smaller than the maximum number of motion vector candidates, a combined motion vector may be added to the motion vector candidate list using at least one of the motion vector candidates included in the motion vector candidate list. As an example, a combined motion vector candidate may be generated using at least one of the spatial motion vector candidate, the temporal motion vector candidate, and the zero motion vector candidate included in the motion vector candidate list, and the generated combined motion vector candidate may be included in the motion vector candidate list.

[0265] Alternatively, a combined motion vector candidate may be generated using a motion vector candidate that is not included in the motion vector candidate list. As an example, a combined motion vector candidate may be generated using a motion vector candidate derived from a block that is not included in the motion vector candidate list but can be used to derive at least one of the spatial motion vector candidate or the temporal motion vector candidate, or a motion vector candidate having a predetermined value that is not included in the motion vector candidate list (e.g., a zero motion vector).

[0266] Alternatively, the combined motion vector candidate may be generated based on at least one of the coding parameters, or the combined motion vector candidate may be added to the motion vector candidate list based on at least one of the coding parameters.

[0267] The maximum number of motion vector candidates that the motion vector candidate list can include may be increased by the number of combination motion vectors or less after at least one of the spatial motion vector candidate, the temporal motion vector candidate, or the motion vector candidate of a predetermined value is added. For example, maxNumMVPCandList may have a first value for the spatial motion vector candidate or the temporal motion vector candidate, and may be increased to a second value greater than the first value to insert additional combination motion vector candidates after the spatial motion vector candidate or the temporal motion vector candidate is added.

[0268] FIG. 20 is a diagram showing an example of the motion vector candidate list.

[0269] The current block may be motion-compensated using a motion vector candidate included in the motion vector candidate list. The motion compensation of the current block may be performed using one motion vector for one reference image list, or may be performed using multiple motion vectors for one reference image list. For example, when the inter-prediction direction of the current block is bidirectional, the motion compensation of the current block may be performed by deriving one motion vector for each of the reference picture lists L0 and L1, or may be performed by deriving two motion vectors for the reference picture list L0.

[0270] The motion vector candidate list may include at least one of a spatial motion vector candidate, a temporal motion vector candidate, a zero motion vector candidate, and a combined motion vector candidate generated by combining two or more of them, where each motion vector candidate may be identified by a motion vector candidate index.

[0271] A motion vector candidate set including a plurality of motion vector candidates may be identified by one motion vector candidate index based on the inter prediction direction of the current block. Here, the motion vector candidate set may include N motion vector candidates according to the number N of inter prediction directions of the current block. As an example, the motion vector candidate set may include a plurality of motion vector candidates, such as a first motion vector candidate, a second motion vector candidate, a third motion vector candidate, and a fourth motion vector candidate.

[0272] The motion vector candidate set may be generated by combining at least two of a spatial motion vector candidate, a temporal motion vector candidate, and a zero motion vector candidate. As an example, in FIG. 20, a motion vector candidate set including two motion vector candidates is illustrated as being assigned to motion vector candidate indexes 4 to 13. Also, each motion vector candidate set is illustrated as being generated by combining a spatial motion vector candidate (mxLXA, mxLXB), a temporal motion vector (mxLXCol), and a zero motion vector (mvZero).

[0273] Based on the prediction direction for the reference image list LX, one or more motion vectors can be derived from the reference image list. As an example, when unidirectional prediction is performed for the reference image list LX, a motion vector for a current block can be derived using one of the motion vector candidates assigned to the motion vector indexes 0 to 3. On the other hand, when bidirectional prediction is performed for the reference image list LX, a motion vector for a current block can be derived using a set of motion vector candidates assigned to the motion vector indexes 4 to 13. That is, in the encoding / decoding process, at least one motion vector can be derived based on the motion vector candidates included in the motion vector candidate list.

[0274] The motion vector of the current block can be derived by adding a motion vector differential value to a motion vector candidate. For example, in the example shown in FIG. 20, when a motion vector candidate is selected from the motion vector candidate indexes 0 to 3, a motion vector is derived by adding a motion vector differential value (MVD) to the selected motion vector candidate.

[0275] When a motion vector candidate set including multiple motion vector candidates is selected, multiple motion vectors for the current block can be derived based on the multiple motion vector candidates included in the motion vector candidate set. At this time, a motion vector differential value for each of the multiple motion vector candidates included in the motion vector candidate set can be encoded / decoded. In this case, multiple motion vectors can be derived for the current block by adding up the motion vector differential values ​​corresponding to each motion vector candidate.

[0276] As another example, a motion vector differential value for some of a plurality of motion vector candidates included in a motion vector candidate set may be encoded / decoded. As an example, one motion vector differential value may be encoded / decoded for a motion vector candidate set including a plurality of motion vector candidates. In this case, the current block may use a motion vector derived by adding a motion vector differential value to any of the motion vector candidates included in the motion vector candidate set, and a motion vector derived directly from the motion vector candidate. In the example shown in FIG. 20, for a motion vector candidate set including two motion vector candidates, a first motion vector or a second motion vector is derived by adding a motion vector differential value to any one of the motion vector candidates, and the other is the same as the motion vector candidate.

[0277] As another example, multiple motion vector candidates included in a motion vector candidate set may share the same motion vector differential value.

[0278] The inter prediction indicator may indicate unidirectional prediction or multi-directional prediction for a given reference image list. For example, the inter prediction indicator may be expressed as PRED_LX indicating unidirectional prediction for the reference image list LX, PRED_BI_LX indicating bidirectional prediction for the reference image list LX, etc. Here, X is an integer including 0 and may indicate an index of the reference image list, such as 0, 1, 2, 3, etc.

[0279] As an example, when unidirectional prediction is performed on reference image list L0, the inter prediction indicator can be set to PRED_L0, and when unidirectional prediction is performed on reference image list L1, the inter prediction indicator can be set to PRED_L1.

[0280] On the other hand, when bidirectional prediction is performed on the reference image list L1, the inter prediction indicator can be set to PRED_BI_L1. When the inter prediction indicator for the reference image list L1 is PRED_BI_L1, the current block can derive two motion vectors using the motion vector candidate list and derive two prediction blocks from the reference images included in the reference image list L1 to perform inter prediction. In this case, each of the two prediction blocks may be derived from two different reference images included in the reference image list L1, or may be derived from one reference image included in the reference image list L1.

[0281] The inter prediction indicator may be encoded / decoded to indicate the total number of prediction directions for the current block, or may be encoded / decoded to indicate the number of prediction directions for each of the reference image lists.

[0282] For example, an inter prediction indicator (PRED_L0) indicating unidirectional prediction for the reference image list L0 and an inter prediction indicator (PRED_BI_L1) indicating bidirectional prediction for the reference image list L1 may be coded for the current block. Alternatively, when unidirectional prediction is performed for the reference image list L0 and bidirectional prediction is performed for the reference image list L1, the inter prediction indicator for the current block may indicate PRED_TRI.

[0283] The example shown in Figure 20 shows a motion vector candidate list mvpListLX for a specific reference image list LX. When there are multiple reference image lists such as L0, L1, L2, and L3, a motion vector candidate list can be generated for each reference image list. As a result, a minimum of 1 to a maximum of N prediction blocks can be generated and used for inter prediction or motion compensation of the current block. Here, N is an integer equal to or greater than 1 and can represent 2, 3, 4, 5, 6, 7, 8, and the like.

[0284] At least one of the motion vector candidates included in the motion vector candidate list can be determined as a predicted motion vector (or motion vector predictor) for the current block. The determined predicted motion vector can be used to calculate a motion vector for the current block, and the motion vector can be used for inter prediction or motion compensation of the current block.

[0285] When a motion vector candidate set including a plurality of motion vector candidates is selected for a current block, the motion vector candidates included in the motion vector candidate set and a motion vector of the current block calculated based on the plurality of motion vector candidates may be stored as information on motion compensation of the current block, where the stored information on motion compensation of the current block may be used later when generating a motion vector candidate list or performing motion compensation for a neighboring block.

[0286] In the example shown in FIG. 20, a motion vector candidate list is generated for each reference image list. The motion vector candidate list may be generated for each reference image. As an example, when performing bidirectional prediction on the reference image list LX, a first motion vector candidate list may be generated for a first reference image used for bidirectional prediction among reference pictures included in the reference image list LX, and a second motion vector candidate list may be generated for a second reference image used for bidirectional prediction.

[0287] Next consider the step of determining a predicted motion vector from the candidate motion vector list (S1203, S1304).

[0288] Among the motion vector candidates included in the motion vector candidate list, the motion vector candidate indicated by the motion vector candidate index may be determined as a predicted motion vector for the current block.

[0289] FIG. 21 is a diagram showing an example of deriving predicted motion vector candidates for a current block from a motion vector candidate list.

[0290] 21 shows that the maximum number of motion vector candidates that the motion vector candidate list can contain, maxNumMVPCand, is 2, and the number of motion vector candidates included in the motion vector candidate list is also 2. In this case, when the motion vector candidate index points to index 1, the second motion vector candidate included in the motion vector candidate list (i.e., the motion vector candidate assigned index 1), (2, 3), can be determined as the predicted motion vector of the current block.

[0291] The encoding device can calculate a motion vector differential value by calculating the difference between the motion vector and the predicted motion vector, and the decoding device can calculate a motion vector by combining the predicted motion vector and the motion vector differential.

[0292] Although not shown, when the motion vector candidate index indicates a motion vector candidate set, a plurality of motion vectors can be derived from a plurality of motion vector candidates included in the motion vector candidate set, in which case the motion vector of the current block may be a motion vector candidate plus a motion vector difference, or may have the same value as the motion vector candidate.

[0293] Next, the steps of performing motion compensation using the motion vectors will be described (S1204, S1305).

[0294] The encoding device and the decoding device can calculate a motion vector using the predicted motion vector and the motion vector difference value. When the motion vector is calculated, the calculated motion vector can be used to perform inter prediction or motion compensation. Alternatively, as in the example shown in FIG. 20, the motion vector prediction value can be determined as the motion vector as it is.

[0295] The current block may have a minimum of 1 to a maximum of N motion vectors based on the prediction direction. Using the motion vectors, a minimum of 1 to a maximum of N prediction blocks may be generated to derive the final prediction block of the current block.

[0296] For example, if the current block has one motion vector, a prediction block generated using the motion vector may be determined as the final prediction block of the current block.

[0297] On the other hand, when the current block has multiple motion vectors, multiple prediction blocks may be generated using the multiple motion vectors, and the final prediction block of the current block may be determined based on a weighted sum of the multiple prediction blocks. Reference images including each of the multiple prediction blocks indicated by the multiple motion vectors may be included in different reference image lists or may be included in the same reference image list.

[0298] The weight applied to each prediction block may be 1 / N (where N is the number of generated prediction blocks) and may have an equal value. For example, if two prediction blocks are generated, the weight applied to each prediction block may be 1 / 2, if three prediction blocks are generated, the weight applied to each prediction block may be 1 / 3, and if four prediction blocks are generated, the weight applied to each prediction block may be 1 / 4. Alternatively, a different weight may be applied to each prediction block to determine the final prediction block of the current block.

[0299] The weight does not have to have a fixed value for each prediction block, but may have a variable value for each prediction block. In this case, the weights applied to each prediction block may be the same or different. In order to apply variable weights, one or more weight information for the current block may be signaled through a bitstream. The weight information may be signaled for each prediction block or for each reference image. It is also possible for a plurality of prediction blocks to share one weight information.

[0300] The following Equations 3 to 5 respectively show an example of generating a final predicted block of a current block when the inter prediction indicator of the current block is PRED_BI, PRED_TRI, and PRED_QUAD, and the prediction direction for each reference image list is unidirectional.

[0301]

number

[0302]

number

[0303]

number

[0304] In Equations 3 to 5, P_BI, P_TRI, and P_QUAD may indicate the final predicted block of the current block, and LX (X=0, 1, 2, 3) may indicate a reference image list. WF_LX may indicate a weight value of a predicted block generated using LX, and OFFSET_LX may indicate an offset value for a predicted block generated using LX. P_LX refers to a predicted block generated using a motion vector for LX of the current block. RF refers to a rounding factor, and may be set to 0, a positive number, or a negative number.

[0305] Even when there are multiple prediction directions for a given reference image list, a final prediction block for a current block may be obtained based on a weighted sum of prediction blocks, in which case weights applied to prediction blocks derived from the same reference image list may have the same value or different values.

[0306] At least one of the weights (WF_LX) and offsets (OFFSET_LX) for the multiple prediction blocks may be entropy coded / decoded coding parameters. As another example, the weights and offsets may be derived from coded / decoded neighboring blocks near the current block. Here, the neighboring blocks near the current block may include at least one of blocks used to derive spatial motion vector candidates for the current block or blocks used to derive temporal motion vector candidates for the current block.

[0307] As another example, the weight and offset may be determined based on the display order (POC) of the current image and each reference image. In this case, the weight or offset may be set to a smaller value as the distance between the current image and the reference image increases, and the weight or offset may be set to a larger value as the distance between the current image and the reference image decreases. As an example, when the difference in POC between the current image and the L0 reference image is 2, the weight value applied to the predicted block generated with reference to the L0 reference image may be set to 1 / 3, whereas when the difference in POC between the current image and the L0 reference image is 1, the weight value applied to the predicted block generated with reference to the L0 reference image may be set to 2 / 3. As exemplified above, the weight or offset value may have an inversely proportional relationship with the difference in display order between the current image and the reference image. As another example, the weight or offset value may be set to be proportional to the difference in display order between the current image and the reference image.

[0308] As another example, at least one of the weights or offsets may be entropy coded / decoded based on at least one of the coding parameters, and a weighted sum of the prediction block may be calculated based on at least one of the coding parameters.

[0309] Next, the process of entropy encoding / decoding information related to motion compensation will be described in detail (S1205, S1301).

[0310] FIG. 22 (FIGS. 22A and 22B) is a diagram illustrating the syntax of information for motion compensation.

[0311] The encoding device may entropy-encode information related to motion compensation via a bitstream, and the decoding device may entropy-decode information related to motion compensation included in the bitstream. Here, the information related to motion compensation to be entropy-encoded / decoded may include at least one of an inter prediction indicator (Inter_pred_idc), a reference image index (ref_idx_l0, ref_idx_l1, ref_idx_l2, ref_idx_l3), a motion vector candidate index (mvp_l0_idx, mvp_l1_idx, mvp_l2_idx, mvp_l3_idx), a motion vector difference, a weight value (wf_l0, wf_l1, wf_l2, wf_l3), and an offset value (offset_l0, offset_l1, offset_l2, offset_l3).

[0312] The inter prediction indicator may indicate an inter prediction direction of the current block when the current block is encoded / decoded by inter prediction. For example, the inter prediction indicator may indicate one-way prediction, or may indicate multi-way prediction such as bidirectional prediction, three-way prediction, or four-way prediction. The inter prediction indicator may indicate the number of reference images used when the current block generates a predicted block. Or, one reference image may be used for multi-way prediction. In this case, N (N>M) directional predictions may be performed using M reference images. The inter prediction indicator may also indicate the number of predicted blocks used when performing inter prediction or motion compensation on the current block.

[0313] In this manner, the number of reference images used when generating a predicted block of the current block, the number of predicted blocks used when performing inter prediction or motion compensation of the current block, or the number of reference image lists available to the current block may be determined according to the inter prediction indicator. Here, the number N of reference image lists may be a positive integer and may have a value of 1, 2, 3, 4 or more. For example, the reference image lists may include L0, L1, L2, and L3, etc. The current block may perform motion compensation using one or more reference image lists.

[0314] As an example, the current block may generate at least one predictive block using at least one reference image list to perform motion compensation for the current block. As an example, the reference image list L0 may be used to generate one or more predictive blocks to perform motion compensation, or the reference image lists L0 and L1 may be used to generate one or more predictive blocks or up to N predictive blocks (where N is a positive integer of 3 or more than 2) to perform motion compensation, or the reference image lists L0, L1, L2 and L3 may be used to perform motion compensation for the current block using one or more predictive blocks or up to N predictive blocks (where N is a positive integer of 4 or more than 2).

[0315] The reference image indicator may indicate one-way (PRED_LX), two-way (PRED_BI), three-way (PRED_TRI), four-way (PRED_QUAD), or more directions depending on the number of prediction directions of the current block.

[0316] As an example, assuming that one-way prediction is performed for each reference image list, the inter prediction indicator PRED_LX may mean that one prediction block is generated using the reference image list LX (X is an integer such as 0, 1, 2, or 3), and inter prediction or motion compensation is performed using the generated one prediction block. The inter prediction indicator PRED_BI may mean that two prediction blocks are generated using the L0 and L1 reference image lists, and inter prediction or motion compensation is performed using the generated two prediction blocks. The inter prediction indicator PRED_TRI may mean that three prediction blocks are generated using the L0, L1, and L2 reference image lists, and inter prediction or motion compensation is performed using the generated three prediction blocks. The inter prediction indicator PRED_QUAD may mean that four prediction blocks are generated using the L0, L1, L2, and L3 reference image lists, and inter prediction or motion compensation is performed using the generated four prediction blocks. That is, the total number of prediction blocks used to perform inter prediction of the current block may be set to the inter prediction indicator.

[0317] When multi-directional prediction is performed on the reference image list, the inter-prediction indicator PRED_BI may indicate that bidirectional prediction is performed on the L0 reference image list, and the inter-prediction indicator PRED_TRI may indicate that three-directional prediction is performed on the L0 reference image list, that one-directional prediction is performed on the L0 reference image list and bidirectional prediction is performed on the L1 reference image list, or that bidirectional prediction is performed on the L0 reference image list and one-directional prediction is performed on the L1 reference image list.

[0318] In this manner, the inter prediction indicator may mean generating a minimum of 1 to a maximum of N (where N is the number of prediction directions indicated by the inter prediction indicator) predictive blocks from at least one reference image list and performing motion compensation, or may mean generating a minimum of 1 to a maximum of N predictive blocks from N reference images and performing motion compensation for the current block using the generated predictive blocks.

[0319] For example, the inter prediction indicator PRED_TRI may mean that three prediction blocks are generated using at least one of the L0, L1, L2, and L3 reference image lists to perform inter prediction or motion compensation of the current block, or that three prediction blocks are generated using at least three of the L0, L1, L2, and L3 reference image lists to perform inter prediction or motion compensation of the current block. Also, PRED_QUAD may mean that four prediction blocks are generated using at least one of the L0, L1, L2, and L3 reference image lists to perform inter prediction or motion compensation of the current block, or that four prediction blocks are generated using at least four of the L0, L1, L2, and L3 reference image lists to perform inter prediction or motion compensation of the current block.

[0320] Available inter-prediction directions may be determined according to the inter-prediction indicator, and all or a portion of the available inter-prediction directions may be selectively used based on the size and / or shape of the current block.

[0321] The number of reference pictures included in each reference picture list may be predefined or may be entropy coded in the coding device and transmitted to the decoding device. As an example, a syntax element "num_ref_idx_lX_active_minus1" (where X is 0, 1, 2, 3, etc., indicating the index of the reference picture list) may indicate the number of reference pictures for a reference picture list such as L0, L1, L2, or L3.

[0322] The reference image index can specify a reference image from each reference image list to which the current block refers. For each reference image list, one or more reference image indexes can be entropy coded / decoded. The current block can perform motion compensation using one or more reference image indexes.

[0323] When N reference pictures are selected using N reference picture indexes, a minimum of 1 to N (or more than N) prediction blocks can be generated to perform motion compensation on the current block.

[0324] The motion vector candidate index indicates a motion vector candidate for the current block from a motion vector candidate list generated for each reference image list or each reference image index. At least one motion vector candidate index can be entropy coded / decoded for each motion vector candidate list. The current block can perform motion compensation using at least one motion vector candidate index.

[0325] For example, based on N motion vector candidate indexes, a minimum of 1 to N (or more than N) prediction blocks may be generated to perform motion compensation on the current block.

[0326] A motion vector differential indicates a difference value between a motion vector and a predicted motion vector. One or more motion vector differentials can be entropy coded / decoded for a reference image list for a current block or a motion vector candidate list generated for each reference image index. The current block can perform motion compensation using one or more motion vector differentials.

[0327] As an example, a minimum of 1 to a maximum of N (or more than N) predicted blocks may be generated using N motion vector differentials to perform motion compensation on the current block.

[0328] When two or more prediction blocks are generated during motion compensation for a current block, a final prediction block for the current block can be generated through a weighted sum of each prediction block. At least one of a weight and an offset can be applied to each prediction block during the weighted sum operation. A weighted sum factor used in the weighted sum operation, such as a weight or an offset, can be entropy coded / decoded for at least one of a reference image list, a reference image, a motion vector candidate index, a motion vector difference, or a motion vector.

[0329] The weighted sum factor may also be derived by index information that identifies one of a set predefined in the encoding device and the decoding device, in which case the index information for identifying at least one of the weights and offsets may be entropy coded / decoded.

[0330] Information related to the weighted sum factor may be entropy coded / decoded on a block-by-block basis or entropy coded / decoded at a higher level. As an example, the weights or offsets may be entropy coded / decoded on a block-by-block basis, such as a CTU, CU, or PU, or may be entropy coded / decoded at a higher level, such as a Video Parameter Set, a Sequence Parameter Set, a Picture Parameter Set, an Adaptation Parameter Set, or a Slice Header.

[0331] The weighted sum factor may be entropy coded / decoded based on a weighted sum factor differential value indicating a difference between the weighted sum factor and the weighted sum factor predicted value. For example, the weight predicted value and the weight differential value may be entropy coded / decoded, or the offset predicted value and the offset differential value may be entropy coded / decoded. Here, the weight differential value may indicate a difference between the weight and the weight predicted value, and the offset differential value may indicate a difference between the offset and the offset predicted value.

[0332] In this case, the weighted sum factor difference value may be entropy coded / decoded on a block-by-block basis, and the weighted sum factor predicted value may be entropy coded / decoded on a higher level. When a weighted sum factor predicted value, such as a weighted predictor or an offset predictor, is entropy coded / decoded on a picture or slice-by-picture basis, blocks included in the picture or slice may use a common weighted sum factor predicted value.

[0333] The weighted sum factor prediction value may also be derived via a specific region in an image, slice, or tile, or a specific region in a CTU or CU. As an example, the weight value or offset value of a specific region in an image, slice, tile, CTU, or CU may be used as the weight prediction value or offset prediction value. In this case, the entropy coding / decoding of the weighted sum factor prediction value may be omitted, and only the weighted sum factor difference value may be entropy coded / decoded.

[0334] Alternatively, the weighted sum factor prediction value may be derived from a neighboring block that is encoded / decoded in the vicinity of the current block. As an example, a weight value or an offset value of a neighboring block that is encoded / decoded in the vicinity of the current block may be set as a weight prediction value or an offset prediction value of the current block. Here, the neighboring block of the current block may include at least one of a block used to derive a spatial motion vector candidate and a block used to derive a temporal motion vector candidate.

[0335] When the weight prediction value and the weight differential value are used, the decoding device can calculate a weight value for the prediction block by combining the weight prediction value and the weight differential value. Also, when the offset prediction value and the offset differential value are used, the decoding device can calculate an offset value for the prediction block by combining the offset prediction value and the offset differential value.

[0336] Instead of entropy coding / decoding information on the weighted sum factor of the current block, the weighted sum factor of a block coded / decoded in the neighborhood of the current block may be used as the weighted sum factor of the current block. For example, the weight or offset of the current block may be set to the same value as the weight or offset of a neighboring block coded / decoded in the neighborhood of the current block.

[0337] At least one of the pieces of information relating to the motion compensation may be entropy coded / decoded via a bitstream using coding parameters, or at least one of the pieces of information relating to the motion compensation may be derived using at least one coding parameter.

[0338] When entropy coding / decoding information related to motion compensation, binarization methods such as the truncated Rice binarization method, the K-th order Exp_Golomb binarization method, the constrained K-th order Exp_Golomb binarization method, the fixed-length binarization method, the unary binarization method, or the truncated unary binarization method can be used.

[0339] When entropy encoding / decoding information regarding motion compensation, a context model can be determined using at least one of information regarding motion compensation of neighboring blocks near the current block, information regarding previously encoded / decoded motion compensation, information regarding the depth of the current block, and information regarding the size of the current block.

[0340] In addition, when entropy encoding / decoding information regarding motion compensation, entropy encoding / decoding can also be performed using at least one of information regarding motion compensation of neighboring blocks, information regarding previously encoded / decoded motion compensation, information regarding the depth of the current block, and information regarding the size of the current block as a predicted value for information regarding motion compensation of the current block.

[0341] The inter encoding / decoding process may be performed for each of the luminance and chrominance signals. For example, in the inter encoding / decoding process, at least one of the methods of obtaining an inter prediction indicator, generating a motion vector candidate list, deriving a motion vector, and performing motion compensation may be applied to the luminance signal and the chrominance signal differently from each other.

[0342] The inter encoding / decoding process for the luminance and chrominance signals may be performed in the same manner. For example, at least one of an inter prediction indicator, a motion vector candidate list, a motion vector candidate, a motion vector, and a reference image may be similarly applied to the chrominance signal in the inter encoding / decoding process applied to the luminance signal.

[0343] These methods can be performed in the same manner in the encoder and the decoder. For example, in the inter encoding / decoding process, at least one of the methods of derivation of a motion vector candidate list, derivation of a motion vector candidate, derivation of a motion vector, and motion compensation can be applied in the same manner in the encoder and the decoder. Also, the application order of these methods can be different between the encoder and the decoder.

[0344] The above-described embodiments of the present invention can be applied depending on the size of at least one of the coding block, the prediction block, the block, and the unit. The size here may be defined as a minimum size and / or a maximum size for which these embodiments are applied, or may be defined as a fixed size for which the embodiments are applied. In addition, the first embodiment can be applied to a first size, and the second embodiment can be applied to a second size. That is, these embodiments can be applied in combination depending on the size. In addition, the above-described embodiments of the present invention can be applied only when the size of the block is equal to or larger than the minimum size and equal to or smaller than the maximum size. That is, these embodiments can be applied only when the size of the block is within a certain range.

[0345] For example, the embodiment is applicable only when the size of the block to be coded / decoded is 8x8 or more. For example, the embodiment is applicable only when the size of the block to be coded / decoded is 16x16 or more. For example, the embodiment is applicable only when the size of the block to be coded / decoded is 32x32 or more. For example, the embodiment is applicable only when the size of the block to be coded / decoded is 64x64 or more. For example, the embodiment is applicable only when the size of the block to be coded / decoded is 128x128 or more. For example, the embodiment is applicable only when the size of the block to be coded / decoded is 4x4. For example, the embodiment is applicable only when the size of the block to be coded / decoded is 8x8 or less. For example, the embodiment is applicable only when the size of the block to be coded / decoded is 16x16 or less. For example, the embodiment is applicable only when the size of the block to be coded / decoded is 8x8 or more and 16x16 or less. For example, the above embodiment is applicable only when the size of the block to be coded / decoded is equal to or larger than 16x16 and equal to or smaller than 64x64.

[0346] The above-described embodiments of the present invention may be applied according to a temporal layer. A separate identifier may be signaled to identify a temporal layer to which the embodiments are applicable, and the embodiments may be applied to a temporal layer identified by the corresponding identifier. The identifier may be defined as a minimum layer and / or a maximum layer to which the embodiments are applicable, or may be defined as indicating a specific layer to which the embodiments are applied.

[0347] For example, the embodiment is applicable only when the temporal hierarchy of the current image is the lowest hierarchy. For example, the embodiment is applicable only when the temporal hierarchy identifier of the current image is 0. For example, the embodiment is applicable only when the temporal hierarchy identifier of the current image is 1 or greater. For example, the embodiment is applicable only when the temporal hierarchy of the current image is the highest hierarchy.

[0348] As in the embodiment of the present invention described above, the reference picture set used in the reference picture list construction and reference picture list modification processes can use at least one of reference picture lists L0, L1, L2 and L3.

[0349] According to an embodiment of the present invention, when a deblocking filter calculates a boundary strength, one or more motion vectors of a block to be coded / decoded can be used up to a maximum of N, where N is a positive integer equal to or greater than 1, and can be 2, 3, 4, etc.

[0350] The above-described embodiment of the present invention can also be applied when the motion vector during motion vector prediction has at least one of 16-pel, 8-pel, 4-pel, integer-pel, 1 / 2-pel, 1 / 4-pel, 1 / 8-pel, 1 / 16-pel, 1 / 32-pel, and 1 / 64-pel units. Furthermore, the motion vector during motion vector prediction can be selectively used in the pixel units.

[0351] The slice types to which the above-described embodiments of the present invention are applied are defined, and the embodiments of the present invention can be applied according to the slice types.

[0352] For example, when the slice type is T (Tri-predictive)-slice, a prediction block is generated using at least three motion vectors, and a weighted sum of the at least three prediction blocks is calculated and used as a final prediction block of a block to be coded / decoded. For example, when the slice type is Q (Quad-predictive)-slice, a prediction block is generated using at least four motion vectors, and a weighted sum of the at least four prediction blocks is calculated and used as a final prediction block of a block to be coded / decoded.

[0353] The above-described embodiment of the present invention can be applied not only to inter prediction and motion compensation methods using motion vector prediction, but also to inter prediction and motion compensation methods using skip mode, merge mode, and the like.

[0354] The shape of the blocks to which the above-described embodiments of the present invention are applied may be square or non-square.

[0355] In the above-mentioned embodiments, the methods are described based on the flowcharts in a series of steps or units, but the present invention is not limited to the order of these steps, and some steps may occur in a different order or simultaneously with other steps than those described above. Also, those skilled in the art will understand that the steps shown in the flowcharts are not exclusive, and other steps may be included, or one or more steps of the flowcharts may be deleted without affecting the scope of the present invention.

[0356] The above-described embodiments include examples of various aspects. It is not possible to describe all possible combinations for illustrating the various aspects, but a person having ordinary skill in the art will recognize that other combinations are possible. Therefore, it can be said that the present invention includes all various alterations, modifications, and variations that fall within the scope of the following claims.

[0357] The above-described embodiments of the present invention may be realized in the form of program instructions that can be executed by various computer components and recorded on a computer-readable recording medium. The computer-readable recording medium may include, alone or in combination, program instructions, data files, data structures, and the like. The program instructions recorded on the computer-readable recording medium may be those specially designed and constructed for the present invention, or those known and available to those skilled in the art of computer software. Examples of computer-readable recording media include magnetic media such as hard disks, floppy disks, and magnetic tapes, optical media such as CD-ROMs and DVDs, magneto-optical media such as floptical disks, and hardware devices specially configured to store and execute program instructions, such as ROMs, RAMs, and flash memories. Examples of program instructions include not only machine language codes produced by a compiler, but also high-level language codes that can be executed by a computer using an interpreter or the like. The hardware devices may be configured to operate as one or more software modules to perform the processes of the present invention, and vice versa.

[0358] Although the present invention has been described above by using specific details such as specific components, limited embodiments, and drawings, these are merely provided to facilitate a more general understanding of the present invention, and the present invention is not limited to the above embodiments. A person having ordinary knowledge in the technical field to which the present invention pertains can make various modifications and variations from such descriptions.

[0359] Therefore, the concept of the present invention should not be limited to the above-described embodiments, and all modifications equivalent to or equivalent to the scope of the claims, as well as the scope of the claims described below, fall within the scope of the concept of the present invention. [Industrial Applicability]

[0360] The present invention can be used in devices for encoding / decoding images.

Claims

1. deriving a first motion vector for the current block by summing a first motion vector predictor and a first motion vector differential; deriving a second motion vector for the current block by summing a second motion vector predictor and a second motion vector differential; determining a first reference image and a second reference image for the current block; obtaining a first prediction block for the current block from the first reference image based on the first motion vector; obtaining a second prediction block for the current block from the second reference image based on the second motion vector; obtaining a final predicted block for the current block based on the first predicted block and the second predicted block; Including, difference information is explicitly signaled only for the first motion vector difference and not for the second motion vector difference; if the difference information is explicitly signaled only for the first motion vector differential, then a size of the second motion vector differential is derived to be the same as a size of the first motion vector differential. Image decoding method.

2. The final prediction block is obtained based on a weighted sum of the first prediction block and the second prediction block; the weighted sum is calculated by applying a first weight to the first predicted block and a second weight to the second predicted block; the first weight and the second set of weights are determined based on a single index information that is explicitly signaled via a bitstream; The index information is explicitly signaled via the bitstream only if inter prediction for the current block is performed bidirectionally. The image decoding method according to claim 1 .

3. The first weight is determined to be different from the second weight according to the index information. The image decoding method according to claim 2 .

4. The index information identifies one of the weight candidates included in a predetermined weight set. The image decoding method according to claim 2 .

5. the index information is decoded from the bitstream only if the size of the current block is equal to or greater than a predetermined value. The image decoding method according to claim 2 .

6. the index information is binarized using a truncated Rice binarization method; The image decoding method according to claim 2 .

7. deriving a first motion vector for a current block; deriving a second motion vector for the current block; obtaining a first prediction block of the current block from a first reference picture based on the first motion vector, wherein first reference picture index information specifies the first reference picture to be encoded into a bitstream; obtaining a second prediction block of the current block from a second reference picture based on the second motion vector, wherein second reference picture index information specifies the second reference picture to be encoded into a bitstream; obtaining a final predicted block for the current block based on the first predicted block and the second predicted block; Including, a first motion vector differential is derived by subtracting a first motion vector predictor from the first motion vector; a second motion vector differential is derived by subtracting a second motion vector predictor from the second motion vector; difference information is explicitly coded only for the first motion vector differential and not for the second motion vector differential; if the difference information is explicitly coded only for the first motion vector differential, the size of the second motion vector differential is the same as the size of the first motion vector differential. Image encoding method.

8. A method for transmitting the bitstream generated by the image coding method according to claim 7 and stored on a computer-readable recording medium.

Citation Information

Patent Citations

  • Motion picture coding / decoding method and apparatus

    JP2004007377A

  • Method for encoding moving image and method for decoding moving image

    JP2004007379A

  • Electronic apparatus and decoding method

    JP2013251752A

  • Image decoding method, image encoding method, and storage method

    JP7596482B2

  • Image decoding apparatus, image decoding method and image encoding apparatus

    WO2013047805A1