Method for selecting a motion vector predictor and device using the method for selecting a motion vector predictor - Patents.com

JP7631595B2Active Publication Date: 2025-02-18LG ELECTRONICS INC
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
JP2024071391
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2011-03-22
Filing Date
2024-04-25
Publication Date
2025-02-18
Estimated Expiration
2032-03-21

AI Technical Summary

Benefits of technology

【0026】 本発明で提示する予測方法によると、圧縮効率を上げて情報送信量を減少させると同時に映像(動画)エンコーディング/デコーディング過程の複雑さを軽減することができる。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007631595000034
    Figure 0007631595000034
  • Figure 0007631595000035
    Figure 0007631595000035
  • Figure 0007631595000036
    Figure 0007631595000036
Patent Text Reader

Abstract

To provide prediction method and an apparatus, capable of improving compression efficiency and reducing complexity in video encoding / decoding.SOLUTION: There is provided, a video decoding device for selecting a motion vector predictor out of first and second motion vector predictor candidates to derive a motion vector for a current block, the first and second motion vector predictor candidates being derived from first and second neighboring block groups based on first and second check orders. The first motion vector predictor candidate is derived from a motion vector of a left neighboring block or a lower left neighboring block satisfying a first condition or a second condition, and the second motion vector predictor candidate is derived from a motion vector of an upper right neighboring block, an upper neighboring block or an upper left neighboring block satisfying the first condition or the second condition. The first condition is prioritized over the second condition for the left neighboring block, the lower left neighboring block, the upper right neighboring block, the upper neighboring block, and the upper left neighboring block. When the lower left neighboring block does not satisfy both conditions, it is checked whether the left neighboring block satisfies the first condition or the second condition before a third condition or a fourth condition is checked for the lower left neighboring block.SELECTED DRAWING: Figure 9
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present invention relates to a video compression technology, and more particularly to a method for predicting information of a current block using information of neighboring blocks. [Background technology]

[0002] Recently, the demand for high-resolution and high-quality images is increasing in various application fields. However, as the image becomes higher in resolution and quality, the amount of information related to the image also increases. Therefore, when image information is transmitted using existing media such as wired / wireless broadband lines or when image information is stored using existing storage media, the information transmission cost and storage cost increase.

[0003] Highly efficient video compression techniques can be utilized to efficiently transmit, store, and play back high-resolution, high-quality video information.

[0004] In order to improve the efficiency of image compression, a method of predicting the current block using information on neighboring blocks of the current block, rather than transmitting the current block information as is, can be used.

[0005] As a prediction method, inter prediction and intra prediction can be used.

[0006] In the inter prediction method, pixel values ​​of a current picture are predicted by referring to information of other pictures, and in the intra prediction method, pixel values ​​are predicted by utilizing relationships between pixels within the same picture.

[0007] When performing inter prediction, information indicating a reference picture from a surrounding block in inter prediction mode and information indicating a motion vector can be used to specify the portion to be used for prediction in another picture. Summary of the Invention [Problem to be solved by the invention]

[0008] The present invention aims to provide a prediction method and an apparatus using the prediction method that can increase compression efficiency and reduce the amount of information transmission while reducing the complexity of the video (motion picture) encoding / decoding process.

[0009] The present invention aims to provide a method for scanning neighboring blocks in inter prediction so as to effectively utilize neighboring information to construct candidates for motion information predictors for a current block, and an apparatus for using this method.

[0010] The present invention aims to provide a method for scaling motion information in order to use motion information obtained from neighboring blocks as a candidate motion information predictor for a current block, and an apparatus for using this method. [Means for solving the problem]

[0011] (1) One embodiment of the present invention is a method for selecting a motion vector predictor, comprising the steps of selecting motion vector predictor candidates for a current block and selecting a motion vector predictor for the current block from among the motion vector predictor candidates, wherein the motion vector predictor candidates for the current block include a motion vector of a first candidate block that is first searched as an available block among left peripheral blocks of the current block, and a motion vector of a second candidate block that is first searched as an available block among upper peripheral blocks of the current block.

[0012] (2) In (1), the available block is a block that satisfies any one of the following conditions: a first condition is that it has the same reference picture and the same reference picture list as the current block; a second condition is that it has the same reference picture and a different reference picture list as the current block; a third condition is that it has a different reference picture and the same reference picture list as the current block; and a fourth condition is that it has a different reference picture and a different reference picture list as the current block, and may be a block to which inter prediction mode is applied.

[0013] (3) In (2), in the step of selecting a motion vector predictor for the current block, a search may be performed by giving higher priority to whether a lower numbered condition among the first through fourth conditions is satisfied.

[0014] (4) In (2), the motion vector of the first candidate block or the second candidate block that satisfies the third or fourth condition may be scaled.

[0015] (5) In (4), the scaling may be performed based on the distance between the current picture to which the current block belongs and the reference picture of the current block, and the distance between the current picture and the reference picture of a block among the first candidate block or the second candidate block that satisfies the third condition or the fourth condition.

[0016] (6) In (4), the number of times scaling is performed may be limited to a predetermined number.

[0017] (7) In (1), the left peripheral blocks may include a first peripheral block located in the lower left corner of the current block and a second peripheral block located below and to the left of the current block.

[0018] (8) In (7), the step of selecting a candidate motion vector predictor for the current block may include a condition determination step of determining whether the first surrounding block and the second surrounding block satisfy any one of the following conditions in order from the first condition to the fourth condition: a first condition that the first surrounding block and the second surrounding block have the same reference picture and the same reference picture list as the current block; a second condition that the first surrounding block and the second surrounding block have the same reference picture and a different reference picture list as the current block; a third condition that the first surrounding block and the second surrounding block have a different reference picture and the same reference picture list as the current block; and a fourth condition that the second surrounding block and the second surrounding block have a different reference picture and a different reference picture list as the current block; and a candidate block determination step of determining the first block found to satisfy any one of the first condition to the fourth condition as the first candidate block.

[0019] (9) In (8), the condition determination step may include a step of determining whether the first peripheral block satisfies a first condition and a second condition, a step of determining whether the second peripheral block satisfies the first condition and the second condition, a step of determining whether the first peripheral block satisfies a third condition and a fourth condition, and a step of determining whether the second peripheral block satisfies the third condition and the fourth condition.

[0020] (10) In (1), the upper peripheral block may include a third peripheral block located in the upper right corner of the current block, a fourth peripheral block located to the upper right of the current block, and a fifth peripheral block located in the upper left corner of the current block.

[0021] (11) In (10), the step of selecting a candidate motion vector predictor for the current block may include a condition determination step of determining whether the third peripheral block, the fourth peripheral block, and the fifth peripheral block satisfy any one of the following conditions in the order of the first condition to the fourth condition: a first condition that the third peripheral block, the fourth peripheral block, and the fifth peripheral block have the same reference picture and the same reference picture list as the current block; a second condition that the third peripheral block has the same reference picture and a different reference picture list as the current block; a third condition that the third peripheral block has a different reference picture and the same reference picture list as the current block; and a fourth condition that the third peripheral block has a different reference picture and a different reference picture list as the current block; and a candidate block determination step of determining the block first found to satisfy any one of the first condition to the fourth condition as the second candidate block.

[0022] (12) In (11), the condition determination step may include a step of determining whether the third peripheral block satisfies the first condition and the second condition, a step of determining whether the fourth peripheral block satisfies the first condition and the second condition, a step of determining whether the fifth peripheral block satisfies the first condition and the second condition, a step of determining whether the third peripheral block satisfies the third condition and the fourth condition, a step of determining whether the fourth peripheral block satisfies the third condition and the fourth condition, and a step of determining whether the fifth peripheral block satisfies the third condition and the fourth condition.

[0023] (13) Another embodiment of the present invention is a decoding device using the method for selecting a motion vector predictor for a current block, comprising: a prediction unit that performs prediction for the current block; and a memory that stores information about neighboring blocks of the current block, wherein the prediction unit selects candidates for a motion vector predictor for the current block, and selects a motion vector predictor for the current block from among the candidate motion vector predictors, and the candidates for the motion vector predictor for the current block include a motion vector of a first candidate block that is first searched as an available block among the left neighboring blocks of the current block, and a motion vector of a second candidate block that is first searched as an available block among the upper neighboring blocks of the current block.

[0024] (14) In (13), the available block may be a block to which inter prediction mode is applied that satisfies any one of the following conditions: a first condition is that the available block has the same reference picture and the same reference picture list as the current block; a second condition is that the available block has the same reference picture and a different reference picture list as the current block; a third condition is that the available block has a different reference picture and the same reference picture list as the current block; and a fourth condition is that the available block has a different reference picture and a different reference picture list as the current block. The prediction unit may search for a motion vector predictor by giving a higher priority to whether a condition with a lower number among the first condition to the fourth condition is satisfied.

[0025] (15) In (14), the prediction unit may scale the motion vector of the block, which is one of the first candidate block and the second candidate block, that satisfies the third condition or the fourth condition. Effect of the Invention

[0026] According to the prediction method proposed in the present invention, it is possible to increase compression efficiency and reduce the amount of information transmission, while at the same time reducing the complexity of the video (motion picture) encoding / decoding process.

[0027] According to the prediction method proposed in the present invention, it is possible to construct candidates for motion information predictors for a current block by effectively using neighbor information.

[0028] According to the prediction method proposed in the present invention, motion information obtained from neighboring blocks can be scaled and used as a candidate motion vector predictor for the current block. [Brief description of the drawings]

[0029] [Figure 1] 1 is a block diagram illustrating a video encoding device (encoder) according to an embodiment of the present invention. [Diagram 2] 1 is a block diagram illustrating a video decoding device (decoder) according to an embodiment of the present invention. [Diagram 3] 1 is a flow diagram outlining an embodiment of a method for deriving a motion vector when an Advanced Motion Vector Predictor (AMVP) is applied in inter prediction mode. [Figure 4] FIG. 1 is a conceptual diagram for explaining an outline of an embodiment relating to a method for generating an MVP candidate list. [Diagram 5] FIG. 2 is a conceptual diagram for explaining the scaling method according to the present invention. [Figure 6] 2 is a flow chart that generally illustrates a method of scaling in accordance with the present invention; [Figure 7] 2 is a diagram for explaining a method for scaling motion vectors of neighboring blocks of a current block in a current picture (current frame) according to an embodiment of the present invention; [Figure 8] 2 is a diagram illustrating a method of performing motion vector competition according to an embodiment of the present invention; [Figure 9] 1 is a diagram illustrating another method of applying AMVP according to an embodiment of the present invention. [Figure 10]4 is a flow diagram outlining a method for selecting a motion vector predictor for a current block in accordance with the present invention; DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0030] The present invention can be modified in various ways and can have various embodiments, and a specific embodiment will be illustrated in the drawings and described in detail. However, this does not limit the present invention to a specific embodiment. The terms used in this specification are used only to describe a specific embodiment and are not used to limit the technical idea of ​​the present invention. A singular expression includes a plural expression unless the context clearly indicates otherwise. In this specification, 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 addition of one or more other features, numbers, steps, operations, components, parts, or combinations thereof.

[0031] Meanwhile, each component in the drawings described in the present invention is illustrated independently for convenience of explanation of different characteristic functions of the video encoding / decoding device, and does not mean that each component is realized by separate hardware or software. For example, two or more components among the components may be integrated into one component, or one component may be divided into multiple components. An embodiment in which each component is integrated and / or separated is also included in the scope of the present invention as long as it does not deviate from the essence of the present invention.

[0032] The present invention will now be described in detail with reference to the accompanying drawings.

[0033] 1 is a block diagram illustrating a video encoding apparatus (encoder) according to an embodiment of the present invention. Referring to FIG. 1, the video encoding apparatus 100 includes a picture division unit 105, a prediction unit 110, a transformation unit 115, a quantization unit 120, a reordering unit 125, an entropy encoding unit 130, a dequantization unit 135, an inverse transformation unit 140, a filter unit 145, and a memory 150.

[0034] The picture division unit 105 can divide the input picture into at least one processing unit. At this time, the processing unit may be a prediction unit (hereinafter, referred to as "PU"), a transform unit (hereinafter, referred to as "TU"), or a coding unit (hereinafter, referred to as "CU"). However, in this specification, for convenience of explanation, a prediction unit may be represented by a prediction block, a transform unit may be represented by a transform block, and an encoding unit may be represented by an encoding block.

[0035] The prediction unit 110 may have an inter prediction unit that performs inter prediction and an intra prediction unit that performs intra prediction. In order to increase coding efficiency, the image signal is not encoded as it is, but an image is predicted using an already encoded area, and a residual value between the original image and the predicted image is added to the predicted image to restore the image.

[0036] Pictures having an already encoded region used for prediction include an I picture (I slice), a P picture (P slice), and a B picture (B slice). An I slice is a slice that is decoded only by intra prediction. A P slice is a slice that can be decoded using inter prediction or intra prediction using at least one motion vector and a reference picture index to predict a sample value of each block. A B slice is a slice that can be decoded using inter prediction or intra prediction using at least two motion vectors and a reference picture index to predict a sample value of each block.

[0037] The prediction unit 110 generates a prediction block composed of predicted samples by performing prediction on a processing unit of a picture. The processing unit of a picture in the prediction unit 110 may be a CU, a TU, or a PU. In addition, it is possible to determine whether the prediction performed on the corresponding processing unit is inter prediction or intra prediction, and to determine the specific content of each prediction method (e.g., a prediction mode, etc.). At this time, the processing unit in which the prediction is performed may be different from the processing unit in which the prediction method and the specific content are determined. For example, the prediction method and prediction mode may be determined on a PU basis, and the prediction may be performed on a TU basis.

[0038] Through inter prediction, a prediction block can be generated by performing prediction based on information of at least one of a picture before and / or a picture after the current picture, and through intra prediction, a prediction block can be generated by performing prediction based on pixel information within the current picture.

[0039] In inter prediction, a reference picture is selected for a current block, and a reference block having the same size as the current block is selected to generate a predicted block for the current block. For example, in inter prediction, a predicted block can be generated such that a residual signal with respect to the current block is minimized and the magnitude of a motion vector is also minimized. As an inter prediction method, a skip mode, a merge mode, an advanced motion vector prediction (AMVP), etc. can be used. The predicted block can be generated in a sample unit less than an integer, such as a 1 / 2 pixel sample unit and a 1 / 4 pixel sample unit. In this case, the motion vector can also be expressed in a pixel unit less than an integer. For example, the motion vector can be expressed in a 1 / 4 pixel unit for luma pixels, and in a 1 / 8 pixel unit for chroma pixels.

[0040] Information such as the index of the reference picture selected through inter prediction, the motion vector predictor, and the residual signal is entropy encoded and transmitted to a decoding device.

[0041] Even when intra prediction is performed, the processing unit in which prediction is performed and the processing unit in which a prediction method and specific contents are determined may be different from each other. For example, a prediction mode may be determined on a PU basis and prediction may be performed on a PU basis, or a prediction mode may be determined on a PU basis and intra prediction may be performed on a TU basis.

[0042] In intra prediction, prediction modes may include 33 directional prediction modes and at least two non-directional modes. The non-directional modes may include a DC prediction mode and a planar mode.

[0043] In intra prediction, a predicted block may be generated after applying a filter to a reference sample. In this case, whether or not to apply a filter to a reference sample may be determined according to an intra prediction mode and / or a size of a current block.

[0044] A PU may be determined in various sizes / shapes from a CU that is not further divided. For example, in the case of inter prediction, a PU may have a size of 2N×2N, 2N×N, N×2N, or N×N. In the case of intra prediction, a PU may have a size of 2N×2N or N×N (N is an integer). In this case, a PU of N×N size may be set to be applied only in a specific case. For example, a PU of N×N may be set to be used only for a coding unit of a minimum size, or to be used only for intra prediction. In addition to the above-mentioned sizes of PUs, PUs of sizes such as N×mN, mN×N, 2N×mN, or mN×2N (m<1) may be further defined and used.

[0045] Residual values ​​(residual blocks or residual signals) between the generated prediction block and the original block are input to the conversion unit 115. In addition, prediction mode information, motion vector information, etc. used for prediction are encoded together with the residual values ​​by the entropy encoding unit 130 and transmitted to a decoding device.

[0046] The transform unit 115 performs transform on the residual block in transform units to generate transform coefficients. The transform unit in the transform unit 115 may be a TU and may have a quad tree structure. At this time, the size of the transform unit may be determined within a range of predetermined maximum and minimum sizes. The transform unit 115 may transform the residual block using a Discrete Cosine Transform (DCT) or a Discrete Sine Transform (DST).

[0047] The quantization unit 120 may generate quantized coefficients by quantizing the residual values ​​transformed by the transformation unit 115. The values ​​calculated by the quantization unit 120 are provided to the inverse quantization unit 135 and the reordering unit 125.

[0048] The rearrangement unit 125 rearranges the quantized coefficients provided from the quantization unit 120. By rearranging the quantized coefficients, the efficiency of encoding in the entropy encoding unit 130 can be improved. The rearrangement unit 125 can rearrange the quantized coefficients in a two-dimensional block form into a one-dimensional form through a coefficient scanning method. The rearrangement unit 125 can also improve the efficiency of entropy encoding in the entropy encoding unit 130 by changing the order of coefficient scanning based on the probability statistics of the coefficients transmitted from the quantization unit.

[0049] The entropy encoding unit 130 may perform entropy encoding on the quantized coefficients reordered by the reordering unit 125. For the entropy encoding, an encoding method such as Exponential Golomb, Context-Adaptive Variable Length Coding (CAVLC), Context-Adaptive Binary Arithmetic Coding (CABAC), etc. may be used. The entropy encoding unit 130 may encode various information such as CU quantization coefficient information, block type information, prediction mode information, partition unit information, PU information, transmission unit information, motion vector information, reference picture information, block interpolation information, filtering information, etc., transmitted from the reordering unit 125 and the prediction unit 110.

[0050] The entropy encoding unit 130 may also make certain changes to the parameter set or syntax that it transmits, if necessary.

[0051] The inverse quantization unit 135 inversely quantizes the values ​​quantized by the quantization unit 120, and the inverse transform unit 140 inversely transforms the values ​​inversely quantized by the inverse quantization unit 135. The residual values ​​generated by the inverse quantization unit 135 and the inverse transform unit 140 can be merged with a prediction block predicted by the prediction unit 110 to generate a reconstructed block.

[0052] The filter unit 145 may apply a deblocking filter, an adaptive loop filter (ALF), and a sample adaptive offset (SAO) to the reconstructed picture.

[0053] The deblocking filter can remove block distortion that occurs at the boundaries between blocks in the restored picture. The adaptive loop filter (ALF) can perform filtering based on a value obtained by comparing the restored image with the original image after the blocks are filtered through the deblocking filter. The ALF can be performed only when high efficiency is applied. The SAO restores the offset difference between the original image and the pixel unit for the residual block to which the deblocking filter is applied, and is applied in the form of band offset, edge offset, etc.

[0054] On the other hand, the filter unit 145 does not need to apply filtering to the reconstructed block used in inter prediction.

[0055] The memory 150 may store the reconstructed block or picture calculated through the filter unit 145. The reconstructed block or picture stored in the memory 150 may be provided to the prediction unit 110 that performs inter prediction.

[0056] 2 is a block diagram illustrating a video decoding device (decoder) according to an embodiment of the present invention. Referring to FIG. 2, the video decoding device 200 may include an entropy decoding unit 210, a reordering unit 215, a dequantization unit 220, an inverse transform unit 225, a prediction unit 230, a filter unit 235, and a memory 240.

[0057] When a video bitstream is input from an encoding device, the input bitstream can be decoded by performing a reverse process of the process in which the video information was processed in the encoding device.

[0058] For example, if a variable length coding (VLC) such as CAVLC is used to perform entropy encoding in the video encoding device, the entropy decoding unit 210 can also perform entropy decoding by implementing the same VLC table as the VLC table used in the encoding device. Also, if CABAC is used to perform entropy encoding in the video encoding device, the entropy decoding unit 210 can perform entropy decoding using CABAC accordingly.

[0059] Among the information decoded by the entropy decoding unit 210, information for generating a prediction block is provided to the prediction unit 230, and residual values ​​entropy decoded by the entropy decoding unit can be input to the realignment unit 215.

[0060] The reordering unit 215 may reorder the bitstream entropy decoded by the entropy decoding unit 210 based on the reordering method used in the video encoder. The reordering unit 215 may restore coefficients expressed in a one-dimensional vector form to coefficients in a two-dimensional block form and reorder them. The reordering unit 215 may receive information related to coefficient scanning performed in the encoding device and perform reordering through a method of scanning in reverse based on the scanning order performed in the encoding device.

[0061] The inverse quantization unit 220 may perform inverse quantization based on a quantization parameter provided by the encoding device and coefficient values ​​of the reordered blocks.

[0062] The inverse transform unit 225 may perform an inverse DCT or an inverse DST on the DCT or DST performed by the transform unit of the encoding device for the result of quantization performed by the video encoding device. The inverse transform may be performed based on a transmission unit or an image division unit determined by the encoding device. The transform unit of the encoding device may selectively perform the DCT or the DST according to a plurality of information such as a prediction method, a size of a current block, and a prediction direction, and the inverse transform unit 225 of the decoding device may perform the inverse transform based on information on the transform performed by the transform unit of the encoding device.

[0063] The prediction unit 230 may generate a prediction block based on prediction block generation related information provided from the entropy decoding unit 210 and previously decoded block and / or picture information provided from the memory 240. The reconstruction block may be generated using the prediction block generated by the prediction unit 230 and a residual block provided from the inverse transform unit 225.

[0064] The specific prediction method performed by the predictor 230 is similar to the prediction method performed by the predictor of the encoding device.

[0065] If the prediction mode for the current block is an intra prediction mode, intra prediction can be performed to generate a predictive block based on pixel information in the current picture.

[0066] In intra prediction, prediction modes may include 33 directional prediction modes and at least two non-directional modes. The non-directional modes may include a DC prediction mode and a planar mode.

[0067] In intra prediction, a predicted block may be generated after applying a filter to a reference sample. In this case, whether or not to apply a filter to a reference sample may be determined according to an intra prediction mode and / or a size of a current block.

[0068] When the prediction mode for the current block is an inter prediction mode, at least one of a picture before or after the current picture is set as a reference picture, and inter prediction for the current block can be performed based on information of the reference picture. Specifically, in the inter prediction, a reference picture can be selected for the current block, and a reference block having the same size as the current block can be selected to generate a predicted block for the current block. For example, in the inter prediction, a predicted block can be generated such that a residual signal with respect to the current block is minimized and the magnitude of the motion vector is also minimized. In this case, information of a neighboring block of the current picture can be used to use information of the reference picture. For example, a predicted block for the current block can be generated based on information of the neighboring block through the use of a skip mode, a merge mode, an advanced motion vector predictor (AMVP), etc.

[0069] The prediction block may be generated in sub-integer sample units such as 1 / 2 pixel sample units and 1 / 4 pixel sample units. In this case, the motion vector may also be expressed in sub-integer pixel units. For example, the motion vector may be expressed in 1 / 4 pixel units for luminance pixels and in 1 / 8 pixel units for chrominance pixels.

[0070] Motion information required for inter prediction of the current block, for example, information regarding a motion vector, a reference picture index, etc., can be derived correspondingly by checking a skip flag, a merge flag, etc. received from the encoding apparatus.

[0071] The processing unit in which prediction is performed may be different from the processing unit in which a prediction method and specific contents are determined. For example, a prediction mode may be determined on a PU basis and prediction may be performed on a PU basis, or a prediction mode may be determined on a PU basis and intra prediction may be performed on a TU basis.

[0072] The residual block output from the inverse transform unit 225 is added to the predicted block output from the prediction unit 230 to reconstruct the original image.

[0073] The reconstructed blocks and / or pictures may be provided to a filter unit 235. The filter unit 235 may apply deblocking filtering, Sample Adaptive Offset (SAO) and / or adaptive loop filtering, etc. to the reconstructed blocks and / or pictures.

[0074] The memory 240 can store reconstructed pictures or blocks for use as reference pictures or blocks, and can provide the reconstructed pictures to an output.

[0075] Although not described here for convenience of explanation, the bit stream input to the decoding device may be input to the entropy decoding unit through a parsing step, or the parsing process may be performed in the entropy decoding unit.

[0076] In this specification, coding may be interpreted as encoding or decoding, as the case may be, and information may be understood to include all of values, parameters, coefficients, elements, etc.

[0077] A "screen" or "picture" generally refers to a unit that indicates one image at a particular time period, while a "slice," "frame," etc. are units that constitute part of a picture in actual video signal coding, and can be used interchangeably with a picture if necessary.

[0078] "Pixel", "picture element" or "pel" refers to the smallest unit that makes up an image. Also, the term "sample" can be used to indicate the value of a specific pixel. A sample can be divided into luma and chroma components, but generally can be used as a term that includes both. The chroma components indicate the difference between defined hues, and are generally composed of Cb and Cr.

[0079] The term "unit" refers to a basic unit of image processing such as the above-mentioned coding unit (CU), prediction unit (PU), transform unit (TU), or a specific location of an image, and may be used interchangeably with terms such as "block" or "area" in some cases. A block may also be used as a term indicating a set of samples or transform coefficients consisting of M columns and N rows.

[0080] Meanwhile, in the case of an inter prediction mode, the encoding apparatus or the decoding apparatus may derive motion information of the current block and perform inter prediction on the current block based on the derived motion information.

[0081] An image used for predicting a current block is called a reference picture or a reference frame. An area in a reference picture can be indicated using a reference picture index (refIdx) indicating the reference picture and a motion vector, etc.

[0082] For a current picture, a reference picture list can be configured for the pictures used for prediction, and a reference picture index can indicate a specific reference picture in the reference picture list. For a P picture, one reference picture list is required, e.g., reference list 0, and for a B picture, two reference picture lists are required, e.g., reference list 0 and reference list 1.

[0083] Specifically, an I picture is a picture that is encoded / decoded by intra prediction, a P picture is a picture that can be encoded / decoded using inter prediction or intra prediction using at least one motion vector and a reference picture index to predict sample values ​​of each block, and a B picture is a picture that can be encoded / decoded using inter prediction or intra prediction using at least two motion vectors and a reference picture index to predict sample values ​​of each block.

[0084] A P picture requires one reference picture list, which is called reference picture list 0 (L0).

[0085] A B picture is a picture that can be coded by forward, backward or bidirectional inter prediction using two reference pictures, for example. A B picture requires two reference picture lists, which are called reference picture list 0 (L0) and reference picture list 1 (L1).

[0086] Inter prediction using a reference picture selected from L0 is called L0 prediction, and L0 prediction is mainly used for forward prediction. Inter prediction using a reference picture selected from L1 is called L1 prediction, and L1 prediction is mainly used for backward prediction. Inter prediction using two reference pictures selected from L0 and L1 is also called bi-directional prediction.

[0087] The features of the I-pictures, P-pictures, and B-pictures may be defined on a slice-by-slice basis, rather than on a picture-by-picture basis. For example, an I-slice having features of an I-picture, a P-slice having features of a P-picture, and a B-slice having features of a B-picture may be defined on a slice-by-slice basis.

[0088] For example, if the slice type for the current block is B and colPic is selected from L0, or if the slice type for the current block is P, colPic can be selected from L0.

[0089] On the other hand, to avoid low delay, Generalized P and B (GPB) slices can be used, in which Reference List 0 and Reference List 1 are the same as each other.

[0090] In the case of the skip mode in the inter prediction, the information of the neighboring blocks can be used as it is for the current block. Therefore, in the case of the skip mode, the syntax information such as the residual is not transmitted except for the information indicating which block's motion information is to be used as the motion information of the current block.

[0091] In addition, in the case of a merge mode, a prediction block for a current block may be generated by directly using motion information of a neighboring block. The encoding apparatus may transmit information on whether to apply a merge mode, information on which block's motion information is to be used, residual information, etc. The decoding apparatus may reconstruct the current block by adding the residual transmitted from the encoding apparatus to the prediction block.

[0092] A method of indicating which block information to use in the merge mode may also be applied to the skip mode and general inter prediction modes. For example, a candidate block having information used as motion information of a current block in the merge mode may be commonly used with other inter prediction modes, and a method of indicating which neighboring block motion information to use may also be used.

[0093] In this case, in the skip mode and the general inter prediction mode, it is determined that the neighboring block has available motion information only when the reference picture index or prediction direction (reference picture list) of the neighboring block matches the reference picture index or prediction direction (reference picture list) of the current block, and the motion vector of the neighboring block may be used as a candidate of the motion vector predictor for the current block. Alternatively, the motion vector of the neighboring block may be scaled as described below and used as a candidate of the motion vector predictor for the current block.

[0094] In the case of AMVP, the encoding apparatus may predict a motion vector of a current block using motion information of neighboring blocks, and transmit a difference between the motion vector of the current block and the predicted motion vector together with a reference picture index indicating a reference picture. The decoding apparatus may predict a motion vector of a current block using motion information of neighboring blocks, and derive a motion vector for the current block using a residual received from the encoding apparatus. The decoding apparatus may generate a predicted block for the current block based on the derived motion vector and reference picture index information received from the encoding apparatus.

[0095] FIG. 3 is a flow diagram that outlines one embodiment of a method for deriving a motion vector when an Advanced Motion Vector Predictor (AMVP) is applied in inter prediction mode.

[0096] 3, an encoding apparatus or a decoding apparatus may generate a candidate list of motion vector predictors (MVPs) for a current block (S310). The motion vector predictor may indicate a predicted value for a motion vector of the current block.

[0097] The encoding or decoding device can generate an MVP candidate list using motion vectors of available neighboring blocks (for convenience of explanation, referred to as "nearby blocks") adjacent to the current block and / or available blocks among the blocks of each reference picture that are co-located with the current block (for convenience of explanation, referred to as "Col blocks" (co-located blocks)).

[0098] The encoding device or the decoding device can select an MVP for the current block from among the MVP candidates in the MVP candidate list (S320).

[0099] The encoding apparatus may apply a motion vector competition (MVC) to MVP candidates included in the MVP candidate list to select an optimal MVP for the current block. The encoding apparatus may transmit the selected MVP index, a motion vector difference (MVD or Difference of Motion Vector (DMV)), and a reference picture index to the decoding apparatus through a bitstream. The MVP index is an index indicating the MVP of the current block and may indicate any one of the MVP candidates included in the MVP candidate list. In addition, the reference picture index is an index indicating the reference picture of the current block and may indicate any one of the reference picture candidates included in the reference picture list. The MVD is a difference between the motion vector of the current block and the selected MVP, and the smaller the MVD value, the smaller the amount of information to be transmitted.

[0100] The decoding apparatus may receive an MVP index and a reference picture index from the encoding apparatus. Using the received MVP index, the decoding apparatus may select an MVP for the current block from among MVP candidates in the MVP candidate list. Using the received reference picture index, the decoding apparatus may select a reference picture for the current block from among reference picture candidates in the reference picture list.

[0101] The decoding apparatus may derive a motion vector for the current block by using the selected MVP and the reference picture together with the received MVD (S330). For example, the decoding apparatus may add the received MVD to the MVP to reconstruct the motion vector for the current block.

[0102] FIG. 4 is a conceptual diagram for explaining an example of a method for generating an MVP candidate list.

[0103] For ease of explanation, a candidate group including a lower left peripheral block A0 410, which is a peripheral block at the lower left corner of the current block 400, and a left peripheral block A1 420 of the current block 400, is referred to as a left candidate group. In this case, the encoding device or decoding device may use only a block at a specific position among the left blocks 420. For example, the encoding device or decoding device may set the bottommost block 420-1 among the left peripheral blocks 420 as the left block A1.

[0104] Also, a candidate group including an upper right peripheral block B0 430, which is a peripheral block at the upper right corner of the current block 400, an upper peripheral block B1 440 of the current block 400, and a peripheral block B2 450 at the upper left corner of the current block 400, is referred to as an upper candidate group. In this case, the encoding device or the decoding device may use only a block at a specific position among the upper blocks 440. For example, the encoding device or the decoding device may set the rightmost block 440-1 among the upper peripheral blocks as the upper block B1.

[0105] The encoding device or the decoding device can select one MVP candidate from the left candidate group (A0, A1). The MVP candidate selected from the left candidate group is called an MVP. AFor example, the encoding device or the decoding device scans the blocks in the left candidate group in the order of A0→A1, and determines whether the reference picture index and the reference picture list are the same as those of the current block, and sets the motion vector of the first available block as the MVP candidate MVP of the current block. A can be selected as.

[0106] Also, the encoding device or the decoding device can select one MVP candidate from the upper candidate group B0, B1, and B2. The MVP candidate selected from the upper candidate group is called an MVP. B For example, the encoding device or the decoding device scans the blocks in the upper candidate group in the order of B0→B1→B2, and determines whether the reference picture index and the reference picture list of the current block are the same, and sets the motion vector of the first available block as the MVP candidate MVP of the current block. B can be selected as.

[0107] The encoding device or the decoding device may also select the motion vector of the Col block COL 460 in the reference picture as the MVP candidate of the current block. Here, the motion vector of the Col block 460 may be represented as mvCol. In this case, the encoding device or the decoding device may select the motion vector of the Col block COL 460 in the reference picture as the MVP candidate of the current block. A and MV B If it is not possible to secure a required number of spatial candidates in the process of searching for the motion vector of the Col block, the motion vector of the Col block may be set as a candidate.

[0108] In the above embodiment, the MVP candidate selected from the left candidate group and the MVP candidate selected from the top candidate group can be called a Spatial Motion Vector Predictor (SMVP). Also, the MVP candidate selected using the Col block in the reference picture can be called a Temporal Motion Vector Predictor (TMVP). Therefore, the MVP candidate list can include SMVP and / or TMVP.

[0109] When there are overlapping candidates among the MVP candidates selected by the above-mentioned method, the encoding device or the decoding device may remove the remaining candidates except for the highest ranked candidate from among the overlapping candidates.

[0110] Here, the left candidate group (A0, A1) and the upper candidate group (B0, B1, B2) are described as being divided, but the candidate groups can be set without being limited to this. For example, the left candidate group can have only A1, the upper candidate group can have only B1, and a corner candidate group can be configured to have A0, B0, and B2. Even when dividing into the left candidate group, the upper candidate group, and the corner candidate group, it is also possible to select a predetermined number of MVP candidates for the current block by determining whether the reference picture index and the reference picture list are the same as those of the current block for each group.

[0111] At this time, in order to more accurately predict the motion vector of the current block, the motion vectors selected from the neighboring blocks (neighboring motion vectors) can be scaled.

[0112] For example, the motion vector MV of the current block CIf there is no neighboring block with a reference frame (reference picture) corresponding to the reference frame (reference picture) of the frame, the motion vector of the neighboring block can be scaled to generate a motion vector predictor (Predictor of Motion Vector: PMV or Motion Vector Predictor: MVP).

[0113] FIG 5 is a diagram for explaining a scaling method according to the present invention, and shows a schematic relationship between a current block and neighboring blocks. For convenience of explanation, FIG 5 illustrates an example of a method for scaling a motion vector by considering each of a left neighboring block, an upper neighboring block, and a corner neighboring block for a current block 510. In FIG 5, the upper right corner block of the current block is described as a representative block of the neighboring corner blocks. The contents described below with respect to FIG 5 can be similarly applied to other neighboring corner blocks.

[0114] Referring to FIG. 5, for an upper block 530, an upper-right block 540, and a left block 520 of a current block 510, MV C is the motion vector of the current block 510, and MV U is the motion vector of the upper block 530, and MV UR is the motion vector of the upper right block 540, and MV L is the motion vector of the left block 520. It is also assumed that the reference picture index of the block 530 above the current block 510 is 1 (Ref.#1), the reference picture index of the block 540 above and to the right of the current block 510 is also 1 (Ref.#1), and the reference picture index of the block 520 to the left of the current block 510 is 0 (Ref.#0). The reference picture index means the reference frame (reference picture) index indicated by the motion vector of each block.

[0115] In FIG. 5, when the 0th reference frame (reference picture) in the reference picture list stored in the memory (buffer) is used for motion estimation, the motion vector MV L can be used to generate a motion vector predictor for the 0th reference frame. Also, when the first reference frame in the reference picture list is used for motion estimation, three motion vectors M L , M.V. U , M.V. UL may all be used to generate a motion vector predictor for the first reference frame. The motion vector predictors for the second through fourth reference frames in the reference picture list may have the same value as the motion vector predictor for the first reference frame.

[0116] Based on the generated motion vector predictor, a motion vector MV is estimated for the current block. C A difference between the motion vector predictor and the MVD can be calculated, and the MVD is transmitted to a decoding device.

[0117] In the example of FIG. 5, when the 0th or 1st reference frame of the reference picture list, which is the same reference frame as the reference frame (reference picture) of the neighboring block, is used for motion estimation, a proper motion vector predictor can be generated. However, when a reference frame different from the reference frame (reference picture) of the neighboring block is used for motion estimation, the generated motion vector predictor is the motion vector MV of the current block. C The reason is that the motion vector MV C This is because there are no neighboring blocks having a reference frame corresponding to the reference frame for the current block, so it is difficult to effectively predict the motion vector of the current block using information on the neighboring blocks.

[0118] In this case, the motion vector MV of the current block is obtained by upscaling or downscaling the motion vector of the neighboring block of the current block. CTherefore, the amount of bits of the MVD that is encoded and transmitted can be reduced.

[0119] For example, assuming that the reference pictures of the upper block 530, the upper right block 540, and the left block 520, which are peripheral blocks of the current block 510, are all different from the reference picture of the current block, the motion vectors of the peripheral blocks 520, 530, and 540 can be up-scaled or down-scaled by linear interpolation, as in the example of Equation 1.

[0120]

number

[0121] In formula 1, f L represents the reference frame number (or reference picture index) of the block to the left of the current block, and f U represents the reference frame number of the block above the current block, and f UR represents the reference frame number of the corner block to the upper right of the current block, and f ME is the motion-estimated reference frame number, and f C is the current frame number.

[0122] The motion vectors of the neighboring blocks of the current block may be upscaled or downscaled by linear interpolation as shown in Equation 1. A motion vector predictor may be generated using the motion vectors of the scaled neighboring blocks. In this case, the encoding device or the decoding device may generate the motion vector predictor in various ways. For example, one of the motion vectors of the neighboring blocks may be selected and used as the motion vector predictor, an average value of the motion vectors of the neighboring blocks may be used as the motion vector predictor, or a value obtained by median filtering the motion vectors of the neighboring blocks may be used as the motion vector predictor.

[0123] FIG. 6 is a flow chart that generally illustrates a method of scaling in accordance with the present invention.

[0124] 6, an encoding device or a decoding device performs motion estimation using an n-th reference frame (S610). The n-th reference frame is the n-th reference picture (reference frame) in a reference picture list and is the reference frame (reference picture) of a current block.

[0125] The encoding or decoding apparatus determines whether the reference frame number of the neighboring block (reference picture index in the case of a reference picture) is different from n (S620). For example, when the neighboring blocks are the left block of the current block, the upper block of the current block, and the upper right corner block of the current block among the corner blocks, the encoding or decoding apparatus determines whether the reference frame number of the left block (reference picture index in the case of a reference picture) is different from n. L , the reference frame number of the upper block f U , the reference frame number of the upper right block f UR Determine whether the value of is different from n.

[0126] The encoding device or the decoding device may scale the motion vector of the neighboring block if the reference frame number of the neighboring block is different from n (S630). For example, when the left, upper, and upper right blocks of the current block are considered as neighboring blocks as described above, the encoding device or the decoding device may scale the motion vector of the neighboring block if the reference frame number of the neighboring block is different from n (S630). L , f U , f UR If the value of n is different from n, the motion vector of the corresponding block, i.e., the motion vector MV L , the motion vector MV of the block above the current block U , the motion vector MV of the block to the right of the current block UR can be scaled.

[0127] The encoding device or the decoding device generates a motion vector predictor for the current block (S640). If any one of the neighboring blocks has the same reference frame number as the reference frame of the current block, the encoding device or the decoding device can generate a motion vector predictor for the current block using the motion vector of the neighboring block. For example, L , f U , f UR If at least one of the values ​​of f has a value of n, a motion vector predictor for a current block can be generated using a motion vector of a neighboring block having a reference frame number of n. L , f U , f UR If all of the values ​​of n are different from n, the motion vector predictor for the current block can be generated by scaling the motion vectors of the neighboring blocks as described above. The scaling method can use Equation 1 described above.

[0128] In this case, the encoding apparatus or the decoding apparatus may generate a motion vector predictor for the current block by calculating a median value for the scaled motion vectors or the non-scaled motion vectors of the neighboring blocks. Alternatively, the encoding apparatus or the decoding apparatus may generate a motion vector predictor for the current block by calculating an average value for the scaled motion vectors or the non-scaled motion vectors of the neighboring blocks. Alternatively, the encoding apparatus or the decoding apparatus may use any one of the scaled motion vectors or the non-scaled motion vectors of the neighboring blocks as the motion vector predictor for the current block.

[0129] For ease of explanation, the peripheral blocks of the current block are exemplified as left block 520, which represents the peripheral blocks located to the left of the current block, upper block 530, which represents the peripheral blocks located above the current block, and upper right block 540, which represents the blocks located at the peripheral corners of the current block. However, the above-described method can also be applied by considering all the peripheral blocks or by considering blocks in other positions among the peripheral blocks.

[0130] 4, a motion vector predictor may be generated using three corner blocks 410, 430, 450, one of the left blocks 420, and one of the top blocks 440. In this case, a block 420-1 at a specific position among the left blocks 420, or a block 440-1 at a specific position among the top blocks 440 may be used.

[0131] Also, it is possible to determine whether there is a block having the same reference frame (reference picture) as the reference frame (reference picture) of the current block for the left candidate group (A0, A1) and for the upper candidate group (B0, B1, B2), and select one candidate at a time. If there is no block in the left candidate group having the same reference frame (picture) as the reference frame (reference picture) of the current block, the motion vector of the left candidate block or a block selected from the left candidate blocks can be scaled. Also, if there is no block in the upper candidate group having the same reference frame (picture) as the reference frame (reference picture) of the current block, the motion vector of the upper candidate block or a block selected from the upper candidate blocks can be scaled.

[0132] FIG. 7 is a diagram for explaining a method for scaling motion vectors of neighboring blocks of a current block in a current picture (current frame) according to an embodiment of the present invention.

[0133] Referring to FIG. 7, the reference picture of a neighboring block 730 of a current block 740 in a current picture 700 may be the same as or different from the reference picture of the current block 740 .

[0134] When the reference picture of the current block 740 and the reference picture of the neighboring block 730 are the same as each other in the reference picture 710, the motion vector 750 of the neighboring block 730 can be used to generate a motion vector predictor for the current block without scaling. In this case, the neighboring block 730 can have the same reference picture list as the current block 740, or a different reference picture list. For example, when the reference picture of the current block 740 is the Nth reference picture of the reference list L0 and the neighboring block 730 has the same reference picture and the same reference picture list as the current block 740, the motion vector 750 of the neighboring block 730 can be expressed as mvL0N.

[0135] Meanwhile, when the reference picture of the current block 740 is the reference picture 710 and the reference picture of the neighboring block 730 is the reference picture 720, that is, when they are different from each other, the motion vector 760 of the neighboring block 730 may be scaled and used to generate a motion vector predictor for the current block. In this case, the neighboring block 730 may have the same reference picture list as the current block 740 or may have a different reference picture list. For example, when the reference picture of the current block 740 is the Nth reference picture of the reference list L0 and the neighboring block 730 has a different reference picture from the current block 740 but the reference picture list is the same, the motion vector obtained by scaling the motion vector 760 of the neighboring block 730 may be represented as mvL0N_scaled.

[0136] The motion vector of the neighboring block may be calculated by taking into consideration the distance between the reference picture of the current block and the current picture, tb, and the distance between the reference picture of the neighboring block and the current picture, td. As an example of a method for scaling the motion vector of the neighboring block, the method of Equation 2 may be used.

[0137]

number

[0138] Here, DistScaleFactor is a scaling factor determined by considering the magnitudes of the two distances, tb and td, as described above. In this case, in the case of rounding up, the constant 128 can be used as in Equation 2, and in the case of rounding down, the constant 127 can be used instead of the constant 128. For example, if the result of scaling in a quarter pixel block (Quarter Pel Unit) is 1.5, the result is rounded to 2 when the constant 128 is applied, and the result is rounded to 1 when the constant 127 is applied. However, in the case of rounding down, rounding toward 0 can also be applied. For example, when rounding down a value of -1.5, rounding down can be applied so that the value becomes -1 instead of -2.

[0139] DistScaleFactor can be determined in various ways, and Equation 3 and Equation 4 are examples of different methods for determining DistScaleFactor.

[0140]

number

[0141]

number

[0142] In this case, tx in Equation 3 and Equation 4 can be set to tx=(16384+(Abs(td) / 2)) / td, similarly to the derivation of temporal motion vector candidates in H.264 / MPEG-4 AVC (see H.264 standard 8.4.1.2.3).

[0143] Meanwhile, the neighboring blocks used for generating the motion vector predictor can be selected through motion vector competition. Motion vector competition means selecting the optimal motion vector from a plurality of motion vector candidates and using it as a predicted value. In this case, not only spatial neighboring blocks of the current block but also temporal neighboring blocks, col blocks, can be considered.

[0144] 8 is a diagram for explaining a method of performing motion vector competition according to an embodiment of the present invention, in which spatially neighboring blocks of a current block 800 are shown.

[0145] Referring to FIG. 8, the spatial peripheral blocks in FIG. 8 are na (na is an integer equal to or greater than 1) upper group blocks (a0, a1, . . . , a na ), nb (nb is an integer equal to or greater than 1) left group blocks (b0, b1, ..., b nb ), and corner group blocks (c, d, e) which are in the top right, bottom left, and top left corners of the current block 800 .

[0146] In the example of FIG. 8, motion vector candidates in Advanced Motion Vector Prediction (AMVP) can be obtained as shown in the example of Equation 5.

[0147]

number

[0148] In Equation 5, the three spatial motion vectors a′, b′, and c′ refer to the motion vectors of the first available blocks in each group (a block above the current block, a block to the left of the current block, and a block at a corner of the current block) that have the same reference list and the same reference picture index as the current block 800. The encoding device or the decoding device may generate a candidate list of the motion vector predictor described in FIG. 3 using all or a part of the motion vector candidates in Equation 5.

[0149] The encoding apparatus or the decoding apparatus may select a predetermined candidate from among the motion vector candidates of Equation 5 as a motion vector predictor for the current block. In this case, the encoding apparatus or the decoding apparatus may select an MVP for the current block by considering some or all of the motion vectors of Equation 5. For example, the encoding apparatus may select a candidate from among the motion vector candidates of Equation 5 that has a minimum residual with the motion vector of the current block as the MVP for the current block, and transmit information about the selection to the decoding apparatus. In addition, the encoding apparatus may select an available motion vector by considering only some of the motion vectors of Equation 5, for example, a′, b′, and c′, and may additionally consider a temporal predictor when a′, b′, and c′ are not considered (are unavailable).

[0150] In Equation 5, median(a', b', c') is the median vector of a', b', and c', and the following methods 1) to 4) can be used as an example of a method for calculating the median vector.

[0151] 1) If a', b', and c' are all available, calculate the values ​​of a', b', and c' as is and calculate the median vector.

[0152] 2) If only two of a', b', and c' are available, the value of the unavailable motion vector is set to 0 and the median vector is calculated.

[0153] 3) If only one of a', b', and c' is available, use the available motion vector as the median vector.

[0154] 4) In cases other than 1) to 3), the value of the median vector is set to 0.

[0155] In this case, the motion vectors a′, b′, and c′ that are unavailable are not included in the motion vector candidates. In addition, the temporal motion vector predictor refers to a motion vector that is co-located with the current block in a picture (frame) different from the current picture (frame).

[0156] On the other hand, there are na (na is an integer equal to or greater than 1) upper group blocks (a0, a1, ..., a na An example of pseudo code for determining a motion vector for a first available block having the same reference picture list and the same reference picture index as the current block 800 is shown in Table 1.

[0157] [Table 1]

[0158] In Table 1, a0 to a na The case where the search is performed in the order of a is described as an example, but the present invention is not limited to this. na 1 through a0 to find the motion vector of the first available block that has the same reference picture list and the same reference picture index as the current block 800.

[0159] Meanwhile, unlike the example of Table 1, the motion vector of the first inter mode block found among the upper group of blocks may be scaled and assigned as the value of a′, regardless of the reference picture list and reference picture index. In this case, an example of pseudo code for calculating the motion vector a′ is shown in Table 2.

[0160] [Table 2]

[0161] In Table 2, a0 to a na The case where the search is performed in the order of a is described as an example, but the present invention is not limited to this. na 1 to a0 in that order, and obtain the motion vector of the first available block that has the same reference picture list and the same reference picture index as the current block 800 by scaling.

[0162] The nb (nb is an integer equal to or greater than 1) left group blocks (b0, b1, ..., b nb ), the motion vector b′ of the first available block having the same reference picture list and the same reference picture index as the current block 800 can be obtained similarly to Table 1. An example of pseudo code for obtaining b′ is shown in Table 3.

[0163] [Table 3]

[0164] In Table 3, b0 to b nb The case where the search is performed in the order of b is described as an example, but the present invention is not limited to this. nb 1 through b0 to find the motion vector of the first available block that has the same reference picture list and the same reference picture index as the current block 800.

[0165] Meanwhile, unlike the example of Table 3, the motion vector of the first inter mode block found among the left group of blocks can be scaled and assigned as the value of b' regardless of the reference picture list and reference picture index. In this case, an example of pseudo code for obtaining the motion vector b' is shown in Table 4.

[0166] [Table 4]

[0167] In Table 4, b0 to b nb The case where the search is performed in the order of b is described as an example, but the present invention is not limited to this. nb 1 through b0 in the order of b1 through b2, and obtain the motion vector of the first available block that has the same reference picture list and reference picture index as the current block 800 by scaling.

[0168] A motion vector c' of a first available block having the same reference picture list and the same reference picture index as the current block 800 among three corner group blocks (c, d, e) at the corners of the current block 800 can also be obtained in the same manner as in Table 1. An example of pseudo code for obtaining c' is shown in Table 5. For convenience of explanation, in Table 5, c0=c, c1=d, and c2=e are written.

[0169] [Table 5]

[0170] Table 5 illustrates an example of searching in the order of c0 to c2, but this is not limited to this. It is also possible to search in the order of c2 to c0, or in the order of c1 → c2 → c0, or c1 → c0 → c2, to obtain the motion vector of the first available block having the same reference picture list and the same reference picture index as the current block 800.

[0171] Meanwhile, unlike the example of Table 5, the motion vector of the first inter mode block found among the corner group blocks may be scaled and assigned as the value of c', regardless of the reference picture list and reference picture index. In this case, an example of pseudo code for calculating the motion vector c' is shown in Table 6.

[0172] [Table 6]

[0173] Table 6 also illustrates an example of searching in the order from c0 to c2, but this is not limited to this. It is also possible to search in the order from c2 to c0, or in the order of c1 → c2 → c0 or c1 → c0 → c2, and scale and obtain the motion vector of the first available block having the same reference picture list and the same reference picture index as the current block 800.

[0174] On the other hand, only when a motion vector is not available, the motion vector of the first inter-mode block found in the corresponding surrounding block group can be scaled and assigned as a motion vector candidate regardless of the reference picture list or reference picture index.

[0175] In Tables 1 to 6, a block having the same reference picture and reference picture list as the current block is set as an available block. However, in Tables 2, 4, and 6, even if the current block has a different reference picture and reference picture list, the motion vector of the corresponding block can be used by scaling if the block is an inter prediction mode block.

[0176] Tables 7 to 12 also explain that when the current block and its reference picture and reference picture list are different, and the block is an inter prediction mode block, the motion vector of the corresponding block is used by scaling.

[0177] Table 7 shows an example of pseudo code for scaling the motion vector of the first found inter mode block of the upper group of blocks to obtain a′ if the motion vector of the upper group of blocks is not available.

[0178] [Table 7]

[0179] In Table 7, a0 to a na The case where the search is performed in the order of a is described as an example, but the present invention is not limited to this. na Alternatively, the motion vector of the first available block can be obtained by searching in the order from a0 to a1 and scaling the motion vector.

[0180] Table 8 shows an example of pseudo code for scaling the motion vector of the first found inter mode block of the left group of blocks to obtain b' if the motion vector of the left group of blocks is not available.

[0181] [Table 8]

[0182] In Table 8, b0 to b nb The case where the search is performed in the order of b is described as an example, but the present invention is not limited to this. nb Alternatively, the motion vector of the first available block can be obtained by searching in the order from b0 to b1 and scaling the motion vector.

[0183] Table 9 shows an example of pseudo code for scaling the motion vector of the first found inter mode block of the left group of blocks to obtain c' if the motion vector of the left group of blocks is not available.

[0184] [Table 9]

[0185] Table 9 also describes an example of searching in the order from c0 to c2, but this is not limited to this. It is also possible to search in the order from c2 to c0, or in the order of c1 → c2 → c0 or c1 → c0 → c2, and scale the motion vector of the first available block.

[0186] Meanwhile, similar to the above-mentioned method, if the motion vectors of the neighboring blocks of the current block are not available, the motion vector to be scaled may be determined according to the following priority order.

[0187] <Priority> 1) A block that references the same reference picture as the current block (this can occur when list 0 (L0) and list 1 (L1) have the same reference picture). 2) If no motion vector is available among the motion vectors of the surrounding blocks after considering 1), a block having the same reference picture list. 3) If there is still no available motion vector among the neighboring blocks after the consideration of 2), the remaining inter-mode blocks.

[0188] Therefore, the encoding or decoding apparatus may determine one of the neighboring blocks of the current block according to the priorities 1) to 3) and scale the motion vector of the corresponding block.

[0189] Table 10 shows an example of pseudo code for selecting one of the upper group of blocks based on the above-mentioned priority order and scaling the motion vector of the selected block to obtain a'.

[0190] [Table 10]

[0191] In Table 10, a0 to ana The case where the search is performed in the order of a is described as an example, but the present invention is not limited to this. na Alternatively, the motion vector of the first available block can be obtained by searching in the order from a0 to a1 and scaling the motion vector.

[0192] Table 11 shows an example of pseudo code for selecting one of the left group of blocks based on the above-mentioned priority order and scaling the motion vector of the selected block to obtain b'.

[0193] [Table 11]

[0194] In Table 11, b0 to b nb The case where the search is performed in the order of b is described as an example, but the present invention is not limited to this. nb Alternatively, the motion vector of the first available block can be obtained by searching in the order from b0 to b1 and scaling the motion vector.

[0195] Table 12 shows an example of pseudo code for selecting one of the left group of blocks based on the above-mentioned priority order and scaling the motion vector of the selected block to obtain c'.

[0196] [Table 12]

[0197] Table 12 also illustrates an example of searching from c0 to c2, but this is not limited to this. The motion vector of the first available block can also be scaled by searching from c2 to c0, or by searching in the order of c1 → c2 → c0 or c1 → c0 → c2.

[0198] In Tables 10 to 12, it has been described that the scaling target is selected and available motion vector candidates are calculated according to the priority order as described above, but the priority order is not limited to the above and can be changed and applied in various ways as needed.

[0199] Meanwhile, if the above-mentioned priorities are organized as conditions, they can be expressed as the following consideration conditions.

[0200] <Conditions for consideration> The motion information (reference picture, reference picture index) of the block to be scanned is (1) The same reference picture and the same reference picture list as the current block. (2) The same reference picture as the current block, but a different reference picture list. (3) A reference picture different from the current block, but in the same reference picture list. (4) A reference picture different from the current block and a different reference picture list.

[0201] In relation to the above consideration conditions, the encoding device or the decoding device scans a predetermined number of blocks, for example, n blocks, in a predetermined order to determine one spatial motion vector candidate for motion vector prediction. In this case, the encoding device or the decoding device may sequentially scan n blocks around the current block to determine whether the block satisfies the consideration conditions, or may scan the neighboring blocks of the current block by group, for example, by upper group, left group, and corner group, to determine whether each group to be scanned has a block that satisfies the consideration conditions. Also, instead of dividing the neighboring blocks of the current block into an upper group having an upper left corner block and an upper right corner block, and a left block having a lower left corner block, the neighboring blocks of the current block may be divided into an upper group having an upper left corner block and an upper right corner block, and a left block having a lower left corner block, and the two groups may be scanned by group to determine whether the group to be scanned has a block that satisfies the consideration conditions.

[0202] For the above consideration conditions, the encoding device or the decoding device may give higher priority to the consideration conditions with lower numbers because neighboring blocks that satisfy the consideration conditions with lower numbers have more similar motion information to the current block.

[0203] Hereinafter, a method will be described with reference to a table, in which n blocks surrounding a current block are scanned according to the priority of the above consideration conditions, and the motion vector of the first block confirmed to be available is used as a candidate motion vector predictor for predicting the motion vector of the current block either directly or by scaling it.

[0204] Here, the available block refers to a block that can be used for inter prediction of the current block.

[0205] As described above, the scaling can be performed by taking into account the temporal distance between the reference picture of the current block and the current picture, and the temporal distance between the reference picture of the neighboring block and the current picture.

[0206] The numbers 1 to 12 in the table below indicate the scanning (checking) order. For convenience of explanation, blocks 0, 1, and 2 are considered as peripheral blocks of the current block. Blocks 0 to 2 indicate the positions of candidate blocks for obtaining spatial motion vector candidates. Blocks 0 to 2 are each located on one of the left side, top side, and corners of the periphery of the current block. For convenience of explanation, it is assumed that blocks 0 to 2 are located in order according to the scanning order.

[0207] Table 13 shows an example of a method for scanning blocks 0 to 2 surrounding the current block according to the priority of the above consideration conditions, scaling the motion vector of the first block confirmed to be available, and using it as a candidate spatial motion vector predictor for the current block.

[0208] [Table 13]

[0209] In the example of Table 13, a search is performed to see if there is motion information in block 0 that satisfies consideration condition 1. If there is motion information in block 0 that satisfies consideration condition 1, the motion vector (mv) of block 0 is used as a candidate for the spatial motion vector predictor for the current block. If there is no motion information in block 0 that satisfies consideration condition 1, block 1, which is second in the scan order, is searched for and a candidate for the spatial motion vector predictor for the current block is determined by checking whether there is motion information in block 1 that satisfies consideration condition 1.

[0210] Table 14 shows another example of a method for scanning blocks 0 to 2 surrounding the current block according to the priority of the above consideration conditions, scaling the motion vector of the first block confirmed to be available, and using it as a candidate spatial motion vector predictor for the current block.

[0211] [Table 14]

[0212] In the example of Table 14, a search is performed to see if there is motion information in block 0 that satisfies consideration condition 1, and if there is motion information in block 0 that satisfies consideration condition 1, the motion vector (mv) in block 0 is used as a candidate for a spatial motion vector predictor for the current block, and if there is no motion information in block 0 that satisfies consideration condition 1, then block 0 is scanned (checked) to see if there is motion information in block 0 that satisfies consideration condition 2. If there is no motion information in block 0 that satisfies consideration conditions 1 to 4, then consideration conditions 1 to 4 are examined for block 1 in order, and a candidate for a spatial motion vector predictor for the current block is determined by scanning to see if there is motion information that satisfies the corresponding conditions.

[0213] Table 15 shows another example of a method for scanning blocks 0 to 2 surrounding the current block according to the priority of the above consideration conditions, scaling the motion vector of the first block confirmed to be available, and using it as a candidate spatial motion vector predictor for the current block.

[0214] [Table 15]

[0215] In the example of Table 15, a search is performed to see if there is motion information in block 0 that satisfies the consideration condition 1, and if there is motion information in block 0 that satisfies the consideration condition 1, the motion vector (mv) of block 0 is used as a candidate for a spatial motion vector predictor for the current block. If there is no motion information in block 0 that satisfies the consideration condition 1, blocks 1 and 2 are sequentially scanned to see if there is motion information that satisfies the consideration condition 1. If there is no motion information in blocks 0 to 2 that satisfies the consideration condition 1, then while sequentially examining the consideration conditions 2 to 4 for block 0, a scan is performed to see if there is motion information that satisfies the corresponding conditions, and if there is no motion information in block 0 that satisfies the consideration conditions 2 to 4, then the consideration conditions 2 to 4 for block 1 are sequentially examined to determine a candidate for a spatial motion vector predictor for the current block.

[0216] Table 16 shows another example of a method for scanning blocks 0 to 2 surrounding the current block according to the priority of the above consideration conditions, scaling the motion vector of the first block confirmed to be available, and using it as a candidate spatial motion vector predictor for the current block.

[0217] [Table 16]

[0218] In the example of Table 16, it is checked in order whether there is a motion vector that satisfies the conditions from consideration condition 1 to consideration condition 4 in block 0. For example, if there is motion information that satisfies consideration condition 1, the motion vector is used as a candidate for a motion vector predictor for the current block. If there is no motion information that satisfies consideration condition 1, it is checked whether there is motion information that satisfies consideration condition 2. If there is no motion information that satisfies consideration condition 1 to consideration condition 4 in block 0, it is scanned in order to see whether there is motion information that satisfies consideration condition 1 in blocks 1 and 2. If there is no motion information that satisfies consideration condition 1 in blocks 0 to 2, it is checked in order to see whether there is motion information that satisfies consideration condition 2 in blocks 1 and 2, thereby determining a candidate for a spatial motion vector predictor for the current block.

[0219] The example of Table 13 described above is, for example, a scan order that prioritizes the consideration conditions over the block positions, while Table 14 is an example of a scan order that prioritizes the block positions over the consideration conditions.

[0220] Tables 15 and 16 are examples of scan orders that appropriately mix the priorities of consideration conditions and block positions. As described above, Table 15 is an example of a scan order that gives top priority to consideration condition 1 and considers the block positions when there is no block that satisfies consideration condition 1. Also, Table 16 is an example of a scan order that considers the conditions in order when there is no available motion information after considering the availability of each consideration condition in block 0.

[0221] The motion vectors (e.g., a', b', c') scaled according to the above method can affect the median vector value of a', b', c'. In addition, it can affect the number of motion vectors to be considered when determining candidate motion vectors. For example, the motion vectors of the neighboring blocks classified as available motion vectors by scaling can be newly generated.

[0222] The above-mentioned method can be used even when the AMVP technology is not directly applied. For example, the motion vector prediction of the current block can be performed by obtaining a′, b′, and c′ and then obtaining a median from a′, b′, and c′.

[0223] In this case, the process of obtaining a', b', and c' can be performed by using the method described above, similar to the process of obtaining a', b', and c' in AMVP.

[0224] Meanwhile, the AMVP method can also be modified as shown in FIG.

[0225] 9 is a diagram for explaining another method of applying AMVP according to an embodiment of the present invention. Referring to FIG. 9, some of the neighboring blocks of the current block shown in FIG. 8 can be used as motion vector candidates. For example, in the example of FIG. 9, M left blocks A0, A1, ..., A2 on the left side of the current block 900 are used as motion vector candidates. m Among them, Block A is located at the bottom left of the current block. m , the lower left corner block A of the current block 900 m+1 , the upper left corner block B of the current block 900 -1 , among the N upper blocks above the current block 900, block B n , the upper right corner block B of the current block 900 n+1 can be used as a candidate block for AMVP.

[0226] In this case, the neighboring blocks A of the current block are used in the same manner as in the case of FIG. 4, using the corner blocks, the lower left block 420-1, and the upper right block 440-1. m , A m+1 , B -1 , B n , B n+1 In the example of Figure 9, the left block A m , A m+1 A m+1 →A mThe upper block B -1 , B n , B n+1 B n+1 →B n →B -1 The above items are scanned (or checked) in the order 920.

[0227] In this case, a motion vector (motion vector predictor: MVP) as shown in Equation 6 can be considered as a candidate motion vector for the current block.

[0228]

number

[0229] Equation 6 shows motion vector candidates that can be used as a motion vector predictor for a current block in the example of Figure 9. The encoding device or the decoding device may generate the motion vector predictor candidate list described in Figure 3 using all or a part of the motion vector candidates of Equation 6.

[0230] Referring to Equation 6, in the example of Figure 9, the motion vectors of two spatial peripheral blocks of the current block are considered to predict the motion vector of the current block. The encoding device or decoding device may consider both the motion vectors of the two spatial peripheral blocks of the current block shown in Equation 6 and the motion vector (temporal predictor) of one temporal peripheral block of the current block. In addition, the encoding device or decoding device may first consider the motion vectors of the two spatial peripheral blocks shown in Equation 6, and may consider the temporal predictor if any of the motion vectors of the two spatial peripheral blocks is unavailable.

[0231] In Equation 6, a′ is the block A to the left of the current block. m , A m+1 A m+1 →A ma′ is the motion vector of the block that is first found to be available when scanning in the order 910 of a′, and is a candidate motion vector predictor for the current block. a′ can also be called the left motion vector predictor.

[0232] In addition, in Equation 6, b′ is the block above the current block (B -1 , B n , B n+1 B n+1 →B n →B -1 When scanning in the order 920 of b′, b′ is the motion vector of the first block found to be available and is a candidate motion vector predictor for the current block. b′ can also be called the top motion vector predictor.

[0233] If the reference picture index of the neighboring block selected as available is the same as the reference picture index of the current block, i.e., if the reference picture of the selected neighboring block is the same as the reference picture of the current block, the motion vector of the corresponding block can be used as a motion vector predictor for the current block without scaling. This case corresponds to the above-mentioned consideration condition 1 or consideration condition 2.

[0234] If the reference picture index of the neighboring block selected as available is different from the reference picture index of the current block, i.e., if the reference picture of the selected neighboring block is different from the reference picture of the current block, the motion vector of the corresponding block may be used as a motion vector predictor for the current block through scaling. This case corresponds to the above consideration condition 3 or 4.

[0235] In the case of FIG. 9, the motion vectors of the neighboring blocks of the current block can be scanned in various orders in consideration of the conditions for examining the above four steps and the positions of the neighboring blocks. m , A m+1 Candidate motion vector predictors obtained from, for example, the left motion vector predictor and the upper block B -1 , B n , B n+1 A candidate motion vector predictor from can be determined separately, for example, a top motion vector predictor.

[0236] As in the case of Figure 8, in the case of Figure 9, scanning is performed in the order specified in the table below to check whether the consideration conditions are met. If the consideration conditions are met, the scanning is stopped and the motion vector of the block that satisfies the consideration conditions is used as is or scaled as a candidate motion vector predictor (MVP) for predicting the motion vector of the current block.

[0237] The encoding apparatus or the decoding apparatus may construct a motion vector predictor (MVP) list based on the selected motion vector predictor candidates. The encoding apparatus may indicate a motion vector predictor used for predicting a current block in the MVP list via a motion vector predictor index, etc. The decoding apparatus may derive a motion vector of the current block using a motion vector predictor indicated in the motion vector predictor list by the motion vector predictor index received from the encoding apparatus.

[0238] The method of selecting a left motion vector predictor and the method of selecting an upper motion vector predictor will be described below in order. In the following table, the numbers 1 to 8 also indicate the scan order.

[0239] Table 17 shows the left neighbor block A of the current block 900 in FIG. m , A m+1According to the priority order of the above consideration conditions, the motion vector of the first block confirmed to be available is used as a candidate spatial motion vector predictor for the current block either directly or after scaling.

[0240] [Table 17]

[0241] In the example in Table 17, Block A m Check whether Block A satisfies one of the above conditions. m If does not meet the consideration condition 1, block A m Check whether block A satisfies the condition 2. m If condition 1 to condition 4 are not satisfied, block A is selected according to the scan order. m+1 It is checked in order whether or not the condition satisfies one of the conditions 1 to 4.

[0242] If the corresponding block satisfies the consideration condition during the scanning process, the encoding apparatus or the decoding apparatus stops the scan and selects the motion vector of the corresponding block as a candidate of the motion vector predictor for the current block. The encoding apparatus or the decoding apparatus may scale the motion vector of the neighboring block as necessary and use it as a candidate of the motion vector predictor. For example, if the reference picture of the neighboring block is different from that of the current block, the encoding apparatus or the decoding apparatus may scale the motion vector of the corresponding neighboring block and use it as a candidate of the motion vector predictor. In this case, the method of Equation 1 or Equation 2 described above may be used as the scaling method.

[0243] Table 18 shows the left neighbor block A of the current block 900 in FIG. m , A m+1According to the priority order of the above consideration conditions, the motion vector of the first block confirmed to be available is used as a candidate spatial motion vector predictor for the current block as is or after scaling.

[0244] [Table 18]

[0245] In the example in Table 18, Block A m Check whether Block A satisfies the first condition. m If does not satisfy the first condition, block A m+1 Check whether Block A satisfies the first condition. m+1 If condition 1 is not met, block A m Check whether Block A satisfies one of the conditions 2 to 4. m If condition 2 to condition 4 are not satisfied, block A is selected according to the scan order. m+1 Check whether it satisfies one of the conditions 2 to 4 in order.

[0246] If the corresponding block satisfies the consideration condition during the scanning process, the encoding apparatus or the decoding apparatus stops the scan and selects the motion vector of the corresponding block as a candidate of the motion vector predictor for the current block. The encoding apparatus or the decoding apparatus may scale the motion vector of the neighboring block as necessary and use it as a candidate of the motion vector predictor. For example, if the reference picture of the neighboring block is different from that of the current block, the encoding apparatus or the decoding apparatus may scale the motion vector of the corresponding neighboring block and use it as a candidate of the motion vector predictor. In this case, the method of Equation 1 or Equation 2 described above may be used as the scaling method.

[0247] Table 19 shows the left neighboring block A of the current block 900 in FIG. m, A m+1 According to the priority order of the above consideration conditions, the motion vector of the first block confirmed to be available is used as a candidate spatial motion vector predictor for the current block as is or after scaling.

[0248] [Table 19]

[0249] In the example in Table 19, unlike the scan order in Table 17, block A m+1 Check whether Block A satisfies conditions 1 to 4 in order. m+1 If condition 1 to condition 4 are not met, block A m Check whether it satisfies review conditions 1 to 4 in order.

[0250] When a block satisfying the consideration condition is found during the scanning process, the encoding apparatus or the decoding apparatus stops the scan and selects the motion vector of the corresponding block as a candidate of the motion vector predictor for the current block. The encoding apparatus or the decoding apparatus may scale the motion vector of a neighboring block as necessary and use it as a candidate of the motion vector predictor. For example, when the reference picture of the neighboring block is different from that of the current block, the encoding apparatus or the decoding apparatus may scale the motion vector of the corresponding neighboring block and use it as a candidate of the motion vector predictor. In this case, the method of Equation 1 or Equation 2 described above may be used as the scaling method.

[0251] Table 20 shows the left neighboring block A of the current block 900 in FIG. m , A m+1 According to the priority order of the above consideration conditions, the motion vector of the first block confirmed to be available is used as a candidate spatial motion vector predictor for the current block as is or after scaling.

[0252] [Table 20]

[0253] In the example of Table 20, the scan order applied in the example of Table 18 is different from that in the example of Table 18, in block A. m+1 For example, in the example of Table 20, Block A m+1 Check whether Block A satisfies condition 1. m+1 does not satisfy the first condition, block A is m Check whether Block A satisfies the first condition. m If condition 1 is not met, block A is m+1 Block A checks whether it satisfies any one of the conditions 2 to 4. m+1 If condition 2 to condition 4 are not satisfied, block A is selected according to the scan order. m Check whether the condition satisfies any one of the conditions 2 to 4.

[0254] When a block satisfying the consideration condition is found during the scanning process, the encoding apparatus or the decoding apparatus stops the scan and selects the motion vector of the corresponding block as a candidate of the motion vector predictor for the current block. The encoding apparatus or the decoding apparatus may scale the motion vector of a neighboring block as necessary and use it as a candidate of the motion vector predictor. For example, when the reference picture of the neighboring block is different from that of the current block, the encoding apparatus or the decoding apparatus may scale the motion vector of the corresponding neighboring block and use it as a candidate of the motion vector predictor. In this case, the method of Equation 1 or Equation 2 described above may be used as the scaling method.

[0255] Table 21 shows the left neighboring block A of the current block 900 in FIG. m , Am+1 According to the priority order of the above consideration conditions, the motion vector of the first block confirmed to be available is used as a candidate spatial motion vector predictor for the current block as is or after scaling.

[0256] [Table 21]

[0257] In the example of Table 21, first, Block A m+1 Check whether Block A satisfies the first condition. m+1 does not satisfy the first condition, block A is m Check whether Block A satisfies the first condition. m If condition 1 is not satisfied, block A is selected according to the scan order. m+1 Check whether Block A satisfies the second condition. m+1 If condition 2 is not satisfied, block A is selected according to the scan order. m Check whether Block A satisfies the second condition. m If condition 2 is not met, block A m+1 Check whether Block A satisfies one of the conditions 3 to 4 in order. m Check whether or not it satisfies one of the conditions 3 to 4 in order.

[0258] When a block satisfying the consideration condition is found during the scanning process, the encoding apparatus or the decoding apparatus stops the scan and selects the motion vector of the corresponding block as a candidate of the motion vector predictor for the current block. The encoding apparatus or the decoding apparatus may scale the motion vector of a neighboring block as necessary and use it as a candidate of the motion vector predictor. For example, when the reference picture of the neighboring block is different from that of the current block, the encoding apparatus or the decoding apparatus may scale the motion vector of the corresponding neighboring block and use it as a candidate of the motion vector predictor. In this case, the method of Equation 1 or Equation 2 described above may be used as the scaling method.

[0259] Table 22 shows the left neighboring block A of the current block 900 in FIG. m , A m+1 According to the priority order of the above consideration conditions, the motion vector of the first block confirmed to be available is used as a candidate spatial motion vector predictor for the current block as is or after scaling.

[0260] [Table 22]

[0261] In Table 22, two conditions are examined for each block. Specifically, first, the encoding device or decoding device is m+1 Check whether Block A satisfies the first condition. m+1 does not satisfy the consideration condition 1, the encoding device or the decoding device m+1 Check whether Block A satisfies the second condition. m+1 does not satisfy the consideration condition 2, the encoding device or the decoding device m Check whether Block A satisfies the first condition. mdoes not satisfy the consideration condition 1, the encoding device or the decoding device m Check whether Block A satisfies the second condition. m does not satisfy the consideration condition 2, the encoding device or the decoding device m+1 Check whether Block A satisfies the condition 3. m+1 does not satisfy the consideration condition 3, the encoding device or the decoding device m+1 Check whether Block A satisfies condition 4. m+1 does not satisfy the consideration condition 4, the encoding device or the decoding device m Check whether Block A satisfies the condition 3. m does not satisfy the consideration condition 3, the encoding device or the decoding device m Check whether it satisfies consideration condition 4.

[0262] When a block satisfying the consideration condition is found during the scanning process, the encoding apparatus or the decoding apparatus stops the scan and selects the motion vector of the corresponding block as a candidate of the motion vector predictor for the current block. The encoding apparatus or the decoding apparatus may scale the motion vector of a neighboring block as necessary and use it as a candidate of the motion vector predictor. For example, when the reference picture of the neighboring block is different from that of the current block, the encoding apparatus or the decoding apparatus may scale the motion vector of the corresponding neighboring block and use it as a candidate of the motion vector predictor. In this case, the method of Equation 1 or Equation 2 described above may be used as the scaling method.

[0263] As shown in the examples of Tables 17 to 22, the left neighboring block A of the current block m and A m+1In order to obtain a motion vector predictor candidate for the current block, i.e., a left motion vector candidate, various scan orders can be applied.

[0264] At this time, some scans can be omitted or removed to reduce the number of scan executions and obtain a gain in complexity. For example, in the example of Table 17, only scans in orders 1 to 5 can be executed, and scans in orders 6 to 8 can be omitted. Similarly, in the examples of Tables 18 to 22, scans in later orders (e.g., 5 to 8, 6 to 8, 7 to 8, or 8, etc.) can be omitted to reduce the complexity of the process.

[0265] Also, the procedure for checking whether the review conditions are met can be grouped by review conditions to obtain a gain in complexity. For example, in the case of Table 22, two review conditions are checked in order for each block.

[0266] Also, the example of Table 21 and the example of Table 22 are methods that prioritize Consideration Condition 1 and Consideration Condition 2. As described above, since the blocks corresponding to Consideration Condition 1 and Consideration Condition 2 have the same reference picture as the current block, the motion vector of the corresponding block can be used as a candidate for the motion vector predictor for the current block without scaling. Therefore, the frequency of scaling can be reduced, and the complexity can be reduced.

[0267] Below, the upper surrounding block B of the current block -1 , B n , B n+1 A method of selecting a motion vector predictor candidate for a current block, i.e., an upper motion vector predictor, from the upper neighboring blocks will be described. The method of selecting a motion vector predictor candidate for a current block from the upper neighboring blocks is basically the same as the method of selecting a motion vector predictor candidate for a current block from the left neighboring blocks, except that there are three blocks to be scanned. In the following table, the numbers 1 to 12 indicate the order of scanning.

[0268] Table 23 shows the block B above the current block 900 in FIG. -1 , B n , B n+1 According to the priority order of the above consideration conditions, the motion vector of the first block confirmed to be available is used as a candidate spatial motion vector predictor for the current block either directly or after scaling.

[0269] [Table 23]

[0270] In the example in Table 23, Block B n+1 Check whether Block B satisfies one of the above conditions. n+1 If does not satisfy the first condition, then block B n+1 Check whether block B satisfies the condition 2. n+1 If condition 1 to condition 4 are not met, block B n It is checked whether Block B satisfies one of the conditions 1 to 4 in order. n If condition 1 to condition 4 are not met, block B -1 It is checked in order whether or not the condition satisfies one of the conditions 1 to 4.

[0271] If the corresponding block satisfies the consideration condition during the scanning process, the encoding apparatus or the decoding apparatus stops the scan and selects the motion vector of the corresponding block as a candidate of the motion vector predictor for the current block. The encoding apparatus or the decoding apparatus may scale the motion vector of the neighboring block as necessary and use it as a candidate of the motion vector predictor. For example, if the reference picture of the neighboring block is different from that of the current block, the encoding apparatus or the decoding apparatus may scale the motion vector of the corresponding neighboring block and use it as a candidate of the motion vector predictor. In this case, the above-mentioned method of Equation 1 or Equation 2 may be used as the scaling method.

[0272] Table 24 shows the current block 900 in FIG. -1 , B n , B n+1 According to the priority order of the above consideration conditions, the motion vector of the first block confirmed to be available is used as a candidate spatial motion vector predictor for the current block as is or after scaling.

[0273] [Table 24]

[0274] In the example in Table 24, Block B n+1 Check whether Block B satisfies the consideration condition 1. n+1 If condition 1 is not met, block B n Check whether Block B satisfies the consideration condition 1. n If condition 1 is not met, block B -1 Check whether Block B satisfies the consideration condition 1. -1 If condition 1 is not met, block B is used again. n+1 From B -1 Block B checks whether condition 2 is met. n+1 , Bn , B -1 If does not satisfy the second condition, then B n+1 From B -1 In this order, check whether or not the condition 3 is satisfied. n+1 , B n , B -1 It is checked in the scan order whether there is a block that satisfies one of the conditions 1 to 4.

[0275] When a neighboring block that satisfies the consideration condition is found during the scanning process, the encoding apparatus or the decoding apparatus stops the scan and selects the motion vector of the corresponding block as a candidate of the motion vector predictor for the current block. The encoding apparatus or the decoding apparatus may scale the motion vector of the neighboring block as necessary and use it as a candidate of the motion vector predictor. For example, when the reference picture of the neighboring block is different from that of the current block, the encoding apparatus or the decoding apparatus may scale the motion vector of the corresponding neighboring block and use it as a candidate of the motion vector predictor. In this case, the method of Equation 1 or Equation 2 described above may be used as the scaling method.

[0276] Table 25 shows the upper neighboring block B of the current block 900 in FIG. -1 , B n , B n+1 According to the priority order of the above consideration conditions, the motion vector of the first block confirmed to be available is scanned and used as a candidate spatial motion vector predictor for the current block either directly or after scaling.

[0277] [Table 25]

[0278] In the example of Table 25, block B checks whether or not condition 1 is met. n+1 , B n , B-1 If there is no upper peripheral block that satisfies the examination condition 1, block B n+1 Block B checks whether it satisfies one of the conditions 2 to 4. n+1 If condition 2 to condition 4 are not met, block B n Block B checks whether it satisfies one of the conditions 2 to 4. n If condition 2 to condition 4 are not met, block B -1 Check whether it satisfies one of the conditions 2 to 4 in order.

[0279] When a block satisfying the consideration condition is found during the scanning process, the encoding apparatus or the decoding apparatus stops the scan and selects the motion vector of the corresponding block as a candidate of the motion vector predictor for the current block. The encoding apparatus or the decoding apparatus may scale the motion vector of a neighboring block as necessary and use it as a candidate of the motion vector predictor. For example, when the reference picture of the neighboring block is different from that of the current block, the encoding apparatus or the decoding apparatus may scale the motion vector of the corresponding neighboring block and use it as a candidate of the motion vector predictor. In this case, the method of Equation 1 or Equation 2 described above may be used as the scaling method.

[0280] Table 26 shows the upper neighboring block B of the current block 900 in FIG. -1 , B n , B n+1 According to the priority order of the above consideration conditions, the motion vector of the first block confirmed to be available is used as a candidate spatial motion vector predictor for the current block as is or after scaling.

[0281] [Table 26]

[0282] In the example of Table 26, unlike the example of Table 25, for the examination conditions 1 and 2, each examination condition is assigned to block B. n+1 , B n , B -1 For example, first, check whether block B satisfies condition 1. Then, check whether conditions 3 and 4 are satisfied for each block. n+1 , B n , B -1 If there is no upper peripheral block that satisfies the examination condition 1, the system checks whether the block B satisfies the examination condition 2. n+1 , B n , B -1 If there is no upper block that satisfies either of the conditions 1 and 2, block B n+1 Check whether Block B satisfies either Condition 3 or Condition 4. n+1 If condition 3 and condition 4 are not satisfied, block B n Block B checks whether it satisfies one of the conditions 3 or 4. n If condition 3 and condition 4 are not satisfied, block B -1 It is checked in order whether the condition satisfies one of the conditions 3 or 4.

[0283] When a block satisfying the consideration condition is found during the scanning process, the encoding apparatus or the decoding apparatus stops the scan and selects the motion vector of the corresponding block as a candidate of the motion vector predictor for the current block. The encoding apparatus or the decoding apparatus may scale the motion vector of a neighboring block as necessary and use it as a candidate of the motion vector predictor. For example, when the reference picture of the neighboring block is different from that of the current block, the encoding apparatus or the decoding apparatus may scale the motion vector of the corresponding neighboring block and use it as a candidate of the motion vector predictor. In this case, the method of Equation 1 or Equation 2 described above may be used as the scaling method.

[0284] Table 27 shows the upper neighboring block B of the current block 900 in FIG. -1 , B n , B n+1 According to the priority order of the above consideration conditions, the motion vector of the first block confirmed to be available is used as a candidate spatial motion vector predictor for the current block as is or after scaling.

[0285] [Table 27]

[0286] In the example of Table 27, like the example of Table 22, two consideration conditions are checked for each block. n+1 Block B checks whether it satisfies either Condition 1 or Condition 2. n+1 If neither condition 1 nor condition 2 is satisfied, block B n Block B checks whether it satisfies either Condition 1 or Condition 2. n If neither condition 1 nor condition 2 is satisfied, block B -1 Check whether the upper block satisfies either the condition 1 or the condition 2. If the upper block does not satisfy the condition 1 or the condition 2, n+1 Block B checks whether it satisfies one of the conditions 3 or 4. n+1 If neither condition 3 nor condition 4 is satisfied, block B n Block B checks whether it satisfies one of the conditions 3 or 4. n If neither condition 3 nor condition 4 is satisfied, block B -1 It is checked in order whether the condition satisfies one of the conditions 3 or 4.

[0287] When a block satisfying the consideration condition is found during the scanning process, the encoding apparatus or the decoding apparatus stops the scan and selects the motion vector of the corresponding block as a candidate of the motion vector predictor for the current block. The encoding apparatus or the decoding apparatus may scale the motion vector of a neighboring block as necessary and use it as a candidate of the motion vector predictor. For example, when the reference picture of the neighboring block is different from that of the current block, the encoding apparatus or the decoding apparatus may scale the motion vector of the corresponding neighboring block and use it as a candidate of the motion vector predictor. In this case, the method of Equation 1 or Equation 2 described above may be used as the scaling method.

[0288] As shown in Tables 23 to 27, various scan orders can be applied to obtain motion vector predictor candidates for the current block from blocks to the left of the current block, as well as to obtain motion vector predictor candidates for the current block from blocks above the current block.

[0289] In the method of obtaining a motion vector predictor candidate for a current block from an upper block, i.e., a top motion vector candidate (top mv candidate), the number of cases where scanning is performed can also be reduced to reduce complexity. For example, scanning can be performed only in the case of a scan to check whether or not examination condition 1 is satisfied, or in the case of the first scan for each examination condition. In this case, in the example of Table 23, scans of orders 6, 7, 8, 10, 11, and 12 can be omitted.

[0290] Also, the examples of Tables 26 and 27 are methods that prioritize consideration conditions 1 and 2, similar to the examples of Tables 21 and 22. Blocks that fall under consideration conditions 1 and 2 refer to the same reference picture as the current block (e.g., the current prediction unit), and therefore can be used as candidates for the motion vector predictor for the current block without scaling the motion vector. Therefore, the complexity caused by the scaling of the motion vector can be reduced.

[0291] Meanwhile, various combinations of examination conditions, the order of examination conditions, and the order of block positions can be applied in addition to the above-mentioned scanning methods. Also, the above-mentioned scanning methods can be applied in combination.

[0292] Although the term "motion vector predictor" is used in this specification, this is for convenience of explanation, and the motion vector predictor may also be called a predicted motion vector (PMV) or the like.

[0293] In Figures 4, 5, 7, 8, and 9, the current block and the neighboring blocks of the current block may be prediction units. In addition, in Figures 4, 5, 7, 8, and 9, the current block and the neighboring blocks of the current block may be transform units. Therefore, the contents described in Figures 4, 5, 7, 8, and 9 can be similarly applied to the case where the current block and the neighboring blocks of the current block are coding units or transform units.

[0294] Meanwhile, in this specification, the process of selecting a motion vector predictor candidate and performing prediction for a current block using the selected motion vector predictor candidate is described as being performed in an encoding device or a decoding device, but this is for convenience of explanation, and the present invention is not limited thereto. The process of selecting a motion vector predictor candidate and performing prediction for a current block using the selected motion vector predictor candidate may be performed in a predetermined module or unit in the encoding device or the decoding device. For example, the process of selecting a motion vector predictor candidate and performing prediction for a current block using the selected motion vector predictor candidate may be performed in a prediction unit in the encoding device or the decoding device.

[0295] 10 is a flow chart for explaining a method for selecting a motion vector predictor for a current block according to the present invention. Each step of FIG. 10 may be performed by an encoding device or a decoding device. Also, each step of FIG. 10 may be performed by a prediction unit of the encoding device or the decoding device. For convenience of explanation, it is assumed that each step of FIG. 10 is performed by a prediction unit in the encoding device or the decoding device.

[0296] 10, the prediction unit selects a motion vector predictor candidate for the current block (S1010). The prediction unit may select the motion vector of the first block searched as available from the neighboring blocks of the current block as a motion vector predictor candidate for the current block. In this case, the prediction unit may search the neighboring blocks of the current block by dividing them into predetermined groups, and may select a motion vector predictor candidate for the current block for each group.

[0297] In this case, the available blocks are blocks that are encoded / decoded in an inter prediction mode and satisfy the above-mentioned consideration conditions. The method of dividing the neighboring blocks of the current block into groups is as described above.

[0298] In addition, the prediction unit may scale the motion vector of the first block found to be available and select it as a candidate motion vector predictor for the current block. For example, if the first block found to be available satisfies the above-mentioned consideration condition 3 or 4, the prediction unit may scale the motion vector of the corresponding block. A specific method of scaling is as described above.

[0299] When the number of candidates for motion vector predictors that can be obtained from spatial neighboring blocks does not reach a predetermined number, the prediction unit can also obtain candidates for motion vector predictors from temporal neighboring blocks.

[0300] The prediction unit may select a motion vector predictor for the current block from among motion vector predictor candidates (S1020). The prediction unit may form a motion vector predictor list with the selected motion vector predictor candidates. The prediction unit of the encoding device may select a motion vector predictor that minimizes the amount of transmitted information from the motion vector predictor list. The prediction unit of the decoding device may select a motion vector predictor indicated by information on the motion vector predictor (e.g., a motion vector predictor index) transmitted from the encoding device from the motion vector predictor list, and perform prediction for the current block.

[0301] In the exemplary systems described above, the methods are described based on a sequence of steps or flow diagrams, but the invention is not limited to this order of steps, and certain steps may be performed in a different order or simultaneously with different steps than described above. Additionally, the embodiments described above include examples of various aspects.

[0302] Therefore, the present invention includes embodiments in which the above-mentioned embodiments are applied simultaneously or in combination. [Explanation of symbols]

[0303] 100 Video encoding device 105 Picture division section 110 Prediction Department 115 Conversion unit 120 Quantization section 125 Realignment Section 130 Entropy Encoding Section 135 Inverse quantization section 140 Reverse conversion unit 145 Filter section 150 Memory 200 Video Decoding Device 210 Entropy Decoding Unit 215 Realignment Department 220 Inverse quantization section 225 Inverse conversion unit 230 Prediction Department 235 Filter section 240 Memory

Claims

1. A method for transmitting data relating to a video, comprising the steps of: generating a bitstream relating to the video, the bitstream comprising: Deriving a motion vector predictor (MVP) candidate from a group of neighboring blocks based on a confirmation order, the group of neighboring blocks including a first block located at a lower left corner of the current block and a second block adjacent to an upper side of the first block; determining an MVP for the current block based on the MVP candidates; deriving a motion vector difference (MVD) of the current block based on the MVP of the current block; generating MVD information indicating the MVD of the current block; and generating the MVD information based on encoding the video information including the MVD information. transmitting the data including the bitstream; The confirmation order is determined as the first block, the second block, and deriving the MVP candidates is performed based on a first condition and a second condition; The first condition is whether a block in the neighboring block group has the same reference picture and reference picture list as the reference picture and reference picture list of the current block; the second condition is whether a block in the neighboring block group has the same reference picture as the reference picture of the current block and has a reference picture list different from the reference picture list of the current block; A method according to claim 1, wherein, in deriving the MVP candidate, when the first block is determined not to satisfy the first condition and the second condition, it is confirmed whether the second block satisfies the first condition or the second condition.

2. A device for transmitting data relating to a video, comprising: at least one processor configured to generate a bitstream relating to the video, the bitstream comprising: Deriving a motion vector predictor (MVP) candidate from a group of neighboring blocks based on a confirmation order, the group of neighboring blocks including a first block located at a lower left corner of the current block and a second block adjacent to an upper side of the first block; determining an MVP for the current block based on the MVP candidates; deriving a motion vector difference (MVD) of the current block based on the MVP of the current block; generating MVD information indicating the MVD of the current block; a processor, the processor being generated based on encoding video information including the MVD information; a transmitter configured to transmit the data including the bitstream; The confirmation order is determined as the first block, the second block, and The MVP candidate is derived based on a first condition and a second condition; The first condition is whether a block in the neighboring block group has the same reference picture and reference picture list as the reference picture and reference picture list of the current block; the second condition is whether a block in the neighboring block group has the same reference picture as the reference picture of the current block and has a reference picture list different from the reference picture list of the current block; When the first block is determined to not satisfy the first condition and the second condition, it is confirmed whether the second block satisfies the first condition or the second condition.

Citation Information

Patent Citations

  • Inter prediction encoding method

    WO2012023763A2

  • Prediction encoding method, prediction encoding device, and prediction encoding program for motion vector, as well as prediction decoding method, prediction decoding device, and prediction decoding program for motion vector

    WO2012093585A1