WO2019112072A1 - Image decoding method and device on basis of modified motion information candidate list in image coding system - Google Patents

Image decoding method and device on basis of modified motion information candidate list in image coding system Download PDF

Info

Publication number
WO2019112072A1
WO2019112072A1 PCT/KR2017/014073 KR2017014073W WO2019112072A1 WO 2019112072 A1 WO2019112072 A1 WO 2019112072A1 KR 2017014073 W KR2017014073 W KR 2017014073W WO 2019112072 A1 WO2019112072 A1 WO 2019112072A1
Authority
WO
WIPO (PCT)
Prior art keywords
motion information
candidate
current block
candidate list
candidates
Prior art date
Application number
PCT/KR2017/014073
Other languages
French (fr)
Korean (ko)
Inventor
서정동
Original Assignee
엘지전자 주식회사
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 엘지전자 주식회사 filed Critical 엘지전자 주식회사
Priority to PCT/KR2017/014073 priority Critical patent/WO2019112072A1/en
Publication of WO2019112072A1 publication Critical patent/WO2019112072A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/103Selection of coding mode or of prediction mode
    • H04N19/105Selection of the reference unit for prediction within a chosen coding or prediction mode, e.g. adaptive choice of position and number of pixels used for prediction
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • H04N19/51Motion estimation or motion compensation

Definitions

  • the present invention relates to an image coding technique, and more particularly, to an image decoding method and apparatus based on a modified motion information candidate list of a current block in an image coding system.
  • HD high definition
  • UHD ultra high definition
  • the present invention provides a method and apparatus for enhancing video coding efficiency.
  • a motion information candidate list generation method comprising: generating motion information candidate lists by updating candidates of a motion information candidate list of a current block without receiving additional information; And a method and an apparatus for performing inter prediction.
  • an image decoding method performed by a decoding apparatus includes the steps of: obtaining information on inter prediction of a current block through a bitstream; generating a motion information candidate list of the current block based on neighboring blocks of the current block; Generating a modified motion information candidate list by updating the current motion information list, deriving motion information of the current block based on the inter prediction information and the modified motion information list, And performing inter prediction of the current block.
  • a decoding apparatus for performing image decoding.
  • the decoding apparatus includes an entropy decoding unit that obtains information on inter prediction of a current block through a bitstream, and a motion information candidate list generation unit that generates a motion information candidate list of the current block based on neighboring blocks of the current block, To generate a modified motion information candidate list by deriving motion information of the current block based on information on the inter prediction and the modified motion information list, And a prediction unit for performing inter prediction of the current block.
  • a video encoding method performed by an encoding apparatus.
  • the method includes generating motion information for a current block, generating a motion information candidate list of the current block based on neighboring blocks of the current block, updating the motion information candidate list candidates, ) Motion information candidate list, and encoding and outputting information on inter prediction of the current block.
  • a video encoding apparatus includes generating motion information for a current block, generating a motion information candidate list of the current block based on neighboring blocks of the current block, updating the candidates of the motion information candidate list, a predictor for generating a modified motion information candidate list, and an entropy encoding unit for encoding and outputting information on inter prediction of the current block.
  • a motion information candidate list including the modified candidate of the current block can be generated to derive more accurate motion information, thereby reducing the bit amount of information for inter prediction of the current block and reducing the overall coding efficiency Can be improved.
  • the present invention it is possible to generate a modified motion information candidate list by updating the candidates of the motion information candidate list without receiving additional additional information, thereby obtaining more accurate motion information.
  • the bit amount of the information for the inter prediction of the current block can be reduced and the overall coding efficiency can be improved.
  • FIG. 1 is a view for schematically explaining a configuration of a video encoding apparatus to which the present invention can be applied.
  • FIG. 2 is a schematic view illustrating a configuration of a video decoding apparatus to which the present invention can be applied.
  • FIG. 3 shows neighboring blocks for generating a motion information candidate list of the current block.
  • FIG. 4 shows an example of a template of the current block.
  • FIG. 5 shows an example of updating a motion information candidate list based on the template of the current block.
  • FIG. 6 shows an example of updating a motion information candidate list based on the template of the current block.
  • FIG. 7 shows an example of updating a motion information candidate list based on the template of the current block.
  • FIG. 8 shows an example of updating the motion information candidate list based on the priorities derived according to the directions of the motion vectors of the candidates.
  • FIG. 9 shows an example of updating the motion information candidate list based on the template of the current block and the priorities derived according to the directions of the motion vectors of the candidates of the motion information candidate list.
  • FIG. 10 schematically shows a video encoding method by an encoding apparatus according to the present invention.
  • FIG. 11 schematically shows a video decoding method by a decoding apparatus according to the present invention.
  • a picture generally refers to a unit that represents one image in a specific time zone
  • a slice is a unit that constitutes a part of a picture in coding.
  • One picture may be composed of a plurality of slices, and pictures and slices may be used in combination if necessary.
  • a pixel or a pel may mean a minimum unit of a picture (or image). Also, a 'sample' may be used as a term corresponding to a pixel.
  • a sample may generally represent a pixel or pixel value and may only represent a pixel / pixel value of a luma component or only a pixel / pixel value of a chroma component.
  • a unit represents a basic unit of image processing.
  • a unit may include at least one of a specific area of a picture and information related to the area.
  • the unit may be used in combination with terms such as a block or an area in some cases.
  • an MxN block may represent a set of samples or transform coefficients consisting of M columns and N rows.
  • FIG. 1 is a view for schematically explaining a configuration of a video encoding apparatus to which the present invention can be applied.
  • the video encoding apparatus 100 includes a picture dividing unit 105, a predicting unit 110, a residual processing unit 120, an adding unit 140, a filter unit 150, and a memory 160 .
  • the residual processing unit 120 may include a subtracting unit 121, a transforming unit 122, a quantizing unit 123, a reordering unit 124, an inverse quantizing unit 125 and an inverse transforming unit 126.
  • the picture dividing unit 105 may divide the inputted picture into at least one processing unit.
  • the processing unit may be referred to as a coding unit (CU).
  • the coding unit may be recursively partitioned according to a quad-tree binary-tree (QTBT) structure from the largest coding unit (LCU).
  • QTBT quad-tree binary-tree
  • LCU largest coding unit
  • one coding unit may be divided into a plurality of coding units of deeper depth based on a quadtree structure and / or a binary tree structure.
  • the quadtree structure is applied first and the binary tree structure can be applied later.
  • a binary tree structure may be applied first.
  • the coding procedure according to the present invention can be performed based on the final coding unit which is not further divided.
  • the maximum coding unit may be directly used as the final coding unit based on the coding efficiency or the like depending on the image characteristics, or the coding unit may be recursively divided into lower-depth coding units Lt; / RTI > may be used as the final coding unit.
  • the coding procedure may include a procedure such as prediction, conversion, and restoration, which will be described later.
  • the processing unit may include a coding unit (CU) prediction unit (PU) or a transform unit (TU).
  • the coding unit may be split from the largest coding unit (LCU) into coding units of deeper depth along the quad tree structure.
  • LCU largest coding unit
  • the maximum coding unit may be directly used as the final coding unit based on the coding efficiency or the like depending on the image characteristics, or the coding unit may be recursively divided into lower-depth coding units Lt; / RTI > may be used as the final coding unit.
  • SCU smallest coding unit
  • the coding unit can not be divided into smaller coding units than the minimum coding unit.
  • the term " final coding unit " means a coding unit on which the prediction unit or the conversion unit is partitioned or divided.
  • a prediction unit is a unit that is partitioned from a coding unit, and may be a unit of sample prediction. At this time, the prediction unit may be divided into sub-blocks.
  • the conversion unit may be divided along the quad-tree structure from the coding unit, and may be a unit for deriving a conversion coefficient and / or a unit for deriving a residual signal from the conversion factor.
  • the coding unit may be referred to as a coding block (CB)
  • the prediction unit may be referred to as a prediction block (PB)
  • the conversion unit may be referred to as a transform block (TB).
  • the prediction block or prediction unit may refer to a specific area in the form of a block in a picture and may include an array of prediction samples.
  • a transform block or transform unit may refer to a specific region in the form of a block within a picture, and may include an array of transform coefficients or residual samples.
  • the prediction unit 110 may perform a prediction on a current block to be processed (hereinafter, referred to as a current block), and may generate a predicted block including prediction samples for the current block.
  • the unit of prediction performed in the prediction unit 110 may be a coding block, a transform block, or a prediction block.
  • the prediction unit 110 may determine whether intra prediction or inter prediction is applied to the current block. For example, the prediction unit 110 may determine whether intra prediction or inter prediction is applied in units of CU.
  • the prediction unit 110 may derive a prediction sample for a current block based on a reference sample outside the current block in a picture to which the current block belongs (hereinafter referred to as a current picture). At this time, the prediction unit 110 may derive a prediction sample based on (i) an average or interpolation of neighboring reference samples of the current block, (ii) The prediction sample may be derived based on a reference sample existing in a specific (prediction) direction with respect to the prediction sample among the samples. (i) may be referred to as a non-directional mode or a non-angle mode, and (ii) may be referred to as a directional mode or an angular mode.
  • the prediction mode may have, for example, 33 directional prediction modes and at least two non-directional modes.
  • the non-directional mode may include a DC prediction mode and a planar mode (Planar mode).
  • the prediction unit 110 may determine a prediction mode applied to a current block using a prediction mode applied to a neighboring block.
  • the prediction unit 110 may derive a prediction sample for a current block based on a sample specified by a motion vector on a reference picture.
  • the prediction unit 110 may derive a prediction sample for a current block by applying one of a skip mode, a merge mode, and a motion vector prediction (MVP) mode.
  • the prediction unit 110 can use motion information of a neighboring block as motion information of a current block.
  • difference residual between the predicted sample and the original sample is not transmitted unlike the merge mode.
  • MVP mode a motion vector of a current block can be derived by using a motion vector of a neighboring block as a motion vector predictor to use as a motion vector predictor of a current block.
  • a neighboring block may include a spatial neighboring block existing in a current picture and a temporal neighboring block existing in a reference picture.
  • the reference picture including the temporal neighboring block may be referred to as a collocated picture (colPic).
  • the motion information may include a motion vector and a reference picture index.
  • Information such as prediction mode information and motion information may be (entropy) encoded and output in the form of a bit stream.
  • the highest picture on the reference picture list may be used as a reference picture.
  • the reference pictures included in the picture order count can be sorted on the basis of the picture order count (POC) difference between the current picture and the corresponding reference picture.
  • POC picture order count
  • the POC corresponds to the display order of the pictures and can be distinguished from the coding order.
  • the subtraction unit 121 generates residual samples that are the difference between the original sample and the predicted sample. When the skip mode is applied, a residual sample may not be generated as described above.
  • the transforming unit 122 transforms the residual samples on a transform block basis to generate a transform coefficient.
  • the transforming unit 122 can perform the transform according to the size of the transform block and a prediction mode applied to the coding block or the prediction block spatially overlapping the transform block. For example, if intraprediction is applied to the coding block or the prediction block that overlaps the transform block and the transform block is a 4 ⁇ 4 residue array, the residual sample is transformed into a discrete sine transform (DST) In other cases, the residual samples can be converted using a DCT (Discrete Cosine Transform) conversion kernel.
  • DST discrete sine transform
  • the quantization unit 123 may quantize the transform coefficients to generate quantized transform coefficients.
  • the reordering unit 124 rearranges the quantized transform coefficients.
  • the reordering unit 124 may rearrange the block-shaped quantized transform coefficients into a one-dimensional vector form through a scanning method of coefficients.
  • the reordering unit 124 may be a part of the quantization unit 123, although the reordering unit 124 is described as an alternative configuration.
  • the entropy encoding unit 130 may perform entropy encoding on the quantized transform coefficients.
  • Entropy encoding may include, for example, an encoding method such as exponential Golomb, context-adaptive variable length coding (CAVLC), context-adaptive binary arithmetic coding (CABAC)
  • CAVLC context-adaptive variable length coding
  • CABAC context-adaptive binary arithmetic coding
  • the entropy encoding unit 130 may encode the information necessary for video restoration (such as the value of a syntax element) together with the quantized transform coefficient or separately.
  • the entropy encoded information may be transmitted or stored in units of NAL (network abstraction layer) units in the form of a bit stream.
  • NAL network abstraction layer
  • the inverse quantization unit 125 inversely quantizes the quantized values (quantized transform coefficients) in the quantization unit 123 and the inverse transformation unit 126 inversely quantizes the inversely quantized values in the inverse quantization unit 125, .
  • the adder 140 combines the residual sample and the predicted sample to reconstruct the picture.
  • the residual samples and the prediction samples are added in units of blocks so that a reconstruction block can be generated.
  • the adding unit 140 may be a part of the predicting unit 110, Meanwhile, the addition unit 140 may be referred to as a restoration unit or a restoration block generation unit.
  • the filter unit 150 may apply a deblocking filter and / or a sample adaptive offset. Through deblocking filtering and / or sample adaptive offsets, artifacts in the block boundary in the reconstructed picture or distortion in the quantization process can be corrected.
  • the sample adaptive offset can be applied on a sample-by-sample basis and can be applied after the process of deblocking filtering is complete.
  • the filter unit 150 may apply an ALF (Adaptive Loop Filter) to the restored picture.
  • the ALF may be applied to the reconstructed picture after the deblocking filter and / or sample adaptive offset is applied.
  • the memory 160 may store restored pictures (decoded pictures) or information necessary for encoding / decoding.
  • the reconstructed picture may be a reconstructed picture whose filtering procedure has been completed by the filter unit 150.
  • the stored restored picture may be used as a reference picture for (inter) prediction of another picture.
  • the memory 160 may store (reference) pictures used for inter prediction. At this time, the pictures used for inter prediction can be designated by a reference picture set or a reference picture list.
  • FIG. 2 is a schematic view illustrating a configuration of a video decoding apparatus to which the present invention can be applied.
  • the video decoding apparatus 200 includes an entropy decoding unit 210, a residual processing unit 220, a predicting unit 230, an adding unit 240, a filter unit 250, and a memory 260 .
  • the residual processing unit 220 may include a rearrangement unit 221, an inverse quantization unit 222, and an inverse transformation unit 223.
  • the video decoding apparatus 200 can restore video in response to a process in which video information is processed in the video encoding apparatus.
  • the video decoding apparatus 200 can perform video decoding using a processing unit applied in the video encoding apparatus.
  • the processing unit block of video decoding may be, for example, a coding unit and, in another example, a coding unit, a prediction unit or a conversion unit.
  • the coding unit may be partitioned along the quad tree structure and / or the binary tree structure from the maximum coding unit.
  • a prediction unit and a conversion unit may be further used as the case may be, in which case the prediction block is a block derived or partitioned from the coding unit and may be a unit of sample prediction. At this time, the prediction unit may be divided into sub-blocks.
  • the conversion unit may be divided along the quad tree structure from the coding unit and may be a unit that derives the conversion factor or a unit that derives the residual signal from the conversion factor.
  • the entropy decoding unit 210 may parse the bitstream and output information necessary for video restoration or picture restoration. For example, the entropy decoding unit 210 decodes information in a bitstream based on a coding method such as exponential Golomb coding, CAVLC, or CABAC, and calculates a value of a syntax element necessary for video restoration, a quantized value Lt; / RTI >
  • a coding method such as exponential Golomb coding, CAVLC, or CABAC
  • the CABAC entropy decoding method includes receiving a bean corresponding to each syntax element in a bitstream, decoding decoding target information of the decoding target syntax element, decoding information of a surrounding and decoding target block, or information of a symbol / A context model is determined and an occurrence probability of a bin is predicted according to the determined context model to perform arithmetic decoding of the bean to generate a symbol corresponding to the value of each syntax element have.
  • the CABAC entropy decoding method can update the context model using the information of the decoded symbol / bin for the context model of the next symbol / bean after determining the context model.
  • the residual value i.e., the quantized transform coefficient, which is entropy-decoded in the entropy decoding unit 210, 221).
  • the reordering unit 221 may rearrange the quantized transform coefficients into a two-dimensional block form.
  • the reordering unit 221 may perform reordering in response to the coefficient scanning performed in the encoding apparatus.
  • the rearrangement unit 221 may be a part of the inverse quantization unit 222, although the rearrangement unit 221 has been described as an alternative configuration.
  • the inverse quantization unit 222 may dequantize the quantized transform coefficients based on the (inverse) quantization parameters, and output the transform coefficients. At this time, the information for deriving the quantization parameter may be signaled from the encoding device.
  • the inverse transform unit 223 may invert the transform coefficients to derive the residual samples.
  • the prediction unit 230 may predict a current block and may generate a predicted block including prediction samples of the current block.
  • the unit of prediction performed in the prediction unit 230 may be a coding block, a transform block, or a prediction block.
  • the prediction unit 230 may determine whether intra prediction or inter prediction is to be applied based on the prediction information.
  • a unit for determining whether to apply intra prediction or inter prediction may differ from a unit for generating a prediction sample.
  • units for generating prediction samples in inter prediction and intra prediction may also be different.
  • whether inter prediction or intra prediction is to be applied can be determined in units of CU.
  • the prediction mode may be determined in units of PU to generate prediction samples.
  • a prediction mode may be determined in units of PU, and prediction samples may be generated in units of TU.
  • the prediction unit 230 may derive a prediction sample for the current block based on the surrounding reference samples in the current picture.
  • the prediction unit 230 may apply a directional mode or a non-directional mode based on the neighbor reference samples of the current block to derive a prediction sample for the current block.
  • a prediction mode to be applied to the current block may be determined using the intra prediction mode of the neighboring block.
  • the prediction unit 230 may derive a prediction sample for a current block based on a sample specified on a reference picture by a motion vector on a reference picture.
  • the prediction unit 230 may derive a prediction sample for a current block by applying a skip mode, a merge mode, or an MVP mode.
  • motion information necessary for inter-prediction of a current block provided in the video encoding apparatus for example, information on a motion vector, a reference picture index, and the like may be acquired or derived based on the prediction information
  • motion information of a neighboring block can be used as motion information of the current block.
  • the neighboring block may include a spatial neighboring block and a temporal neighboring block.
  • the prediction unit 230 may construct a merge candidate list using the motion information of the available neighboring blocks and use the information indicated by the merge index on the merge candidate list as the motion vector of the current block.
  • the merge index may be signaled from the encoding device.
  • the motion information may include a motion vector and a reference picture. When the motion information of temporal neighboring blocks is used in the skip mode and the merge mode, the highest picture on the reference picture list can be used as a reference picture.
  • the difference between the predicted sample and the original sample is not transmitted.
  • a motion vector of a current block can be derived using a motion vector of a neighboring block as a motion vector predictor.
  • the neighboring block may include a spatial neighboring block and a temporal neighboring block.
  • a merge candidate list may be generated using a motion vector of the reconstructed spatial neighboring block and / or a motion vector corresponding to a Col block that is a temporally neighboring block.
  • the motion vector of the candidate block selected in the merge candidate list is used as the motion vector of the current block.
  • the prediction information may include a merge index indicating a candidate block having an optimal motion vector selected from the candidate blocks included in the merge candidate list.
  • the predicting unit 230 can derive the motion vector of the current block using the merge index.
  • a motion vector predictor candidate list is generated by using a motion vector of the reconstructed spatial neighboring block and / or a motion vector corresponding to a Col block which is a temporally neighboring block . That is, the motion vector of the reconstructed spatial neighboring block and / or the motion vector corresponding to the neighboring block Col may be used as a motion vector candidate.
  • the information on the prediction may include a predicted motion vector index indicating an optimal motion vector selected from the motion vector candidates included in the list.
  • the predicting unit 230 can use the motion vector index to select a predictive motion vector of the current block from the motion vector candidates included in the motion vector candidate list.
  • the predicting unit of the encoding apparatus can obtain the motion vector difference (MVD) between the motion vector of the current block and the motion vector predictor, and can output it as a bit stream. That is, MVD can be obtained by subtracting the motion vector predictor from the motion vector of the current block.
  • the predicting unit 230 may obtain the motion vector difference included in the information on the prediction, and derive the motion vector of the current block through addition of the motion vector difference and the motion vector predictor.
  • the prediction unit may also acquire or derive a reference picture index or the like indicating the reference picture from the information on the prediction.
  • the adder 240 may add a residual sample and a prediction sample to reconstruct a current block or a current picture.
  • the adder 240 may add the residual samples and the prediction samples on a block-by-block basis to reconstruct the current picture.
  • the adder 240 has been described as an alternative configuration, but the adder 240 may be a part of the predictor 230.
  • the addition unit 240 may be referred to as a restoration unit or a restoration block generation unit.
  • the filter unit 250 may apply deblocking filtered sample adaptive offsets, and / or ALFs, to the reconstructed pictures.
  • the sample adaptive offset may be applied on a sample-by-sample basis and may be applied after deblocking filtering.
  • the ALF may be applied after deblocking filtering and / or sample adaptive offsets.
  • the memory 260 may store restored pictures (decoded pictures) or information necessary for decoding.
  • the reconstructed picture may be a reconstructed picture whose filtering procedure has been completed by the filter unit 250.
  • the memory 260 may store pictures used for inter prediction.
  • the pictures used for inter prediction may be designated by a reference picture set or a reference picture list.
  • the reconstructed picture can be used as a reference picture for another picture.
  • the memory 260 may output the restored picture according to the output order.
  • the inter prediction may be performed through motion compensation using motion information.
  • the motion information for the current block may be generated by applying a skip mode, a merge mode, or an adaptive motion vector prediction (AMVP) mode, and may be encoded and output.
  • the motion information may include L0 motion information for the L0 direction and / or L1 motion information for the L1 direction.
  • the L0 motion information may include an L0 reference picture index and a motion vector L0 (Motion Vector L0, MVL0) indicating an L0 reference picture included in a reference picture list L0 (List 0, L0) for the current block
  • the L1 motion information may include an L1 reference picture index and an MVL1 indicating an L1 reference picture contained in a reference picture list L0 (List 1, L1) for the current block.
  • the L0 direction may be referred to as a past direction or a forward direction.
  • the L1 direction may be referred to as a future direction or a reverse direction.
  • the reference picture list L0 may include previous pictures in the output order than the current picture
  • the reference picture list L1 may include pictures after the current picture in the output order.
  • the MVL0 may be referred to as an L0 motion vector
  • the MVL1 may be referred to as an L1 motion vector.
  • inter prediction In performing the prediction on the current block, if inter prediction is performed based on the L0 motion information, it may be referred to as LO prediction.
  • L1 prediction When inter prediction is performed based on L1 motion information, it may be referred to as L1 prediction.
  • Prediction may be referred to as bi-prediction when inter prediction is performed based on motion information and L1 motion information.
  • a method of transmitting the motion information includes a method of directly encoding and transmitting the motion information (for example, an AMVP mode) and a method of generating a list based on motion information of a neighboring block with respect to the current block, (E.g., a merge mode) may be included.
  • a method of directly encoding and transmitting the motion information for example, an AMVP mode
  • a method of generating a list based on motion information of a neighboring block with respect to the current block (E.g., a merge mode) may be included.
  • the process of encoding the motion vector of the current block in the image coding system includes a motion vector prediction process and a process of encoding a motion vector difference between the motion vector and the motion vector predictor .
  • the motion vector prediction process is proposed.
  • the motion vector predicting step may include a step of constructing a motion information candidate list by deriving motion information of a neighboring block of the current block, and a step of selecting one of motion information candidates included in the motion information candidate list, And using them as a motion vector predictor (MVP).
  • MVP motion vector predictor
  • the motion information candidate list may be referred to as an MVP candidate list.
  • the syntax for encoding the motion vector in inter prediction may be as shown in the following table.
  • inter_pred_idc may indicate a syntax element of an index indicating the direction of inter prediction of the current block.
  • inter_pred_idc may indicate a syntax element indicating whether the inter prediction performed on the current block is any of L0 prediction, L1 prediction, and pair prediction.
  • Ref_idx_l0 is a syntax element indicating a reference picture of the current block among the reference pictures included in the L0
  • ref_idx_l1 is a syntax element indicating a reference picture of the current block among the reference pictures included in the L1
  • mvp_l0_flag is MVPL0 (the motion vector predictor L0) is a syntax element of a flag indicating MVPL0 of the current block among the MVPL0 candidates included in the candidate list
  • mvp_l1_flag is a syntax element of a flag indicating MVPL1 among MVPL1 candidates included in the candidate list MVPL1 (motion vector predictor L1, MVPL1)
  • the syntax element mvd_coding carries the MVD information of the current block and may include syntax elements representing, for example, MVDL0 (motion vector difference L0, MVDL0) and / or MVDL1 (motion vector difference L1, MVDL1) have.
  • the MVPL0 candidate list may represent a motion information candidate list including MVPL0 candidates for a reference picture included in the L0, and MVPL0 may represent an MVP associated with a reference picture included in the L0.
  • the MVPL1 candidate list may represent a motion information candidate list including MVPL1 candidates for the reference pictures included in the L1, and MVPL1 may represent MVPs associated with the reference pictures included in the L1.
  • the ref_idx_l0 may be transmitted (signaled) when the L0 prediction or the pair prediction is performed on the current block, and ref_idx_l1 is transmitted when the L1 prediction or the pair prediction is performed on the current block .
  • the mvp_l0_flag may be transmitted when the L0 prediction or the pair prediction is performed on the current block, and the mvp_l1_flag may be transmitted when the L1 prediction or the pair prediction is performed on the current block.
  • the mvd_coding may include the MVDL0 and / or the MVDL1, and each MVD may be composed of an x component and a y component, and the sign and size of each component may be transmitted separately.
  • mvp_l0_flag or mvp_l1_flag may indicate a syntax element of an index indicating a candidate included in the MVPL0 candidate list or the MVPL1 candidate list, and the MVPL0 candidate list or MVPL1 candidate list may include two MVP candidates In this case, since one of the two MVP candidates is selected as the MVP of the current block, it can be expressed by a flag.
  • the motion information candidate list of the current block may be configured as described below.
  • FIG. 3 shows neighboring blocks for generating a motion information candidate list of the current block.
  • the motion information candidate list of the current block may be derived based on the neighboring blocks of the current block. That is, the merge candidate list or the MVP candidate list may be configured based on neighboring blocks at predetermined positions around the target block. For example, as shown in FIG. 3, two blocks A0 310 and A1 320 located on the left side of the target block and three blocks B0 330, B1 340 and B2 350 ), The merge candidate list or MVP candidate list may be constructed.
  • A0 310 may be referred to as a lower left neighboring block
  • A1 320 may be referred to as a left neighboring block.
  • B0 330 is an upper right neighboring block
  • B1 340 is an upper neighboring block
  • B2 350 is an upper left neighboring block .
  • one of a motion vector of the A0 310 and a motion vector of the A1 320 is a motion information candidate for the reference picture list of the current block Can be derived.
  • the reference picture list may indicate the L0 or the L1
  • the motion information candidate may indicate the MVP candidate.
  • the reference picture of the A0 310 and the reference picture of the A1 320 are different from the reference picture of the current block included in the reference picture list of the current block,
  • the motion vector of the current block 320 may not be derived as the motion information candidate of the current block.
  • the motion vector of the A0 310 or the motion vector of the A1 320 may be scaled, and the scaled motion vector may be derived as a motion information candidate of the current block.
  • the motion vector of the B0 330, the motion vector of the B1 340, and the motion vector of the B2 350 may be derived as motion information candidates for the reference picture list.
  • the reference picture list may represent L0 or L1.
  • the reference picture of the B0 330, the reference picture of the B1 340 and the reference picture of the B2 350 are different from the reference pictures of the current block included in the reference picture list of the current block,
  • the motion vector of the current block 330, the motion vector of the B1 340, and the motion vector of the B2 350 may not be derived as motion information candidates of the current block.
  • a motion vector of the B0 330, a motion vector of the B1 340, or a motion vector of the B2 350 may be scaled, and the scaled motion vector may be scaled It can be derived as a candidate.
  • the motion information candidates derived based on A0 and A1 are identical to the motion information candidates derived on the basis of B0, B1 and B2, the motion information candidates derived based on A0 and A1, One of the motion information candidates derived based on B1 and B2 may be deleted.
  • a motion vector of a collocated block may be scaled,
  • the scaled motion vector may be inserted as a motion information candidate in the motion information candidate list of the current block.
  • the co-located block may represent a corresponding block of the current block in a collocated picture, and the motion information candidate list may represent an MVP candidate list.
  • the co-located block may be referred to as a temporal neighboring block.
  • the zero vector may be inserted as the motion information candidate in the motion information candidate list even after the above process is performed.
  • the motion information candidate list may be derived as described above, but the motion information candidate list may be updated by further considering the receiving end motion information derivation method.
  • the motion vector prediction accuracy of the current block can be improved by updating the motion information candidate list. That is, MVP, which is more similar to the motion vector of the current block, can be derived through updating of the motion information candidate list. If the motion vector prediction accuracy of the current block is improved, the bit amount for MVD of the current block can be reduced and the overall video encoding / decoding efficiency can be improved.
  • the receiving end side motion information derivation method may represent a method of deriving motion information based on a template of the current block and a template of a reference block in a reference picture of the current block. That is, a reference block for a template having a minimum difference from the template of the current block can be derived, and motion information (or a motion vector) representing the reference block can be derived.
  • the decoding apparatus may set an arbitrary peripheral region of the current block as a template of the current block and perform motion information search on the current block using the same template as the template of the current block on the reference picture .
  • FIG. 4 shows an example of a template of the current block.
  • the template of the current block may be a specific region including neighboring samples of the current block. Since the left neighboring samples, the left upper neighbor sample, and the upper neighbor samples of the current block may have already been decoded at the decoding time of the current block and thus can be used for the motion information search process in the decoding apparatus, , The upper left neighbor sample and the upper neighbor sample may be included in the template of the current block.
  • the template may be a specific region including left neighboring samples, upper left neighboring samples, and upper neighboring samples of the current block.
  • the template may be a specific region including the left neighboring samples and the upper neighboring samples of the current block.
  • the template may be a specific region including the upper neighbor samples of the current block.
  • the template may be a specific region including the left neighboring samples of the current block.
  • a template having a minimum difference from the template of the current block among the templates of the blocks in the reference picture may be derived and a motion vector indicating a reference block of the derived template may be derived .
  • the difference may be called a cost.
  • the cost may be derived as the sum of the absolute values of the differences between the templates of the current block and the corresponding samples of the template of the reference block.
  • a cost function for deriving the motion vector of the current block can be expressed by the following equation. That is, the cost can be derived based on the following equation.
  • (I, j) represents the position (i, j) of the sample in the block
  • Cost distortion is the cost
  • Temp ref is the restored sample of the (i, j) coordinate in the template of the reference block in the reference picture
  • Temp cur Re represents a restoration sample of the (i, j) coordinate in the template of the current block.
  • the difference between the template of the reference block and the corresponding sample between the templates of the current block can be accumulated and a motion vector indicating a reference block having the smallest accumulation of the difference among the blocks in the reference picture can be derived .
  • the accumulation of the difference may represent the cost.
  • the motion information candidate list of the current block may be constructed as described above, and the motion information candidate list may be configured by the receiving end side motion information derivation method.
  • the motion information candidate lists Can be obtained.
  • the motion information candidate list of the current block may be configured based on the neighboring blocks of the current block
  • the motion information candidate list of the current block may be configured based on the template of the current block.
  • the motion information candidate list based on the neighboring blocks of the current block may be referred to as a first motion information candidate list and may be referred to as the second motion information candidate list based on the template of the current block.
  • a template of the current block can be set, a template having a small cost with respect to the template of the current block among the templates of blocks in the reference block of the current block can be derived, May be derived as a candidate of the second motion information candidate list.
  • the motion vector derived through the receiving end side motion information derivation method that is, the candidate of the second motion information candidate list May be inserted as candidates of the first motion information candidate list.
  • the method of updating the motion information candidate list based on the template of the current block may be described as follows.
  • FIG. 5 shows an example of updating a motion information candidate list based on the template of the current block.
  • the decoding apparatus may construct the motion information candidate list based on neighboring blocks of the current block (S500).
  • the decoding apparatus may derive modified motion information based on the template of the current block (S510). That is, the decoding apparatus can predict the corrected motion information using the receiving end side motion information derivation method.
  • the decoding apparatus can set the template of the current block as described above and derive a template having a small cost from the template of the current block among the templates of the blocks in the reference picture of the current block.
  • the decoding apparatus may derive the modified motion information indicating a reference block of the derived template.
  • the decoding apparatus may determine whether the candidates of the motion information candidate list are identical to the modified motion information (S520). If the candidates of the motion information candidate list and the modified motion information are not the same, the decoding apparatus may insert the modified motion information as candidates of the motion information candidate list in operation S530.
  • the candidate representing the modified motion information may be referred to as a modified candidate. In this case, the decoding apparatus can perform inter-prediction of the current block based on the candidate motion information candidate list. On the other hand, when the candidates of the motion information candidate list are identical to the modified motion information, the decoding apparatus can perform inter prediction of the current block based on the motion information candidate list in which the candidate is not inserted.
  • a method of determining the order of the candidates by applying the receiving end side motion information derivation method to the candidates of the configured motion information candidate list Can be.
  • the cost function can be calculated by applying the receiving end side motion information derivation method to the templates of the current block and the template of the current block and the motion information candidate list can be rearranged in order of decreasing cost of the cost function.
  • the reference blocks indicated by the candidates of the motion information candidate list can be derived, the cost of the templates of the reference blocks and the template of the current block can be calculated, and the cost of the motion information Candidates in the candidate list can be rearranged. Since the number of candidates in the motion information candidate list is two, there is no change in the amount of information to be encoded.
  • the number of bits of the index indicating the candidates of the motion information candidate list may be variable and the first candidate among the candidates of the motion information candidate list may be coded with the smallest bit number.
  • the method of updating the motion information candidate list based on the template of the current block may be described as follows.
  • FIG. 6 shows an example of updating a motion information candidate list based on the template of the current block.
  • the decoding apparatus may construct the motion information candidate list based on neighboring blocks of the current block (S600).
  • the decoding apparatus may calculate a cost function value of the candidates of the motion information candidate list based on the template of the current block (S610). That is, the decoding apparatus can calculate the cost function value of the candidates of the motion information candidate list based on the method of deriving the receiving end side motion information.
  • the decoding apparatus can set the template of the current block as described above and the templates of the reference blocks indicated by the candidates of the motion information candidate list can be derived.
  • the templates of the reference blocks may have the same shape as the template of the current block.
  • the cost of the template of the current block and the template of each reference block can be calculated.
  • the cost may represent the cost function value.
  • the decoding apparatus may determine whether the order of the candidates in the motion information candidate list is the same as the ascending order of the cost function values of the candidates in operation S620. If the order of the candidates of the motion information candidate list is not equal to the ascending order of the cost function values of the candidates, the decoding apparatus may rearrange the candidates of the motion information candidate list in order of decreasing the cost function value (S630 ). In this case, the decoding apparatus can perform inter prediction of the current block based on the reordered motion information candidate list. Meanwhile, when the candidates of the motion information candidate list and the modified motion information are the same, the decoding apparatus can perform the inter prediction of the current block based on the motion information candidate list that has not been rearranged.
  • a motion information candidate list including more than two candidates is constructed, and the motion information candidate list A method of determining the order of the candidates by applying the side motion information derivation method may be used.
  • a motion information candidate list including N candidates of more than two can be derived based on neighboring blocks of the current block, and templates of reference blocks indicated by the candidates and templates of the current block
  • the cost function can be calculated by applying the receiving end side motion information derivation method to the motion information candidate list, and the motion information candidate list can be rearranged in a descending order of cost.
  • the reference blocks indicated by the candidates of the motion information candidate list can be derived, the cost of the templates of the reference blocks and the template of the current block can be calculated, and the cost of the motion information Candidates in the candidate list can be rearranged.
  • two candidates of the candidates of the motion information candidate list are selected and modified to form a motion information candidate list.
  • the first candidate and the second candidate among the candidates of the reordered motion information candidate list may be selected, and the modified motion information candidate list may be configured based on the first candidate and the second candidate.
  • the prediction accuracy can be improved as compared with the case of performing the inter prediction using the existing motion information candidate list.
  • the method of updating the motion information candidate list based on the template of the current block may be described as follows.
  • FIG. 7 shows an example of updating a motion information candidate list based on the template of the current block.
  • the decoding apparatus may construct the motion information candidate list including N candidates based on neighboring blocks of the current block (S700). Where N may be a number greater than two (N > 2).
  • the decoding apparatus may calculate a cost function value of the candidates of the motion information candidate list based on the template of the current block (S710).
  • the decoding apparatus can set the template of the current block as described above and the templates of the reference blocks indicated by the candidates of the motion information candidate list can be derived.
  • the templates of the reference blocks may have the same shape as the template of the current block.
  • the cost of the template of the current block and the template of each reference block can be calculated.
  • the cost may represent the cost function value.
  • the decoding apparatus can arrange the candidates of the motion information candidate list in ascending order of the cost function values in the order of the candidates of the motion information candidate list and construct the modified motion information candidate list based on the candidates of the previous order in operation S720. If the order of the candidates of the motion information candidate list is not the same as the ascending order of the cost function values of the candidates, the decoding apparatus can rearrange the candidates of the motion information candidate list in descending order of the cost function value. Next, the decoding apparatus can construct a modified motion information candidate list based on the candidates of the motion information candidate list in the order ahead of the motion information candidate list. For example, the modified motion information candidate list may be configured based on the first candidate and the second candidate among the candidates of the reordered motion information candidate list. In this case, the decoding apparatus can perform inter-prediction of the current block based on the modified motion information candidate list.
  • a method of rearranging the candidates of the motion information candidate list considering the direction of the motion vector indicated by the candidate of the motion information candidate list may be proposed. Minimizing the difference between a motion vector derived through motion estimation and a predicted motion vector, i.e., a candidate included in the motion information candidate list, in predicting the motion vector of the current block improves the coding efficiency . Therefore, it is possible to further reduce the motion vector difference (MVD) of the current block if the candidates of the motion information candidate list indicate different directions.
  • VMD motion vector difference
  • the direction of the motion vector of each candidate included in the motion information candidate list configured to derive the motion vector of the current block may be divided into an x component and a y component of the motion vector,
  • the cases can be defined as different directions.
  • the sign of the x component of the motion vector represented by the first candidate included in the motion information candidate list is different from the sign of the x component of the motion vector represented by the second candidate
  • the x component of the first candidate and the second candidate When the y component of the motion vector represented by the first candidate and the y component of the motion vector represented by the second candidate are different from each other, the direction of the y component of the first candidate and the second candidate is It can be said that it is different.
  • the first candidate may represent a first candidate of the motion information candidate list
  • the second candidate may represent a candidate other than the first candidate among the candidates of the motion information candidate list.
  • both the x component direction and the y component direction of the first candidate and the second candidate are different, it can be set to the highest priority, and the x component direction or the y component of the first candidate and the second candidate If only the directions are different, it can be set to the medium priority, and if the x component direction and the y component direction of the first candidate and the second candidate are all the same, the lowest priority can be set.
  • the pseudo code for setting the priority order considering the directions of the motion vector represented by the first candidate and the motion vector represented by the second candidate is as follows.
  • mv0.x may represent the x component of the motion vector represented by the first candidate
  • mv0.y may represent the y component of the motion vector represented by the first candidate
  • mv1.x may represent the x component of the motion vector represented by the second candidate
  • mv1.y may represent the y component of the motion vector represented by the second candidate.
  • the motion information candidate list may be rearranged based on the priority.
  • a method of updating the motion information candidate list based on the priority of the first candidate may be described as follows.
  • FIG. 8 shows an example of updating the motion information candidate list based on the priorities derived according to the directions of the motion vectors of the candidates.
  • the decoding apparatus may construct the motion information candidate list including N candidates based on neighboring blocks of the current block (S800). Where N may be a number greater than two (N > 2).
  • the decoding apparatus may derive a second candidate as an n-th candidate to derive a priority based on the first candidate of the motion information candidate list (S810).
  • the decoding apparatus may calculate the priority of the n-th candidate based on the motion vector of the first candidate and the direction of the motion vector of the n-th candidate (S820).
  • the decoding apparatus may calculate the priority based on the x-component direction and the y-component direction of the first candidate and the second candidate. For example, if both the x component direction and the y component direction of the first candidate and the second candidate are different, it can be set to the highest priority, and only the x component direction or the y component direction of the first candidate and the second candidate Can be set to the intermediate priority and the lowest priority can be set if the x component direction and y component direction of the first candidate and the second candidate are all the same.
  • the direction of the x component of the first candidate and the second candidate may be different.
  • the y component of the motion vector of the first candidate and the y component of the motion vector of the second candidate are smaller than 0, the direction of the y component of the first candidate and the second candidate may be different.
  • the decoding apparatus may determine whether the n-th candidate is the N-th candidate (S830). If the nth candidate is not the Nth candidate, the decoding apparatus may calculate the priority of the (n + 1) th candidate based on the direction of the motion vector of the first candidate and the motion vector of the (n + 1) th candidate ). If the n-th candidate is the N-th candidate, the decoding apparatus can sort the order of the candidates of the motion information candidate list based on the priorities of the candidates, and the motion information candidate list (S850). The decoding apparatus can sort the order of the candidates of the motion information candidate list in descending order of priority of the candidates.
  • the decoding apparatus may construct a modified motion information candidate list based on the candidates in the preceding order among the aligned motion information candidate lists.
  • the modified motion information candidate list may be configured based on the first candidate and the second candidate among the candidates of the aligned motion information candidate list.
  • the decoding apparatus can perform inter-prediction of the current block based on the modified motion information candidate list.
  • both the above-described method of deriving the receiving end side motion information and the method of considering the priority derived based on the first candidate of the motion information candidate list can be considered.
  • FIG. 9 shows an example of updating the motion information candidate list based on the template of the current block and the priorities derived according to the directions of the motion vectors of the candidates of the motion information candidate list.
  • the decoding apparatus may construct the motion information candidate list including N candidates based on neighboring blocks of the current block (S900). Where N may be a number greater than two (N > 2).
  • the decoding apparatus may derive modified motion information based on the template of the current block (S910).
  • the decoding apparatus can set the template of the current block as described above and derive a template having a small cost from the template of the current block among the templates of the blocks in the reference picture of the current block.
  • the decoding apparatus may derive the modified motion information indicating a reference block of the derived template.
  • the decoding apparatus may determine whether the candidates of the motion information candidate list are identical to the modified motion information (S920). If the candidates of the motion information candidate list and the corrected motion information are not the same, the decoding apparatus may insert the modified motion information as candidates of the motion information candidate list (S930). On the other hand, when the candidates of the motion information candidate list are identical to the modified motion information, the modified motion information may not be inserted as candidates of the motion information candidate list.
  • the decoding apparatus may derive a second candidate as an n-th candidate to derive a priority based on the first candidate of the motion information candidate list (S940).
  • the decoding apparatus may calculate the priority of the n-th candidate based on the motion vector of the first candidate and the direction of the motion vector of the n-th candidate (S950).
  • the decoding apparatus may calculate the priority based on the x-component direction and the y-component direction of the first candidate and the second candidate.
  • both the x component direction and the y component direction of the first candidate and the second candidate are different, it can be set to the highest priority, and only the x component direction or the y component direction of the first candidate and the second candidate Can be set to the intermediate priority and the lowest priority can be set if the x component direction and y component direction of the first candidate and the second candidate are all the same.
  • the direction of the x component of the first candidate and the second candidate may be different.
  • the direction of the y component of the first candidate and the second candidate may be different.
  • the decoding device may determine whether the n-th candidate is the N-th candidate (S960). If the nth candidate is not the Nth candidate, the decoding apparatus may calculate the priority of the (n + 1) th candidate based on the direction of the motion vector of the first candidate and the motion vector of the (n + 1) th candidate ). If the n-th candidate is the N-th candidate, the decoding apparatus can sort the order of the candidates of the motion information candidate list based on the priorities of the candidates, and the motion information candidate list (S980). The decoding apparatus can sort the order of the candidates of the motion information candidate list in descending order of priority of the candidates.
  • the decoding apparatus may construct a modified motion information candidate list based on the candidates in the preceding order among the aligned motion information candidate lists.
  • the modified motion information candidate list may be configured based on the first candidate and the second candidate among the candidates of the aligned motion information candidate list.
  • the decoding apparatus can perform inter-prediction of the current block based on the modified motion information candidate list.
  • the modified motion information candidate list is derived as described above, the modified candidate most similar to the motion vector of the current block among the candidates of the motion information candidate list is the first candidate of the modified motion information candidate list And a motion vector which is the direction opposite to the first candidate may be set as the second candidate of the modified motion information candidate list. Diversity of the motion vectors represented by the candidates of the modified motion information list can be guaranteed, and coding efficiency of the inter prediction can be improved.
  • the decoding apparatus can calculate the cost function values of the candidates of the motion information candidate list based on the template of the current block, and rearrange the candidates of the motion information candidate list in order of decreasing the cost function value .
  • the decoding apparatus can sort the motion information candidate list based on the priorities of the candidates derived based on the first candidate of the motion information candidate list, and generate a motion information candidate list based on the candidates of the previous order Can be configured.
  • the candidate with the smallest cost function value derived based on the template of the current block may be set as the first candidate of the motion information candidate list, and the motion Since the information candidate list can be reconstructed, the diversity of the motion vectors represented by the candidates of the modified motion information list can be guaranteed, and the coding efficiency of the inter prediction can be improved through this.
  • FIG. 10 schematically shows a video encoding method by an encoding apparatus according to the present invention.
  • the method disclosed in Fig. 10 can be performed by the encoding apparatus disclosed in Fig. Specifically, for example, S1000 to S1020 in FIG. 10 may be performed by the predicting unit of the encoding apparatus, and S1030 may be performed by the entropy encoding unit of the encoding apparatus.
  • the encoding apparatus generates motion information of the current block (S1000).
  • the encoding apparatus may apply inter prediction to the current block.
  • the encoding apparatus When inter prediction is applied to the current block, the encoding apparatus generates motion information on the current block by applying any one of a skip mode, a merge mode, and an adaptive motion vector prediction (AMVP) mode can do.
  • the encoding apparatus In the skip mode and the merge mode, the encoding apparatus can generate motion information of the current block based on motion information of a neighboring block of the current block.
  • the motion information may include a motion vector and a reference picture index.
  • the motion information may be bi-prediction motion information, or may be uni-prediction motion information.
  • the bi-predictive motion information may include an L0 reference picture index, an L0 motion vector, an L1 reference picture index, and an L1 motion vector
  • the short motion prediction information may include an L0 reference picture index and a L0 motion vector
  • An L1 reference picture index and an L1 motion vector L0 denotes a reference picture list L0 (List 0)
  • L1 denotes a reference picture list L1 (List 1).
  • the encoding apparatus may derive a motion vector of the current block using a motion vector of a neighboring block of the current block as a motion vector predictor (MVP) of the current block. Accordingly, the encoding apparatus can generate the motion information including the MVP flag indicating one of the candidates included in the motion information candidate list and the reference picture index for the motion vector.
  • MVP motion vector predictor
  • the encoding apparatus generates a motion information candidate list based on neighboring blocks of the current block (S1010).
  • the encoding apparatus may generate a motion information candidate list based on neighboring blocks of the current block.
  • the motion information candidate list may indicate a merge candidate list.
  • the motion information candidate list may include a motion vector predictor (MVP) candidate list Lt; / RTI >
  • MVP motion vector predictor
  • the encoding apparatus can generate a motion information candidate list including neighboring blocks of the current block, and when the AMVP mode is applied to the current block,
  • the motion information candidate list may be generated based on motion vectors of neighboring blocks of the current block.
  • the motion vectors may be derived as (MVP) candidates included in the motion information candidate list.
  • the encoding apparatus can generate the motion information candidate list based on motion vectors of neighboring blocks of the current block, and the motion information candidate list includes two candidates .
  • the motion information candidate list may include N candidates.
  • the motion information candidate list may include modified candidates of the current block.
  • the encoding apparatus may derive the modified candidate based on a template of the current block.
  • the template of the current block may be represented as a specific region including surrounding samples of the current block.
  • the template may be a specific region including left neighboring samples, upper left neighboring samples, and upper neighboring samples of the current block.
  • the template may be a specific region including the left neighboring samples of the current block and the upper neighboring samples.
  • the template may be a specific region including the upper neighbor samples of the current block.
  • the template may be a specific region including the left neighboring samples of the current block.
  • a template of a current block can be derived based on neighboring samples of the current block and a reference block having a template having a minimum cost from a template of the current block among the reference blocks in the reference block of the current block
  • the modified candidate may be derived based on the motion information indicating the specific reference block. That is, the modified candidate may represent a motion vector (or motion information) indicating the specific reference block.
  • the cost may be determined based on Equation (1).
  • the encoding apparatus updates the candidates of the motion information candidate list to generate a modified motion information candidate list (S1020).
  • the encoding apparatus can update the motion information candidate list to generate the modified motion information candidate list.
  • the encoding apparatus may generate the modified motion information candidate list based on the template of the current block.
  • the template of the current block can be derived based on the surrounding samples of the current block, and the templates of the reference blocks indicated by the candidates of the motion information candidate list can be derived.
  • the template of the current block may be represented as a specific region including surrounding samples of the current block as described above.
  • the templates of the reference blocks may represent specific regions corresponding to the template of the current block. That is, each of the templates of the reference blocks may be derived based on the surrounding samples of the neighboring samples and the corresponding reference blocks of the current block.
  • the templates of the reference blocks may have the same shape as the template of the current block.
  • the costs of the candidates may be derived based on the templates of the reference blocks and the template of the current block.
  • the cost may be determined based on Equation (1).
  • the order of the candidates of the motion information candidate list may be updated based on the costs of the candidates. That is, the order of the candidates of the motion information candidate list is updated in the order of smaller cost, and the modified motion information candidate list can be generated.
  • the modified motion information candidate list can be generated by arranging in the candidate order having the largest cost in the candidate having the smallest cost among the candidates.
  • the candidates may be sorted in the candidate order having the largest cost in the candidate having the smallest cost, and the first candidate and the second candidate in the sorted candidate
  • the modified motion information candidate list can be generated. That is, the modified motion information candidate list may be generated based on the first candidate and the second candidate in the updated order.
  • the encoding apparatus may generate the modified motion information candidate list based on the directions of the motion vectors indicated by the candidates of the motion information candidate list. Specifically, the priority of each of the remaining candidates may be derived based on a motion vector represented by the first candidate of the motion information candidate list and the motion vectors represented by the remaining candidates, and the priority of each candidate of the remaining candidates.
  • the motion information candidate list is updated based on the motion information candidate list, and the modified motion information candidate list is generated.
  • the remaining candidates may represent candidates other than the first candidate among the candidates of the motion information candidate list.
  • the priority of each candidate of the remaining candidates can be derived as follows. If the x-component direction and the y-component direction of the motion vector represented by the first candidate and the motion vector represented by the candidate are all different, the priority of each candidate can be derived with the highest priority. When the direction of one of the x component direction and the y component direction of the motion vector indicated by the first candidate and the motion vector indicated by the candidate is different, the priority of each candidate may be derived as a medium priority. In addition, when the x-component direction and the y-component direction of the motion vector represented by the first candidate and the motion vector represented by the candidate are all the same, the priority of each candidate can be derived with the lowest priority.
  • the motion vector represented by the first candidate and the x component of the motion vector represented by the candidate when the value obtained by multiplying the x component of the motion vector represented by the first candidate by the x component of the motion vector represented by the candidate is less than 0, the motion vector represented by the first candidate and the x component And when the value obtained by multiplying the x component of the motion vector represented by the first candidate by the x component of the motion vector represented by the candidate is greater than 0, the motion vector represented by the first candidate and the motion represented by each candidate
  • the x component direction of the vector may be the same.
  • a motion vector represented by the first candidate and the y component of the motion vector represented by the candidate When a value obtained by multiplying the y component of the motion vector represented by the first candidate by the y component of the motion vector represented by the candidate is less than 0, the motion vector represented by the first candidate and the y component And a motion vector represented by the first candidate is multiplied by a y component of a motion vector represented by each candidate is greater than 0, a motion vector represented by the first candidate and a motion represented by each candidate
  • the y component direction of the vector may be the same.
  • the priority of each candidate can be derived with the highest priority.
  • a value obtained by multiplying the x component of the motion vector represented by the first candidate by the x component of the motion vector represented by the candidate is smaller than 0 and the y component of the motion vector represented by the first candidate and the motion vector represented by each candidate If the value obtained by multiplying the y component is greater than 0, the priority of each candidate can be derived as a medium priority.
  • the value of the x component of the motion vector represented by the first candidate multiplied by the x component of the motion vector represented by the candidate is greater than 0 and the y component of the motion vector represented by the first candidate and the motion vector represented by each candidate If the value obtained by multiplying the y component is smaller than 0, the priority of each candidate can be derived as a medium priority.
  • the value of the x component of the motion vector represented by the first candidate multiplied by the x component of the motion vector represented by the candidate is greater than 0 and the y component of the motion vector represented by the first candidate and the motion vector represented by each candidate If the value obtained by multiplying the y component is greater than 0, the priority of each candidate can be derived with the lowest priority.
  • the order of the candidates of the motion information candidate list may be updated based on the priority of each candidate of the remaining candidates. That is, the order of the remaining candidates may be updated in the order of the highest-priority candidate to the lowest-priority candidate, and the modified motion information candidate list may be generated. That is, the order of the remaining candidates may be updated in descending order of priority, and the modified motion information candidate list may be generated. In other words, the modified motion information candidate list may be generated in the order of the highest priority candidate to the lowest priority candidate next to the first candidate.
  • the candidates may be sorted in order of the highest priority candidate to the lowest priority candidate, and the first candidate and the second candidate of the aligned candidates
  • the modified motion information candidate list can be generated. That is, the modified motion information candidate list may be generated based on the first candidate and the second candidate in the updated order.
  • the encoding apparatus may generate the modified motion information candidate list based on the template of the current block and the directions of the motion vectors indicated by the candidates of the motion information candidate list.
  • the template of the current block can be derived based on the neighboring samples of the current block
  • the templates of the reference blocks indicated by the candidates of the motion information candidate list can be derived
  • the costs of the candidates can be derived based on the template of the current block.
  • the cost may be determined based on Equation (1).
  • the order of the candidates of the motion information candidate list is updated based on the costs of the candidates so that the first motion information candidate list can be generated. That is, the order of the candidates of the motion information candidate list is updated in the order of smaller cost so that the first motion information candidate list can be generated.
  • the first motion information candidate list may be generated by arranging in the candidate order having the largest cost in the candidate having the smallest cost among the candidates.
  • the priority of each candidate of the remaining candidates can be derived based on the directions of the motion vectors indicated by the first candidate and the remaining candidates of the first motion information candidate list,
  • the first motion information candidate list is updated based on the priorities of the candidates of the remaining candidates so that the modified motion information candidate list can be generated.
  • the remaining candidates may represent candidates other than the first candidate among the candidates of the first motion information candidate list.
  • the priority of each candidate of the remaining candidates can be derived as follows. If the x-component direction and the y-component direction of the motion vector represented by the first candidate and the motion vector represented by the candidate are all different, the priority of each candidate can be derived with the highest priority. When the direction of one of the x component direction and the y component direction of the motion vector indicated by the first candidate and the motion vector indicated by the candidate is different, the priority of each candidate may be derived as a medium priority. In addition, when the x-component direction and the y-component direction of the motion vector represented by the first candidate and the motion vector represented by the candidate are all the same, the priority of each candidate can be derived with the lowest priority.
  • the motion vector represented by the first candidate and the x component of the motion vector represented by the candidate when the value obtained by multiplying the x component of the motion vector represented by the first candidate by the x component of the motion vector represented by the candidate is less than 0, the motion vector represented by the first candidate and the x component And when the value obtained by multiplying the x component of the motion vector represented by the first candidate by the x component of the motion vector represented by the candidate is greater than 0, the motion vector represented by the first candidate and the motion represented by each candidate
  • the x component direction of the vector may be the same.
  • a motion vector represented by the first candidate and the y component of the motion vector represented by the candidate When a value obtained by multiplying the y component of the motion vector represented by the first candidate by the y component of the motion vector represented by the candidate is less than 0, the motion vector represented by the first candidate and the y component And a motion vector represented by the first candidate is multiplied by a y component of a motion vector represented by each candidate is greater than 0, a motion vector represented by the first candidate and a motion represented by each candidate
  • the y component direction of the vector may be the same.
  • the priority of each candidate can be derived with the highest priority.
  • a value obtained by multiplying the x component of the motion vector represented by the first candidate by the x component of the motion vector represented by the candidate is smaller than 0 and the y component of the motion vector represented by the first candidate and the motion vector represented by each candidate If the value obtained by multiplying the y component is greater than 0, the priority of each candidate can be derived as a medium priority.
  • the value of the x component of the motion vector represented by the first candidate multiplied by the x component of the motion vector represented by the candidate is greater than 0 and the y component of the motion vector represented by the first candidate and the motion vector represented by each candidate If the value obtained by multiplying the y component is smaller than 0, the priority of each candidate can be derived as a medium priority.
  • the value of the x component of the motion vector represented by the first candidate multiplied by the x component of the motion vector represented by the candidate is greater than 0 and the y component of the motion vector represented by the first candidate and the motion vector represented by each candidate If the value obtained by multiplying the y component is greater than 0, the priority of each candidate can be derived with the lowest priority.
  • the order of the candidates of the first motion information candidate list may be updated based on the priority of each candidate of the remaining candidates. That is, the order of the remaining candidates may be updated in the order of the highest-priority candidate to the lowest-priority candidate, and the modified motion information candidate list may be generated. That is, the order of the remaining candidates may be updated in descending order of priority, and the modified motion information candidate list may be generated. In other words, the modified motion information candidate list may be generated in the order of the highest priority candidate to the lowest priority candidate next to the first candidate.
  • the candidates of the first motion information candidate list may be sorted in order of the highest priority candidate to the lowest priority candidate next to the first candidate, and based on the first candidate and the second candidate of the aligned candidates
  • the modified motion information candidate list can be generated. That is, the modified motion information candidate list may be generated based on the first candidate and the second candidate in the updated order.
  • the encoding apparatus encodes information on the inter prediction of the current block and outputs the encoded information (S1030).
  • the encoding apparatus can generate a merge index indicating a merge candidate selected to derive the motion information of the current block.
  • the encoding apparatus can encode and output the merge index.
  • the merge index may be included in the information on the inter prediction.
  • the information on the inter prediction may include information on motion information of the current block. More specifically, the inter prediction information may include the L0 reference picture index and the L1 reference picture index of the current block, and MVPL0 (motion vector predictor L0, MVPL0) and MVPL1 (motion vector predictor L1, MVPL1) have. In addition, the information on the inter prediction may include MVDL0 (motion vector difference L0, MVDL0) and MVDL1 (motion vector difference L1, MVDL1).
  • the information on the inter prediction may include information on motion information of the current block. More specifically, the information on the inter prediction includes an MVP flag indicating one of the candidates included in the motion information candidate list (or the modified motion information candidate list), a motion vector of a candidate pointed to by the MVP flag (MVP candidate) And a motion vector difference (MVD) of the current block.
  • MVP flag indicates one of the candidates included in the motion information candidate list (or the modified motion information candidate list)
  • MVP candidate a motion vector of a candidate pointed to by the MVP flag
  • MVPD motion vector difference
  • the current block when the motion information is generated, the current block may be predicted based on the motion information, and the motion information may be stored.
  • the motion information may be used for motion information of a block included in a neighboring block or another picture to be decoded after the decoding of the current block.
  • the merge candidate list of the neighboring blocks may include the current block indicating the motion information.
  • the motion information when the AMVP mode is applied to the neighboring blocks, the motion information may be included in the MVP candidate list of the neighboring blocks as MVP candidates.
  • the encoding apparatus can generate a prediction sample based on the motion information.
  • the encoding apparatus may generate a residual sample based on the original sample and the generated prediction sample.
  • the encoding apparatus may generate information on the residual based on the residual samples.
  • the information on the residual may include transform coefficients relating to the residual sample.
  • the encoding apparatus may derive the reconstructed sample based on the prediction sample and the residual sample. That is, the encoding apparatus may add the prediction sample and the residual sample to derive the reconstructed sample.
  • the encoding apparatus can encode the information on the residual and output it in the form of a bit stream.
  • the bitstream may be transmitted to a decoding device via a network or a storage medium.
  • FIG. 11 schematically shows a video decoding method by a decoding apparatus according to the present invention.
  • the method disclosed in Fig. 11 can be performed by the decoding apparatus disclosed in Fig. Specifically, for example, S1100 of FIG. 11 may be performed by the entropy decoding unit of the decoding apparatus, and S1110 to S1140 may be performed by the predicting unit of the decoding apparatus.
  • the decoding apparatus obtains information on inter prediction of a current block through a bit stream (S1100).
  • the current block may be inter-predicted or intra-predicted.
  • the decoding apparatus can acquire information on the inter prediction of the current block through the bit stream.
  • the decoding apparatus can generate the merge candidate list based on the neighboring blocks of the current block, and obtain the merge index through the bit stream.
  • the merge index may indicate a merge candidate included in the merge candidate list, and the information on the inter prediction may include the merge index.
  • the information on the inter prediction may include information on motion information of the current block. More specifically, the information on the inter prediction includes an MVP flag indicating one of the candidates included in the motion information candidate list (or the modified motion information candidate list), a motion vector of a candidate pointed to by the MVP flag (MVP candidate) And a motion vector difference (MVD) of the current block.
  • the decoding apparatus may derive the motion information of the current block based on the MVP candidate indicated by the candidate indicated by the MVP flag and the MVD.
  • the inter-prediction information may include the L0 reference picture index and / or the L1 reference picture index of the current block, and MVDL0 (motion vector difference L0, MVDL0) and / or MVDL1 (motion vector difference L1, MVDL1) May be included.
  • the decoding apparatus generates a motion information candidate list based on the neighboring blocks of the current block (S1110).
  • the decoding apparatus can generate a motion information candidate list based on the neighboring blocks of the current block.
  • the motion information candidate list may indicate a merge candidate list.
  • the motion information candidate list may include a motion vector predictor (MVP) candidate list Lt; / RTI >
  • MVP motion vector predictor
  • the decoding apparatus can generate a motion information candidate list including neighboring blocks of the current block, and when the AMVP mode is applied to the current block,
  • the motion information candidate list may be generated based on motion vectors of neighboring blocks of the current block.
  • the motion vectors may be derived as (MVP) candidates included in the motion information candidate list.
  • the decoding apparatus can generate the motion information candidate list based on motion vectors of neighboring blocks of the current block, and the motion information candidate list includes two candidates .
  • the motion information candidate list may include N candidates.
  • the motion information candidate list may include modified candidates of the current block.
  • the decoding apparatus may derive the modified candidate based on a template of the current block.
  • the template of the current block may be represented as a specific region including surrounding samples of the current block.
  • the template may be a specific region including left neighboring samples, upper left neighboring samples, and upper neighboring samples of the current block.
  • the template may be a specific region including the left neighboring samples of the current block and the upper neighboring samples.
  • the template may be a specific region including the upper neighbor samples of the current block.
  • the template may be a specific region including the left neighboring samples of the current block.
  • a template of a current block can be derived based on neighboring samples of the current block and a reference block having a template having a minimum cost from a template of the current block among the reference blocks in the reference block of the current block
  • the modified candidate may be derived based on the motion information indicating the specific reference block. That is, the modified candidate may represent a motion vector (or motion information) indicating the specific reference block.
  • the cost may be determined based on Equation (1).
  • the decoding apparatus updates the candidates of the motion information candidate list to generate a modified motion information candidate list (S1120).
  • the decoding apparatus may update the motion information candidate list to generate the modified motion information candidate list.
  • the decoding apparatus may generate the modified motion information candidate list based on the template of the current block.
  • the template of the current block can be derived based on the surrounding samples of the current block, and the templates of the reference blocks indicated by the candidates of the motion information candidate list can be derived.
  • the template of the current block may be represented as a specific region including surrounding samples of the current block as described above.
  • the templates of the reference blocks may represent specific regions corresponding to the template of the current block. That is, each of the templates of the reference blocks may be derived based on the surrounding samples of the neighboring samples and the corresponding reference blocks of the current block.
  • the templates of the reference blocks may have the same shape as the template of the current block.
  • the costs of the candidates may be derived based on the templates of the reference blocks and the template of the current block.
  • the cost may be determined based on Equation (1).
  • the order of the candidates of the motion information candidate list may be updated based on the costs of the candidates. That is, the order of the candidates of the motion information candidate list is updated in the order of smaller cost, and the modified motion information candidate list can be generated.
  • the modified motion information candidate list can be generated by arranging in the candidate order having the largest cost in the candidate having the smallest cost among the candidates.
  • the candidates may be sorted in the candidate order having the largest cost in the candidate having the smallest cost, and the first candidate and the second candidate in the sorted candidate
  • the modified motion information candidate list can be generated. That is, the modified motion information candidate list may be generated based on the first candidate and the second candidate in the updated order.
  • the decoding apparatus may generate the modified motion information candidate list based on the directions of the motion vectors indicated by the candidates of the motion information candidate list. Specifically, the priority of each of the remaining candidates may be derived based on a motion vector represented by the first candidate of the motion information candidate list and the motion vectors represented by the remaining candidates, and the priority of each candidate of the remaining candidates.
  • the motion information candidate list is updated based on the motion information candidate list, and the modified motion information candidate list is generated.
  • the remaining candidates may represent candidates other than the first candidate among the candidates of the motion information candidate list.
  • the priority of each candidate of the remaining candidates can be derived as follows. If the x-component direction and the y-component direction of the motion vector represented by the first candidate and the motion vector represented by the candidate are all different, the priority of each candidate can be derived with the highest priority. When the direction of one of the x component direction and the y component direction of the motion vector indicated by the first candidate and the motion vector indicated by the candidate is different, the priority of each candidate may be derived as a medium priority. In addition, when the x-component direction and the y-component direction of the motion vector represented by the first candidate and the motion vector represented by the candidate are all the same, the priority of each candidate can be derived with the lowest priority.
  • the motion vector represented by the first candidate and the x component of the motion vector represented by the candidate when the value obtained by multiplying the x component of the motion vector represented by the first candidate by the x component of the motion vector represented by the candidate is less than 0, the motion vector represented by the first candidate and the x component And when the value obtained by multiplying the x component of the motion vector represented by the first candidate by the x component of the motion vector represented by the candidate is greater than 0, the motion vector represented by the first candidate and the motion represented by each candidate
  • the x component direction of the vector may be the same.
  • a motion vector represented by the first candidate and the y component of the motion vector represented by the candidate When a value obtained by multiplying the y component of the motion vector represented by the first candidate by the y component of the motion vector represented by the candidate is less than 0, the motion vector represented by the first candidate and the y component And a motion vector represented by the first candidate is multiplied by a y component of a motion vector represented by each candidate is greater than 0, a motion vector represented by the first candidate and a motion represented by each candidate
  • the y component direction of the vector may be the same.
  • the priority of each candidate can be derived with the highest priority.
  • a value obtained by multiplying the x component of the motion vector represented by the first candidate by the x component of the motion vector represented by the candidate is smaller than 0 and the y component of the motion vector represented by the first candidate and the motion vector represented by each candidate If the value obtained by multiplying the y component is greater than 0, the priority of each candidate can be derived as a medium priority.
  • the value of the x component of the motion vector represented by the first candidate multiplied by the x component of the motion vector represented by the candidate is greater than 0 and the y component of the motion vector represented by the first candidate and the motion vector represented by each candidate If the value obtained by multiplying the y component is smaller than 0, the priority of each candidate can be derived as a medium priority.
  • the value of the x component of the motion vector represented by the first candidate multiplied by the x component of the motion vector represented by the candidate is greater than 0 and the y component of the motion vector represented by the first candidate and the motion vector represented by each candidate If the value obtained by multiplying the y component is greater than 0, the priority of each candidate can be derived with the lowest priority.
  • the order of the candidates of the motion information candidate list may be updated based on the priority of each candidate of the remaining candidates. That is, the order of the remaining candidates may be updated in the order of the highest-priority candidate to the lowest-priority candidate, and the modified motion information candidate list may be generated. That is, the order of the remaining candidates may be updated in descending order of priority, and the modified motion information candidate list may be generated. In other words, the modified motion information candidate list may be generated in the order of the highest priority candidate to the lowest priority candidate next to the first candidate.
  • the candidates may be sorted in order of the highest priority candidate to the lowest priority candidate, and the first candidate and the second candidate of the aligned candidates
  • the modified motion information candidate list can be generated. That is, the modified motion information candidate list may be generated based on the first candidate and the second candidate in the updated order.
  • the decoding apparatus may generate the modified motion information candidate list based on the template of the current block and the directions of the motion vectors indicated by the candidates of the motion information candidate list.
  • the template of the current block can be derived based on the neighboring samples of the current block
  • the templates of the reference blocks indicated by the candidates of the motion information candidate list can be derived
  • the costs of the candidates can be derived based on the template of the current block.
  • the cost may be determined based on Equation (1).
  • the order of the candidates of the motion information candidate list is updated based on the costs of the candidates so that the first motion information candidate list can be generated. That is, the order of the candidates of the motion information candidate list is updated in the order of smaller cost so that the first motion information candidate list can be generated.
  • the first motion information candidate list may be generated by arranging in the candidate order having the largest cost in the candidate having the smallest cost among the candidates.
  • the priority of each candidate of the remaining candidates can be derived based on the directions of the motion vectors indicated by the first candidate and the remaining candidates of the first motion information candidate list,
  • the first motion information candidate list is updated based on the priorities of the candidates of the remaining candidates so that the modified motion information candidate list can be generated.
  • the remaining candidates may represent candidates other than the first candidate among the candidates of the first motion information candidate list.
  • the priority of each candidate of the remaining candidates can be derived as follows. If the x-component direction and the y-component direction of the motion vector represented by the first candidate and the motion vector represented by the candidate are all different, the priority of each candidate can be derived with the highest priority. When the direction of one of the x component direction and the y component direction of the motion vector indicated by the first candidate and the motion vector indicated by the candidate is different, the priority of each candidate may be derived as a medium priority. In addition, when the x-component direction and the y-component direction of the motion vector represented by the first candidate and the motion vector represented by the candidate are all the same, the priority of each candidate can be derived with the lowest priority.
  • the motion vector represented by the first candidate and the x component of the motion vector represented by the candidate when the value obtained by multiplying the x component of the motion vector represented by the first candidate by the x component of the motion vector represented by the candidate is less than 0, the motion vector represented by the first candidate and the x component And when the value obtained by multiplying the x component of the motion vector represented by the first candidate by the x component of the motion vector represented by the candidate is greater than 0, the motion vector represented by the first candidate and the motion represented by each candidate
  • the x component direction of the vector may be the same.
  • a motion vector represented by the first candidate and the y component of the motion vector represented by the candidate When a value obtained by multiplying the y component of the motion vector represented by the first candidate by the y component of the motion vector represented by the candidate is less than 0, the motion vector represented by the first candidate and the y component And a motion vector represented by the first candidate is multiplied by a y component of a motion vector represented by each candidate is greater than 0, a motion vector represented by the first candidate and a motion represented by each candidate
  • the y component direction of the vector may be the same.
  • the priority of each candidate can be derived with the highest priority.
  • a value obtained by multiplying the x component of the motion vector represented by the first candidate by the x component of the motion vector represented by the candidate is smaller than 0 and the y component of the motion vector represented by the first candidate and the motion vector represented by each candidate If the value obtained by multiplying the y component is greater than 0, the priority of each candidate can be derived as a medium priority.
  • the value of the x component of the motion vector represented by the first candidate multiplied by the x component of the motion vector represented by the candidate is greater than 0 and the y component of the motion vector represented by the first candidate and the motion vector represented by each candidate If the value obtained by multiplying the y component is smaller than 0, the priority of each candidate can be derived as a medium priority.
  • the value of the x component of the motion vector represented by the first candidate multiplied by the x component of the motion vector represented by the candidate is greater than 0 and the y component of the motion vector represented by the first candidate and the motion vector represented by each candidate If the value obtained by multiplying the y component is greater than 0, the priority of each candidate can be derived with the lowest priority.
  • the order of the candidates of the first motion information candidate list may be updated based on the priority of each candidate of the remaining candidates. That is, the order of the remaining candidates may be updated in the order of the highest-priority candidate to the lowest-priority candidate, and the modified motion information candidate list may be generated. That is, the order of the remaining candidates may be updated in descending order of priority, and the modified motion information candidate list may be generated. In other words, the modified motion information candidate list may be generated in the order of the highest priority candidate to the lowest priority candidate next to the first candidate of the first motion information candidate list.
  • the candidates of the first motion information candidate list may be sorted in order of the highest priority candidate to the lowest priority candidate next to the first candidate, and based on the first candidate and the second candidate of the aligned candidates
  • the modified motion information candidate list can be generated. That is, the modified motion information candidate list may be generated based on the first candidate and the second candidate in the updated order.
  • the decoding apparatus derives motion information of the current block based on the inter prediction information and the modified motion information candidate list (S1130).
  • the information on the inter prediction may indicate whether a skip mode, a merge mode, or an adaptive motion vector prediction (AMVP) mode is applied to the current block.
  • AMVP adaptive motion vector prediction
  • the decoding apparatus can obtain a merge index indicating a candidate of the candidates included in the motion information candidate list.
  • the merge index may be included in the information on the inter prediction.
  • the decoding apparatus may derive the motion information of the candidate pointed by the merge index among the candidates of the corrected motion information candidate list as the motion information of the current block.
  • the decoding apparatus When the AMVP mode is applied to the current block, the decoding apparatus includes an MVP flag indicating one of the candidates included in the modified motion information candidate list, a candidate motion vector (MVP candidate) indicated by the MVP flag, A motion vector difference (MVD) can be obtained.
  • the MVP flag and the MVD may be included in the information on the inter prediction.
  • the decoding apparatus may derive the motion information of the current block based on the MVP candidate indicated by the candidate indicated by the MVP flag and the MVD.
  • the motion information may include a motion vector and a reference picture index.
  • the motion information may be bi-prediction motion information, or may be uni-prediction motion information.
  • the bi-predictive motion information may include an L0 reference picture index, an L0 motion vector, an L1 reference picture index, and an L1 motion vector
  • the short motion prediction information may include an L0 reference picture index and a L0 motion vector
  • An L1 reference picture index and an L1 motion vector An L1 reference picture index and an L1 motion vector.
  • L0 denotes a reference picture list L0 (List 0)
  • L1 denotes a reference picture list L1 (List 1).
  • the decoding apparatus performs inter-prediction of the current block based on the motion information (S1140).
  • a prediction block of the current block can be derived based on the motion information, and a reconstruction block can be derived based on the prediction block.
  • the decoding apparatus may derive a reference block intra-reference block based on the motion information.
  • the motion information may include a motion vector and a reference picture index.
  • the decoding apparatus can derive a reference picture indicated by the reference picture index of the reference pictures in the reference picture list as a reference picture of the current block, and a block indicated by the motion vector in the reference picture as a reference block of the current block .
  • the decoding apparatus may generate a prediction sample based on the reference block and may use the prediction sample directly as a reconstruction sample according to a prediction mode or may add a residual sample to the prediction sample to generate a reconstruction sample .
  • the decoding apparatus may receive information on a residual from the bitstream, if there is a residual sample for the current block, for the current block.
  • the information on the residual may include a transform coefficient relating to the residual sample.
  • the decoding apparatus may derive the residual sample (or residual sample array) for the current block based on the residual information.
  • the decoding apparatus may generate a reconstructed sample based on the prediction sample and the residual sample, and may derive a reconstructed block or a reconstructed picture based on the reconstructed sample.
  • an in-loop filtering procedure such as deblocking filtering and / or SAO procedure to the restored picture in order to improve subjective / objective picture quality as necessary.
  • more precise motion information can be derived by generating a motion information candidate list including the modified candidate of the current block, thereby reducing the bit amount of information for inter prediction of the current block, The efficiency can be improved.
  • the present invention it is possible to generate a modified motion information candidate list by updating the candidates of the motion information candidate list without receiving additional additional information, thereby obtaining more accurate motion information, Accordingly, the bit amount of the information for the inter prediction of the current block can be reduced and the overall coding efficiency can be improved.
  • the above-described method according to the present invention can be implemented in software, and the encoding apparatus and / or decoding apparatus according to the present invention can perform image processing of, for example, a TV, a computer, a smart phone, a set- Device.
  • the above-described method may be implemented by a module (a process, a function, and the like) that performs the above-described functions.
  • the module is stored in memory and can be executed by the processor.
  • the memory may be internal or external to the processor and may be coupled to the processor by any of a variety of well known means.
  • the processor may comprise an application-specific integrated circuit (ASIC), other chipset, logic circuitry and / or a data processing device.
  • the memory may include read-only memory (ROM), random access memory (RAM), flash memory, memory cards, storage media, and / or other storage devices.

Abstract

An image decoding method performed by a decoding device according to the present invention comprises the steps of: acquiring information on inter prediction of a current block through a bit stream; generating a motion information candidate list of the current block on the basis of neighboring blocks of the current block; generating a modified motion information candidate list by updating candidates of the motion information candidate list; deriving motion information of the current block on the basis of the information on the inter prediction and the modified motion information list; and performing inter prediction of the current block on the basis of the motion information.

Description

영상 코딩 시스템에서 수정된 움직임 정보 후보 리스트에 기반한 영상 디코딩 방법 및 장치Image decoding method and apparatus based on modified motion information candidate list in video coding system
본 발명은 영상 코딩 기술에 관한 것으로서 보다 상세하게는 영상 코딩 시스템에서 현재 블록의 수정된 움직임 정보 후보 리스트에 기반한 영상 디코딩 방법 및 장치에 관한 것이다.The present invention relates to an image coding technique, and more particularly, to an image decoding method and apparatus based on a modified motion information candidate list of a current block in an image coding system.
최근 HD(High Definition) 영상 및 UHD(Ultra High Definition) 영상과 같은 고해상도, 고품질의 영상에 대한 수요가 다양한 분야에서 증가하고 있다. 영상 데이터가 고해상도, 고품질이 될수록 기존의 영상 데이터에 비해 상대적으로 전송되는 정보량 또는 비트량이 증가하기 때문에 기존의 유무선 광대역 회선과 같은 매체를 이용하여 영상 데이터를 전송하거나 기존의 저장 매체를 이용해 영상 데이터를 저장하는 경우, 전송 비용과 저장 비용이 증가된다. 2. Description of the Related Art Demand for high-resolution, high-quality images such as high definition (HD) images and ultra high definition (UHD) images has recently increased in various fields. As the image data has high resolution and high quality, the amount of information or bits to be transmitted increases relative to the existing image data. Therefore, the image data can be transmitted using a medium such as a wired / wireless broadband line, When stored, the transmission cost and the storage cost are increased.
이에 따라, 고해상도, 고품질 영상의 정보를 효과적으로 전송하거나 저장하고, 재생하기 위해 고효율의 영상 압축 기술이 요구된다.Accordingly, there is a need for a highly efficient image compression technique for efficiently transmitting, storing, and reproducing information of high resolution and high quality images.
본 발명의 기술적 과제는 영상 코딩 효율을 높이는 방법 및 장치를 제공함에 있다.SUMMARY OF THE INVENTION The present invention provides a method and apparatus for enhancing video coding efficiency.
본 발명의 다른 기술적 과제는 현재 블록의 수정된 후보를 포함한 움직임 정보 후보 리스트를 생성하는 인터 예측 방법 및 장치를 제공함에 있다.It is another object of the present invention to provide an inter prediction method and apparatus for generating a motion information candidate list including a modified candidate of a current block.
본 발명의 또 다른 기술적 과제는 별도의 부가 정보 수신 없이 현재 블록의 움직임 정보 후보 리스트의 후보들을 갱신하여 수정된 움직임 정보 후보 리스트를 생성하고, 상기 수정된 직임 정보 후보 리스트를 기반으로 상기 현재 블록의 인터 예측을 수행하는 방법 및 장치를 제공함에 있다. According to another aspect of the present invention, there is provided a motion information candidate list generation method comprising: generating motion information candidate lists by updating candidates of a motion information candidate list of a current block without receiving additional information; And a method and an apparatus for performing inter prediction.
본 발명의 일 실시예에 따르면, 디코딩 장치에 의하여 수행되는 영상 디코딩 방법이 제공된다. 상기 방법은 비트스트림을 통하여 현재 블록의 인터 예측에 대한 정보를 획득하는 단계, 상기 현재 블록의 주변 블록들을 기반으로 상기 현재 블록의 움직임 정보 후보 리스트를 생성하는 단계, 상기 움직임 정보 후보 리스트의 후보들을 갱신하여 수정된(modified) 움직임 정보 후보 리스트를 생성하는 단계, 상기 인터 예측에 대한 정보 및 상기 수정된 움직임 정보 리스트를 기반으로 상기 현재 블록의 움직임 정보를 도출하는 단계 및 상기 움직임 정보를 기반으로 상기 현재 블록의 인터 예측을 수행하는 단계를 포함하는 것을 특징으로 한다.According to an embodiment of the present invention, an image decoding method performed by a decoding apparatus is provided. The method includes the steps of: obtaining information on inter prediction of a current block through a bitstream; generating a motion information candidate list of the current block based on neighboring blocks of the current block; Generating a modified motion information candidate list by updating the current motion information list, deriving motion information of the current block based on the inter prediction information and the modified motion information list, And performing inter prediction of the current block.
본 발명의 다른 일 실시예에 따르면, 영상 디코딩을 수행하는 디코딩 장치가 제공된다. 상기 디코딩 장치는 비트스트림을 통하여 현재 블록의 인터 예측에 대한 정보를 획득하는 엔트로피 디코딩부, 및 상기 현재 블록의 주변 블록들을 기반으로 상기 현재 블록의 움직임 정보 후보 리스트를 생성하고, 상기 움직임 정보 후보 리스트의 후보들을 갱신하여 수정된(modified) 움직임 정보 후보 리스트를 생성하고, 상기 인터 예측에 대한 정보 및 상기 수정된 움직임 정보 리스트를 기반으로 상기 현재 블록의 움직임 정보를 도출하고, 상기 움직임 정보를 기반으로 상기 현재 블록의 인터 예측을 수행하는 예측부를 포함하는 것을 특징으로 한다.According to another embodiment of the present invention, there is provided a decoding apparatus for performing image decoding. The decoding apparatus includes an entropy decoding unit that obtains information on inter prediction of a current block through a bitstream, and a motion information candidate list generation unit that generates a motion information candidate list of the current block based on neighboring blocks of the current block, To generate a modified motion information candidate list by deriving motion information of the current block based on information on the inter prediction and the modified motion information list, And a prediction unit for performing inter prediction of the current block.
본 발명의 또 다른 일 실시예에 따르면, 인코딩 장치에 의하여 수행되는 비디오 인코딩 방법을 제공한다. 상기 방법은 현재 블록에 대한 움직임 정보를 생성하는 단계, 상기 현재 블록의 주변 블록들을 기반으로 상기 현재 블록의 움직임 정보 후보 리스트를 생성하는 단계, 상기 움직임 정보 후보 리스트의 후보들을 갱신하여 수정된(modified) 움직임 정보 후보 리스트를 생성하는 단계, 및 상기 현재 블록의 인터 예측에 대한 정보를 인코딩하여 출력하는 단계를 포함하는 것을 특징으로 한다.According to another embodiment of the present invention, there is provided a video encoding method performed by an encoding apparatus. The method includes generating motion information for a current block, generating a motion information candidate list of the current block based on neighboring blocks of the current block, updating the motion information candidate list candidates, ) Motion information candidate list, and encoding and outputting information on inter prediction of the current block.
본 발명의 또 다른 일 실시예에 따르면, 비디오 인코딩 장치를 제공한다. 상기 인코딩 장치는 상기 방법은 현재 블록에 대한 움직임 정보를 생성하고, 상기 현재 블록의 주변 블록들을 기반으로 상기 현재 블록의 움직임 정보 후보 리스트를 생성하고, 상기 움직임 정보 후보 리스트의 후보들을 갱신하여 수정된(modified) 움직임 정보 후보 리스트를 생성하는 예측부, 및 상기 현재 블록의 인터 예측에 대한 정보를 인코딩하여 출력하는 엔트로피 인코딩부를 포함하는 것을 특징으로 한다.According to another embodiment of the present invention, there is provided a video encoding apparatus. The method includes generating motion information for a current block, generating a motion information candidate list of the current block based on neighboring blocks of the current block, updating the candidates of the motion information candidate list, a predictor for generating a modified motion information candidate list, and an entropy encoding unit for encoding and outputting information on inter prediction of the current block.
본 발명에 따르면 상기 현재 블록의 수정된 후보를 포함한 움직임 정보 후보 리스트를 생성하여 더욱 정확한 움직임 정보를 도출할 수 있고, 이를 통하여 현재 블록의 인터 예측에 대한 정보의 비트량을 줄이고, 전반적인 코딩 효율을 향상시킬 수 있다.According to the present invention, a motion information candidate list including the modified candidate of the current block can be generated to derive more accurate motion information, thereby reducing the bit amount of information for inter prediction of the current block and reducing the overall coding efficiency Can be improved.
본 발명에 따르면 별도의 부가 정보의 수신 없이 상기 움직임 정보 후보 리스트의 후보들을 갱신하여 수정된(modified) 움직임 정보 후보 리스트를 생성할 수 있고, 이를 통하여 더욱 정확한 움직임 정보를 도출할 수 있고, 이를 통하여 현재 블록의 인터 예측에 대한 정보의 비트량을 줄이고, 전반적인 코딩 효율을 향상시킬 수 있다.According to the present invention, it is possible to generate a modified motion information candidate list by updating the candidates of the motion information candidate list without receiving additional additional information, thereby obtaining more accurate motion information. The bit amount of the information for the inter prediction of the current block can be reduced and the overall coding efficiency can be improved.
도 1은 본 발명이 적용될 수 있는 비디오 인코딩 장치의 구성을 개략적으로 설명하는 도면이다. FIG. 1 is a view for schematically explaining a configuration of a video encoding apparatus to which the present invention can be applied.
도 2는 본 발명이 적용될 수 있는 비디오 디코딩 장치의 구성을 개략적으로 설명하는 도면이다.2 is a schematic view illustrating a configuration of a video decoding apparatus to which the present invention can be applied.
도 3은 상기 현재 블록의 움직임 정보 후보 리스트 생성을 위한 주변 블록들을 나타낸다. FIG. 3 shows neighboring blocks for generating a motion information candidate list of the current block.
도 4는 상기 현재 블록의 템플릿의 일 예를 나타낸다. FIG. 4 shows an example of a template of the current block.
도 5는 상기 현재 블록의 템플릿을 기반으로 움직임 정보 후보 리스트를 갱신하는 일 예를 나타낸다.FIG. 5 shows an example of updating a motion information candidate list based on the template of the current block.
도 6은 상기 현재 블록의 템플릿을 기반으로 움직임 정보 후보 리스트를 갱신하는 일 예를 나타낸다. FIG. 6 shows an example of updating a motion information candidate list based on the template of the current block.
도 7은 상기 현재 블록의 템플릿을 기반으로 움직임 정보 후보 리스트를 갱신하는 일 예를 나타낸다.FIG. 7 shows an example of updating a motion information candidate list based on the template of the current block.
도 8은 후보들의 움직임 벡터들의 방향에 따라 도출된 우선 순위를 기반으로 움직임 정보 후보 리스트를 갱신하는 일 예를 나타낸다.FIG. 8 shows an example of updating the motion information candidate list based on the priorities derived according to the directions of the motion vectors of the candidates.
도 9는 상기 현재 블록의 템플릿 및 상기 움직임 정보 후보 리스트의 후보들의 움직임 벡터들의 방향에 따라 도출된 우선 순위를 기반으로 상기 움직임 정보 후보 리스트를 갱신하는 일 예를 나타낸다.FIG. 9 shows an example of updating the motion information candidate list based on the template of the current block and the priorities derived according to the directions of the motion vectors of the candidates of the motion information candidate list.
도 10은 본 발명에 따른 인코딩 장치에 의한 비디오 인코딩 방법을 개략적으로 나타낸다.10 schematically shows a video encoding method by an encoding apparatus according to the present invention.
도 11은 본 발명에 따른 디코딩 장치에 의한 비디오 디코딩 방법을 개략적으로 나타낸다.11 schematically shows a video decoding method by a decoding apparatus according to the present invention.
본 발명은 다양한 변경을 가할 수 있고 여러 가지 실시예를 가질 수 있는 바, 특정 실시예들을 도면에 예시하고 상세하게 설명하고자 한다. 그러나, 이는 본 발명을 특정 실시예에 한정하려고 하는 것이 아니다. 본 명세서에서 상용하는 용어는 단지 특정한 실시예를 설명하기 위해 사용된 것으로, 본 발명의 기술적 사상을 한정하려는 의도로 사용되는 것은 아니다. 단수의 표현은 문맥상 명백하게 다르게 뜻하지 않는 한, 복수의 표현을 포함한다. 본 명세서에서 "포함하다" 또는 "가지다" 등의 용어는 명세서상에 기재된 특징, 숫자, 단계, 동작, 구성 요소, 부품 또는 이들을 조합한 것이 존재함을 지정하려는 것이지, 하나 또는 그 이상의 다른 특징들이나 숫자, 단계, 동작, 구성 요소, 부품 도는 이들을 조합한 것들의 존재 또는 부가 가능성을 미리 배제하지 않는 것으로 이해되어야 한다.While the invention is susceptible to various modifications and alternative forms, specific embodiments thereof are shown by way of example in the drawings and will herein be described in detail. However, this is not intended to limit the invention to the specific embodiments. It is to be understood that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of the present invention. The singular expressions include plural expressions unless the context clearly dictates otherwise. It is to be understood that the terms "comprises", "having", and the like in the specification are intended to specify the presence of stated features, integers, steps, operations, elements, parts or combinations thereof, It should be understood that they do not preclude the presence or addition of a combination of numbers, steps, operations, components, parts, or combinations thereof.
한편, 본 발명에서 설명되는 도면상의 각 구성들은 서로 다른 특징적인 기능들에 관한 설명의 편의를 위해 독립적으로 도시된 것으로서, 각 구성들이 서로 별개의 하드웨어나 별개의 소프트웨어로 구현된다는 것을 의미하지는 않는다. 예컨대, 각 구성 중 두 개 이상의 구성이 합쳐져 하나의 구성을 이룰 수도 있고, 하나의 구성이 복수의 구성으로 나뉘어질 수도 있다. 각 구성이 통합 및/또는 분리된 실시예도 본 발명의 본질에서 벗어나지 않는 한 본 발명의 권리범위에 포함된다.In the meantime, the configurations of the drawings described in the present invention are shown independently for convenience of description of different characteristic functions, and do not mean that the configurations are implemented as separate hardware or separate software. For example, two or more of the configurations may combine to form one configuration, or one configuration may be divided into a plurality of configurations. Embodiments in which each configuration is integrated and / or separated are also included in the scope of the present invention unless they depart from the essence of the present invention.
이하, 첨부한 도면들을 참조하여, 본 발명의 바람직한 실시예를 보다 상세하게 설명하고자 한다. 이하, 도면상의 동일한 구성 요소에 대해서는 동일한 참조 부호를 사용하고 동일한 구성 요소에 대해서 중복된 설명은 생략한다.Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the accompanying drawings. Hereinafter, the same reference numerals will be used for the same constituent elements in the drawings, and redundant explanations for the same constituent elements will be omitted.
본 명세서에서 픽처(picture)는 일반적으로 특정 시간대의 하나의 영상을 나타내는 단위를 의미하며, 슬라이스(slice)는 코딩에 있어서 픽처의 일부를 구성하는 단위이다. 하나의 픽처는 복수의 슬라이스로 구성될 수 있으며, 필요에 따라서 픽처 및 슬라이스는 서로 혼용되어 사용될 수 있다.In this specification, a picture generally refers to a unit that represents one image in a specific time zone, and a slice is a unit that constitutes a part of a picture in coding. One picture may be composed of a plurality of slices, and pictures and slices may be used in combination if necessary.
픽셀(pixel) 또는 펠(pel)은 하나의 픽처(또는 영상)을 구성하는 최소의 단위를 의미할 수 있다. 또한, 픽셀에 대응하는 용어로서 '샘플(sample)'이 사용될 수 있다. 샘플은 일반적으로 픽셀 또는 픽셀의 값을 나타낼 수 있으며, 휘도(luma) 성분의 픽셀/픽셀값만을 나타낼 수도 있고, 채도(chroma) 성분의 픽셀/픽셀 값만을 나타낼 수도 있다. A pixel or a pel may mean a minimum unit of a picture (or image). Also, a 'sample' may be used as a term corresponding to a pixel. A sample may generally represent a pixel or pixel value and may only represent a pixel / pixel value of a luma component or only a pixel / pixel value of a chroma component.
유닛(unit)은 영상 처리의 기본 단위를 나타낸다. 유닛은 픽처의 특정 영역 및 해당 영역에 관련된 정보 중 적어도 하나를 포함할 수 있다. 유닛은 경우에 따라서 블록(block) 또는 영역(area) 등의 용어와 혼용하여 사용될 수 있다. 일반적인 경우, MxN 블록은 M개의 열과 N개의 행으로 이루어진 샘플들 또는 변환 계수(transform coefficient)들의 집합을 나타낼 수 있다.A unit represents a basic unit of image processing. A unit may include at least one of a specific area of a picture and information related to the area. The unit may be used in combination with terms such as a block or an area in some cases. In general, an MxN block may represent a set of samples or transform coefficients consisting of M columns and N rows.
도 1은 본 발명이 적용될 수 있는 비디오 인코딩 장치의 구성을 개략적으로 설명하는 도면이다. FIG. 1 is a view for schematically explaining a configuration of a video encoding apparatus to which the present invention can be applied.
도 1을 참조하면, 비디오 인코딩 장치(100)는 픽처 분할부(105), 예측부(110), 레지듀얼 처리부(120), 가산부(140), 필터부(150) 및 메모리(160)을 포함할 수 있다. 레지듀얼 처리부(120)는 감산부(121), 변환부(122), 양자화부(123), 재정렬부(124), 역양자화부(125) 및 역변환부(126)를 포함할 수 있다. 1, the video encoding apparatus 100 includes a picture dividing unit 105, a predicting unit 110, a residual processing unit 120, an adding unit 140, a filter unit 150, and a memory 160 . The residual processing unit 120 may include a subtracting unit 121, a transforming unit 122, a quantizing unit 123, a reordering unit 124, an inverse quantizing unit 125 and an inverse transforming unit 126.
픽처 분할부(105)는 입력된 픽처를 적어도 하나의 처리 유닛(processing unit)으로 분할할 수 있다. The picture dividing unit 105 may divide the inputted picture into at least one processing unit.
일 예로, 처리 유닛은 코딩 유닛(coding unit, CU)이라고 불릴 수 있다. 이 경우 코딩 유닛은 최대 코딩 유닛(largest coding unit, LCU)으로부터 QTBT (Quad-tree binary-tree) 구조에 따라 재귀적으로(recursively) 분할될 수 있다. 예를 들어, 하나의 코딩 유닛은 쿼드 트리 구조 및/또는 바이너리 트리 구조를 기반으로 하위(deeper) 뎁스의 복수의 코딩 유닛들로 분할될 수 있다. 이 경우 예를 들어 쿼드 트리 구조가 먼저 적용되고 바이너리 트리 구조가 나중에 적용될 수 있다. 또는 바이너리 트리 구조가 먼저 적용될 수도 있다. 더 이상 분할되지 않는 최종 코딩 유닛을 기반으로 본 발명에 따른 코딩 절차가 수행될 수 있다. 이 경우 영상 특성에 따른 코딩 효율 등을 기반으로, 최대 코딩 유닛이 바로 최종 코딩 유닛으로 사용될 수 있고, 또는 필요에 따라 코딩 유닛은 재귀적으로(recursively) 보다 하위 뎁스의 코딩 유닛들로 분할되어 최적의 사이즈의 코딩 유닛이 최종 코딩 유닛으로 사용될 수 있다. 여기서 코딩 절차라 함은 후술하는 예측, 변환, 및 복원 등의 절차를 포함할 수 있다. In one example, the processing unit may be referred to as a coding unit (CU). In this case, the coding unit may be recursively partitioned according to a quad-tree binary-tree (QTBT) structure from the largest coding unit (LCU). For example, one coding unit may be divided into a plurality of coding units of deeper depth based on a quadtree structure and / or a binary tree structure. In this case, for example, the quadtree structure is applied first and the binary tree structure can be applied later. Or a binary tree structure may be applied first. The coding procedure according to the present invention can be performed based on the final coding unit which is not further divided. In this case, the maximum coding unit may be directly used as the final coding unit based on the coding efficiency or the like depending on the image characteristics, or the coding unit may be recursively divided into lower-depth coding units Lt; / RTI > may be used as the final coding unit. Here, the coding procedure may include a procedure such as prediction, conversion, and restoration, which will be described later.
다른 예로, 처리 유닛은 코딩 유닛(coding unit, CU) 예측 유닛(prediction unit, PU) 또는 변환 유닛(transform unit, TU)을 포함할 수도 있다. 코딩 유닛은 최대 코딩 유닛(largest coding unit, LCU)으로부터 쿼드 트리 구조를 따라서 하위(deeper) 뎁스의 코딩 유닛들로 분할(split)될 수 있다. 이 경우 영상 특성에 따른 코딩 효율 등을 기반으로, 최대 코딩 유닛이 바로 최종 코딩 유닛으로 사용될 수 있고, 또는 필요에 따라 코딩 유닛은 재귀적으로(recursively) 보다 하위 뎁스의 코딩 유닛들로 분할되어 최적의 사이즈의 코딩 유닛이 최종 코딩 유닛으로 사용될 수 있다. 최소 코딩 유닛(smallest coding unit, SCU)이 설정된 경우 코딩 유닛은 최소 코딩 유닛보다 더 작은 코딩 유닛으로 분할될 수 없다. 여기서 최종 코딩 유닛이라 함은 예측 유닛 또는 변환 유닛으로 파티셔닝 또는 분할되는 기반이 되는 코딩 유닛을 의미한다. 예측 유닛은 코딩 유닛으로부터 파티셔닝(partitioning)되는 유닛으로서, 샘플 예측의 유닛일 수 있다. 이 때, 예측 유닛은 서브 블록(sub block)으로 나뉠 수도 있다. 변환 유닛은 코딩 유닛으로부터 쿼드 트리 구조를 따라서 분할 될 수 있으며, 변환 계수를 유도하는 유닛 및/또는 변환 계수로부터 레지듀얼 신호(residual signal)를 유도하는 유닛일 수 있다. 이하, 코딩 유닛은 코딩 블록(coding block, CB), 예측 유닛은 예측 블록(prediction block, PB), 변환 유닛은 변환 블록(transform block, TB) 으로 불릴 수 있다. 예측 블록 또는 예측 유닛은 픽처 내에서 블록 형태의 특정 영역을 의미할 수 있고, 예측 샘플의 어레이(array)를 포함할 수 있다. 또한, 변환 블록 또는 변환 유닛은 픽처 내에서 블록 형태의 특정 영역을 의미할 수 있고, 변환 계수 또는 레지듀얼 샘플의 어레이를 포함할 수 있다.As another example, the processing unit may include a coding unit (CU) prediction unit (PU) or a transform unit (TU). The coding unit may be split from the largest coding unit (LCU) into coding units of deeper depth along the quad tree structure. In this case, the maximum coding unit may be directly used as the final coding unit based on the coding efficiency or the like depending on the image characteristics, or the coding unit may be recursively divided into lower-depth coding units Lt; / RTI > may be used as the final coding unit. When a smallest coding unit (SCU) is set, the coding unit can not be divided into smaller coding units than the minimum coding unit. Herein, the term " final coding unit " means a coding unit on which the prediction unit or the conversion unit is partitioned or divided. A prediction unit is a unit that is partitioned from a coding unit, and may be a unit of sample prediction. At this time, the prediction unit may be divided into sub-blocks. The conversion unit may be divided along the quad-tree structure from the coding unit, and may be a unit for deriving a conversion coefficient and / or a unit for deriving a residual signal from the conversion factor. Hereinafter, the coding unit may be referred to as a coding block (CB), the prediction unit may be referred to as a prediction block (PB), and the conversion unit may be referred to as a transform block (TB). The prediction block or prediction unit may refer to a specific area in the form of a block in a picture and may include an array of prediction samples. Also, a transform block or transform unit may refer to a specific region in the form of a block within a picture, and may include an array of transform coefficients or residual samples.
예측부(110)는 처리 대상 블록(이하, 현재 블록이라 함)에 대한 예측을 수행하고, 상기 현재 블록에 대한 예측 샘플들을 포함하는 예측된 블록(predicted block)을 생성할 수 있다. 예측부(110)에서 수행되는 예측의 단위는 코딩 블록일 수 있고, 변환 블록일 수도 있고, 예측 블록일 수도 있다.The prediction unit 110 may perform a prediction on a current block to be processed (hereinafter, referred to as a current block), and may generate a predicted block including prediction samples for the current block. The unit of prediction performed in the prediction unit 110 may be a coding block, a transform block, or a prediction block.
예측부(110)는 현재 블록에 인트라 예측이 적용되는지 인터 예측이 적용되는지를 결정할 수 있다. 일 예로, 예측부(110)는 CU 단위로 인트라 예측 또는 인터 예측이 적용되는지를 결정할 수 있다.The prediction unit 110 may determine whether intra prediction or inter prediction is applied to the current block. For example, the prediction unit 110 may determine whether intra prediction or inter prediction is applied in units of CU.
인트라 예측의 경우에, 예측부(110)는 현재 블록이 속하는 픽처(이하, 현재 픽처) 내의 현재 블록 외부의 참조 샘플을 기반으로 현재 블록에 대한 예측 샘플을 유도할 수 있다. 이 때, 예측부(110)는 (i) 현재 블록의 주변(neighboring) 참조 샘플들의 평균(average) 혹은 인터폴레이션(interpolation)을 기반으로 예측 샘플을 유도할 수 있고, (ii) 현재 블록의 주변 참조 샘플들 중 예측 샘플에 대하여 특정 (예측) 방향에 존재하는 참조 샘플을 기반으로 상기 예측 샘플을 유도할 수도 있다. (i)의 경우는 비방향성 모드 또는 비각도 모드, (ii)의 경우는 방향성(directional) 모드 또는 각도(angular) 모드라고 불릴 수 있다. 인트라 예측에서 예측 모드는 예를 들어 33개의 방향성 예측 모드와 적어도 2개 이상의 비방향성 모드를 가질 수 있다. 비방향성 모드는 DC 예측 모드 및 플래너 모드(Planar 모드)를 포함할 수 있다. 예측부(110)는 주변 블록에 적용된 예측 모드를 이용하여, 현재 블록에 적용되는 예측 모드를 결정할 수도 있다.In the case of intra prediction, the prediction unit 110 may derive a prediction sample for a current block based on a reference sample outside the current block in a picture to which the current block belongs (hereinafter referred to as a current picture). At this time, the prediction unit 110 may derive a prediction sample based on (i) an average or interpolation of neighboring reference samples of the current block, (ii) The prediction sample may be derived based on a reference sample existing in a specific (prediction) direction with respect to the prediction sample among the samples. (i) may be referred to as a non-directional mode or a non-angle mode, and (ii) may be referred to as a directional mode or an angular mode. In the intra prediction, the prediction mode may have, for example, 33 directional prediction modes and at least two non-directional modes. The non-directional mode may include a DC prediction mode and a planar mode (Planar mode). The prediction unit 110 may determine a prediction mode applied to a current block using a prediction mode applied to a neighboring block.
인터 예측의 경우에, 예측부(110)는 참조 픽처 상에서 움직임 벡터에 의해 특정되는 샘플을 기반으로, 현재 블록에 대한 예측 샘플을 유도할 수 있다. 예측부(110)는 스킵(skip) 모드, 머지(merge) 모드, 및 MVP(motion vector prediction) 모드 중 어느 하나를 적용하여 현재 블록에 대한 예측 샘플을 유도할 수 있다. 스킵 모드와 머지 모드의 경우에, 예측부(110)는 주변 블록의 움직임 정보를 현재 블록의 움직임 정보로 이용할 수 있다. 스킵 모드의 경우, 머지 모드와 달리 예측 샘플과 원본 샘플 사이의 차(레지듀얼)가 전송되지 않는다. MVP 모드의 경우, 주변 블록의 움직임 벡터를 움직임 벡터 예측자(Motion Vector Predictor)로 이용하여 현재 블록의 움직임 벡터 예측자로 이용하여 현재 블록의 움직임 벡터를 유도할 수 있다.In the case of inter prediction, the prediction unit 110 may derive a prediction sample for a current block based on a sample specified by a motion vector on a reference picture. The prediction unit 110 may derive a prediction sample for a current block by applying one of a skip mode, a merge mode, and a motion vector prediction (MVP) mode. In the skip mode and the merge mode, the prediction unit 110 can use motion information of a neighboring block as motion information of a current block. In the skip mode, difference (residual) between the predicted sample and the original sample is not transmitted unlike the merge mode. In the MVP mode, a motion vector of a current block can be derived by using a motion vector of a neighboring block as a motion vector predictor to use as a motion vector predictor of a current block.
인터 예측의 경우에, 주변 블록은 현재 픽처 내에 존재하는 공간적 주변 블록(spatial neighboring block)과 참조 픽처(reference picture)에 존재하는 시간적 주변 블록(temporal neighboring block)을 포함할 수 있다. 상기 시간적 주변 블록을 포함하는 참조 픽처는 동일 위치 픽처(collocated picture, colPic)라고 불릴 수도 있다. 움직임 정보(motion information)는 움직임 벡터와 참조 픽처 인덱스를 포함할 수 있다. 예측 모드 정보와 움직임 정보 등의 정보는 (엔트로피) 인코딩되어 비트스트림 형태로 출력될 수 있다.In the case of inter prediction, a neighboring block may include a spatial neighboring block existing in a current picture and a temporal neighboring block existing in a reference picture. The reference picture including the temporal neighboring block may be referred to as a collocated picture (colPic). The motion information may include a motion vector and a reference picture index. Information such as prediction mode information and motion information may be (entropy) encoded and output in the form of a bit stream.
스킵 모드와 머지 모드에서 시간적 주변 블록의 움직임 정보가 이용되는 경우에, 참조 픽처 리스트(reference picture list) 상의 최상위 픽처가 참조 픽처로서 이용될 수도 있다. 참조 픽처 리스트(Picture Order Count)에 포함되는 참조 픽처들은 현재 픽처와 해당 참조 픽처 간의 POC(Picture order count) 차이 기반으로 정렬될 수 있다. POC는 픽처의 디스플레이 순서에 대응하며, 코딩 순서와 구분될 수 있다.When the motion information of the temporal neighboring blocks is used in the skip mode and the merge mode, the highest picture on the reference picture list may be used as a reference picture. The reference pictures included in the picture order count can be sorted on the basis of the picture order count (POC) difference between the current picture and the corresponding reference picture. The POC corresponds to the display order of the pictures and can be distinguished from the coding order.
감산부(121)는 원본 샘플과 예측 샘플 간의 차이인 레지듀얼 샘플을 생성한다. 스킵 모드가 적용되는 경우에는, 상술한 바와 같이 레지듀얼 샘플을 생성하지 않을 수 있다.The subtraction unit 121 generates residual samples that are the difference between the original sample and the predicted sample. When the skip mode is applied, a residual sample may not be generated as described above.
변환부(122)는 변환 블록 단위로 레지듀얼 샘플을 변환하여 변환 계수(transform coefficient)를 생성한다. 변환부(122)는 해당 변환 블록의 사이즈와, 해당 변환 블록과 공간적으로 겹치는 코딩 블록 또는 예측 블록에 적용된 예측 모드에 따라서 변환을 수행할 수 있다. 예컨대, 상기 변환 블록과 겹치는 상기 코딩 블록 또는 상기 예측 블록에 인트라 예측이 적용되었고, 상기 변환 블록이 4×4의 레지듀얼 어레이(array)라면, 레지듀얼 샘플은 DST(Discrete Sine Transform) 변환 커널을 이용하여 변환되고, 그 외의 경우라면 레지듀얼 샘플은 DCT(Discrete Cosine Transform) 변환 커널을 이용하여 변환할 수 있다.The transforming unit 122 transforms the residual samples on a transform block basis to generate a transform coefficient. The transforming unit 122 can perform the transform according to the size of the transform block and a prediction mode applied to the coding block or the prediction block spatially overlapping the transform block. For example, if intraprediction is applied to the coding block or the prediction block that overlaps the transform block and the transform block is a 4 × 4 residue array, the residual sample is transformed into a discrete sine transform (DST) In other cases, the residual samples can be converted using a DCT (Discrete Cosine Transform) conversion kernel.
양자화부(123)는 변환 계수들을 양자화하여, 양자화된 변환 계수를 생성할 수 있다.The quantization unit 123 may quantize the transform coefficients to generate quantized transform coefficients.
재정렬부(124)는 양자화된 변환 계수를 재정렬한다. 재정렬부(124)는 계수들 스캐닝(scanning) 방법을 통해 블록 형태의 양자화된 변환 계수들을 1차원 벡터 형태로 재정렬할 수 있다. 여기서 재정렬부(124)는 별도의 구성으로 설명하였으나, 재정렬부(124)는 양자화부(123)의 일부일 수 있다.The reordering unit 124 rearranges the quantized transform coefficients. The reordering unit 124 may rearrange the block-shaped quantized transform coefficients into a one-dimensional vector form through a scanning method of coefficients. The reordering unit 124 may be a part of the quantization unit 123, although the reordering unit 124 is described as an alternative configuration.
엔트로피 인코딩부(130)는 양자화된 변환 계수들에 대한 엔트로피 인코딩을 수행할 수 있다. 엔트로피 인코딩은 예를 들어 지수 골롬(exponential Golomb), CAVLC(context-adaptive variable length coding), CABAC(context-adaptive binary arithmetic coding) 등과 같은 인코딩 방법을 포함할 수 있다. 엔트로피 인코딩부(130)는 양자화된 변환 계수 외 비디오 복원에 필요한 정보들(예컨대 신택스 요소(syntax element)의 값 등)을 함께 또는 별도로 인코딩할 수도 있다. 엔트로피 인코딩된 정보들은 비트스트림 형태로 NAL(network abstraction layer) 유닛 단위로 전송 또는 저장될 수 있다.The entropy encoding unit 130 may perform entropy encoding on the quantized transform coefficients. Entropy encoding may include, for example, an encoding method such as exponential Golomb, context-adaptive variable length coding (CAVLC), context-adaptive binary arithmetic coding (CABAC) The entropy encoding unit 130 may encode the information necessary for video restoration (such as the value of a syntax element) together with the quantized transform coefficient or separately. The entropy encoded information may be transmitted or stored in units of NAL (network abstraction layer) units in the form of a bit stream.
역양자화부(125)는 양자화부(123)에서 양자화된 값(양자화된 변환 계수)들을 역양자화하고, 역변환부(126)는 역양자화부(125)에서 역양자화된 값들을 역변환하여 레지듀얼 샘플을 생성한다.The inverse quantization unit 125 inversely quantizes the quantized values (quantized transform coefficients) in the quantization unit 123 and the inverse transformation unit 126 inversely quantizes the inversely quantized values in the inverse quantization unit 125, .
가산부(140)는 레지듀얼 샘플과 예측 샘플을 합쳐서 픽처를 복원한다. 레지듀얼 샘플과 예측 샘플은 블록 단위로 더해져서 복원 블록이 생성될 수 있다. 여기서 가산부(140)는 별도의 구성으로 설명하였으나, 가산부(140)는 예측부(110)의 일부일 수 있다. 한편, 가산부(140)는 복원부 또는 복원 블록 생성부로 불릴 수도 있다.The adder 140 combines the residual sample and the predicted sample to reconstruct the picture. The residual samples and the prediction samples are added in units of blocks so that a reconstruction block can be generated. Here, the adding unit 140 may be a part of the predicting unit 110, Meanwhile, the addition unit 140 may be referred to as a restoration unit or a restoration block generation unit.
복원된 픽처(reconstructed picture)에 대하여 필터부(150)는 디블록킹 필터 및/또는 샘플 적응적 오프셋(sample adaptive offset)을 적용할 수 있다. 디블록킹 필터링 및/또는 샘플 적응적 오프셋을 통해, 복원 픽처 내 블록 경계의 아티팩트나 양자화 과정에서의 왜곡이 보정될 수 있다. 샘플 적응적 오프셋은 샘플 단위로 적용될 수 있으며, 디블록킹 필터링의 과정이 완료된 후 적용될 수 있다. 필터부(150)는 ALF(Adaptive Loop Filter)를 복원된 픽처에 적용할 수도 있다. ALF는 디블록킹 필터 및/또는 샘플 적응적 오프셋이 적용된 후의 복원된 픽처에 대하여 적용될 수 있다.For the reconstructed picture, the filter unit 150 may apply a deblocking filter and / or a sample adaptive offset. Through deblocking filtering and / or sample adaptive offsets, artifacts in the block boundary in the reconstructed picture or distortion in the quantization process can be corrected. The sample adaptive offset can be applied on a sample-by-sample basis and can be applied after the process of deblocking filtering is complete. The filter unit 150 may apply an ALF (Adaptive Loop Filter) to the restored picture. The ALF may be applied to the reconstructed picture after the deblocking filter and / or sample adaptive offset is applied.
메모리(160)는 복원 픽처(디코딩된 픽처) 또는 인코딩/디코딩에 필요한 정보를 저장할 수 있다. 여기서 복원 픽처는 상기 필터부(150)에 의하여 필터링 절차가 완료된 복원 픽처일 수 있다. 상기 저장된 복원 픽처는 다른 픽처의 (인터) 예측을 위한 참조 픽처로 활용될 수 있다. 예컨대, 메모리(160)는 인터 예측에 사용되는 (참조) 픽처들을 저장할 수 있다. 이 때, 인터 예측에 사용되는 픽처들은 참조 픽처 세트(reference picture set) 혹은 참조 픽처 리스트(reference picture list)에 의해 지정될 수 있다.The memory 160 may store restored pictures (decoded pictures) or information necessary for encoding / decoding. Here, the reconstructed picture may be a reconstructed picture whose filtering procedure has been completed by the filter unit 150. The stored restored picture may be used as a reference picture for (inter) prediction of another picture. For example, the memory 160 may store (reference) pictures used for inter prediction. At this time, the pictures used for inter prediction can be designated by a reference picture set or a reference picture list.
도 2는 본 발명이 적용될 수 있는 비디오 디코딩 장치의 구성을 개략적으로 설명하는 도면이다.2 is a schematic view illustrating a configuration of a video decoding apparatus to which the present invention can be applied.
도 2를 참조하면, 비디오 디코딩 장치(200)는 엔트로피 디코딩부(210), 레지듀얼 처리부(220), 예측부(230), 가산부(240), 필터부(250) 및 메모리(260)을 포함할 수 있다. 여기서 레지듀얼 처리부(220)는 재정렬부(221), 역양자화부(222), 역변환부(223)을 포함할 수 있다. 2, the video decoding apparatus 200 includes an entropy decoding unit 210, a residual processing unit 220, a predicting unit 230, an adding unit 240, a filter unit 250, and a memory 260 . Here, the residual processing unit 220 may include a rearrangement unit 221, an inverse quantization unit 222, and an inverse transformation unit 223.
비디오 정보를 포함하는 비트스트림이 입력되면, 비디오 디코딩 장치(200)는 비디오 인코딩 장치에서 비디오 정보가 처리된 프로세스에 대응하여 비디오를 복원할 수 있다.When a bitstream including video information is input, the video decoding apparatus 200 can restore video in response to a process in which video information is processed in the video encoding apparatus.
예컨대, 비디오 디코딩 장치(200)는 비디오 인코딩 장치에서 적용된 처리 유닛을 이용하여 비디오 디코딩을 수행할 수 있다. 따라서 비디오 디코딩의 처리 유닛 블록은 일 예로 코딩 유닛일 수 있고, 다른 예로 코딩 유닛, 예측 유닛 또는 변환 유닛일 수 있다. 코딩 유닛은 최대 코딩 유닛으로부터 쿼드 트리 구조 및/또는 바이너리 트리 구조를 따라서 분할될 수 있다. For example, the video decoding apparatus 200 can perform video decoding using a processing unit applied in the video encoding apparatus. Thus, the processing unit block of video decoding may be, for example, a coding unit and, in another example, a coding unit, a prediction unit or a conversion unit. The coding unit may be partitioned along the quad tree structure and / or the binary tree structure from the maximum coding unit.
예측 유닛 및 변환 유닛이 경우에 따라 더 사용될 수 있으며, 이 경우 예측 블록은 코딩 유닛으로부터 도출 또는 파티셔닝되는 블록으로서, 샘플 예측의 유닛일 수 있다. 이 때, 예측 유닛은 서브 블록으로 나뉠 수도 있다. 변환 유닛은 코딩 유닛으로부터 쿼드 트리 구조를 따라서 분할 될 수 있으며, 변환 계수를 유도하는 유닛 또는 변환 계수로부터 레지듀얼 신호를 유도하는 유닛일 수 있다. A prediction unit and a conversion unit may be further used as the case may be, in which case the prediction block is a block derived or partitioned from the coding unit and may be a unit of sample prediction. At this time, the prediction unit may be divided into sub-blocks. The conversion unit may be divided along the quad tree structure from the coding unit and may be a unit that derives the conversion factor or a unit that derives the residual signal from the conversion factor.
엔트로피 디코딩부(210)는 비트스트림을 파싱하여 비디오 복원 또는 픽처 복원에 필요한 정보를 출력할 수 있다. 예컨대, 엔트로피 디코딩부(210)는 지수 골롬 부호화, CAVLC 또는 CABAC 등의 코딩 방법을 기초로 비트스트림 내 정보를 디코딩하고, 비디오 복원에 필요한 신택스 엘리먼트의 값, 레지듀얼에 관한 변환 계수의 양자화된 값 들을 출력할 수 있다. The entropy decoding unit 210 may parse the bitstream and output information necessary for video restoration or picture restoration. For example, the entropy decoding unit 210 decodes information in a bitstream based on a coding method such as exponential Golomb coding, CAVLC, or CABAC, and calculates a value of a syntax element necessary for video restoration, a quantized value Lt; / RTI >
보다 상세하게, CABAC 엔트로피 디코딩 방법은, 비트스트림에서 각 구문 요소에 해당하는 빈을 수신하고, 디코딩 대상 구문 요소 정보와 주변 및 디코딩 대상 블록의 디코딩 정보 혹은 이전 단계에서 디코딩된 심볼/빈의 정보를 이용하여 문맥(context) 모델을 결정하고, 결정된 문맥 모델에 따라 빈(bin)의 발생 확률을 예측하여 빈의 산술 디코딩(arithmetic decoding)를 수행하여 각 구문 요소의 값에 해당하는 심볼을 생성할 수 있다. 이때, CABAC 엔트로피 디코딩 방법은 문맥 모델 결정 후 다음 심볼/빈의 문맥 모델을 위해 디코딩된 심볼/빈의 정보를 이용하여 문맥 모델을 업데이트할 수 있다.More specifically, the CABAC entropy decoding method includes receiving a bean corresponding to each syntax element in a bitstream, decoding decoding target information of the decoding target syntax element, decoding information of a surrounding and decoding target block, or information of a symbol / A context model is determined and an occurrence probability of a bin is predicted according to the determined context model to perform arithmetic decoding of the bean to generate a symbol corresponding to the value of each syntax element have. At this time, the CABAC entropy decoding method can update the context model using the information of the decoded symbol / bin for the context model of the next symbol / bean after determining the context model.
엔트로피 디코딩부(210)에서 디코딩된 정보 중 예측에 관한 정보는 예측부(230)로 제공되고, 엔트로피 디코딩부(210)에서 엔트로피 디코딩이 수행된 레지듀얼 값, 즉 양자화된 변환 계수는 재정렬부(221)로 입력될 수 있다.Information regarding prediction in the information decoded by the entropy decoding unit 210 is provided to the predicting unit 230. The residual value, i.e., the quantized transform coefficient, which is entropy-decoded in the entropy decoding unit 210, 221).
재정렬부(221)는 양자화되어 있는 변환 계수들을 2차원의 블록 형태로 재정렬할 수 있다. 재정렬부(221)는 인코딩 장치에서 수행된 계수 스캐닝에 대응하여 재정렬을 수행할 수 있다. 여기서 재정렬부(221)는 별도의 구성으로 설명하였으나, 재정렬부(221)는 역양자화부(222)의 일부일 수 있다.The reordering unit 221 may rearrange the quantized transform coefficients into a two-dimensional block form. The reordering unit 221 may perform reordering in response to the coefficient scanning performed in the encoding apparatus. The rearrangement unit 221 may be a part of the inverse quantization unit 222, although the rearrangement unit 221 has been described as an alternative configuration.
역양자화부(222)는 양자화되어 있는 변환 계수들을 (역)양자화 파라미터를 기반으로 역양자화하여 변환 계수를 출력할 수 있다. 이 때, 양자화 파라미터를 유도하기 위한 정보는 인코딩 장치로부터 시그널링될 수 있다.The inverse quantization unit 222 may dequantize the quantized transform coefficients based on the (inverse) quantization parameters, and output the transform coefficients. At this time, the information for deriving the quantization parameter may be signaled from the encoding device.
역변환부(223)는 변환 계수들을 역변환하여 레지듀얼 샘플들을 유도할 수 있다. The inverse transform unit 223 may invert the transform coefficients to derive the residual samples.
예측부(230)는 현재 블록에 대한 예측을 수행하고, 상기 현재 블록에 대한 예측 샘플들을 포함하는 예측된 블록(predicted block)을 생성할 수 있다. 예측부(230)에서 수행되는 예측의 단위는 코딩 블록일 수도 있고, 변환 블록일 수도 있고, 예측 블록일 수도 있다. The prediction unit 230 may predict a current block and may generate a predicted block including prediction samples of the current block. The unit of prediction performed in the prediction unit 230 may be a coding block, a transform block, or a prediction block.
예측부(230)는 상기 예측에 관한 정보를 기반으로 인트라 예측을 적용할 것인지 인터 예측을 적용할 것인지를 결정할 수 있다. 이 때, 인트라 예측과 인터 예측 중 어느 것을 적용할 것인지를 결정하는 단위와 예측 샘플을 생성하는 단위는 상이할 수 있다. 아울러, 인터 예측과 인트라 예측에 있어서 예측 샘플을 생성하는 단위 또한 상이할 수 있다. 예를 들어, 인터 예측과 인트라 예측 중 어느 것을 적용할 것인지는 CU 단위로 결정할 수 있다. 또한 예를 들어, 인터 예측에 있어서 PU 단위로 예측 모드를 결정하고 예측 샘플을 생성할 수 있고, 인트라 예측에 있어서 PU 단위로 예측 모드를 결정하고 TU 단위로 예측 샘플을 생성할 수도 있다. The prediction unit 230 may determine whether intra prediction or inter prediction is to be applied based on the prediction information. In this case, a unit for determining whether to apply intra prediction or inter prediction may differ from a unit for generating a prediction sample. In addition, units for generating prediction samples in inter prediction and intra prediction may also be different. For example, whether inter prediction or intra prediction is to be applied can be determined in units of CU. Also, for example, in the inter prediction, the prediction mode may be determined in units of PU to generate prediction samples. In intra prediction, a prediction mode may be determined in units of PU, and prediction samples may be generated in units of TU.
인트라 예측의 경우에, 예측부(230)는 현재 픽처 내의 주변 참조 샘플을 기반으로 현재 블록에 대한 예측 샘플을 유도할 수 있다. 예측부(230)는 현재 블록의 주변 참조 샘플을 기반으로 방향성 모드 또는 비방향성 모드를 적용하여 현재 블록에 대한 예측 샘플을 유도할 수 있다. 이 때, 주변 블록의 인트라 예측 모드를 이용하여 현재 블록에 적용할 예측 모드가 결정될 수도 있다. In the case of intra prediction, the prediction unit 230 may derive a prediction sample for the current block based on the surrounding reference samples in the current picture. The prediction unit 230 may apply a directional mode or a non-directional mode based on the neighbor reference samples of the current block to derive a prediction sample for the current block. In this case, a prediction mode to be applied to the current block may be determined using the intra prediction mode of the neighboring block.
인터 예측의 경우에, 예측부(230)는 참조 픽처 상에서 움직임 벡터에 의해 참조 픽처 상에서 특정되는 샘플을 기반으로 현재 블록에 대한 예측 샘플을 유도할 수 있다. 예측부(230)는 스킵(skip) 모드, 머지(merge) 모드 및 MVP 모드 중 어느 하나를 적용하여 현재 블록에 대한 예측 샘플을 유도할 수 있다. 이때, 비디오 인코딩 장치에서 제공된 현재 블록의 인터 예측에 필요한 움직임 정보, 예컨대 움직임 벡터, 참조 픽처 인덱스 등에 관한 정보는 상기 예측에 관한 정보를 기반으로 획득 또는 유도될 수 있다In the case of inter prediction, the prediction unit 230 may derive a prediction sample for a current block based on a sample specified on a reference picture by a motion vector on a reference picture. The prediction unit 230 may derive a prediction sample for a current block by applying a skip mode, a merge mode, or an MVP mode. At this time, motion information necessary for inter-prediction of a current block provided in the video encoding apparatus, for example, information on a motion vector, a reference picture index, and the like may be acquired or derived based on the prediction information
스킵 모드와 머지 모드의 경우에, 주변 블록의 움직임 정보가 현재 블록의 움직임 정보로 이용될 수 있다. 이 때, 주변 블록은 공간적 주변 블록과 시간적 주변 블록을 포함할 수 있다.In the skip mode and the merge mode, motion information of a neighboring block can be used as motion information of the current block. In this case, the neighboring block may include a spatial neighboring block and a temporal neighboring block.
예측부(230)는 가용한 주변 블록의 움직임 정보로 머지 후보 리스트를 구성하고, 머지 인덱스가 머지 후보 리스트 상에서 지시하는 정보를 현재 블록의 움직임 벡터로 사용할 수 있다. 머지 인덱스는 인코딩 장치로부터 시그널링될 수 있다. 움직임 정보는 움직임 벡터와 참조 픽처를 포함할 수 있다. 스킵 모드와 머지 모드에서 시간적 주변 블록의 움직임 정보가 이용되는 경우에, 참조 픽처 리스트 상의 최상위 픽처가 참조 픽처로서 이용될 수 있다.The prediction unit 230 may construct a merge candidate list using the motion information of the available neighboring blocks and use the information indicated by the merge index on the merge candidate list as the motion vector of the current block. The merge index may be signaled from the encoding device. The motion information may include a motion vector and a reference picture. When the motion information of temporal neighboring blocks is used in the skip mode and the merge mode, the highest picture on the reference picture list can be used as a reference picture.
스킵 모드의 경우, 머지 모드와 달리 예측 샘플과 원본 샘플 사이의 차이(레지듀얼)이 전송되지 않는다.In the skip mode, unlike the merge mode, the difference between the predicted sample and the original sample (residual) is not transmitted.
MVP 모드의 경우, 주변 블록의 움직임 벡터를 움직임 벡터 예측자(motion vector predictor)로 이용하여 현재 블록의 움직임 벡터가 유도될 수 있다. 이 때, 주변 블록은 공간적 주변 블록과 시간적 주변 블록을 포함할 수 있다.In the MVP mode, a motion vector of a current block can be derived using a motion vector of a neighboring block as a motion vector predictor. In this case, the neighboring block may include a spatial neighboring block and a temporal neighboring block.
일 예로, 머지 모드가 적용되는 경우, 복원된 공간적 주변 블록의 움직임 벡터 및/또는 시간적 주변 블록인 Col 블록에 대응하는 움직임 벡터를 이용하여, 머지 후보 리스트가 생성될 수 있다. 머지 모드에서는 머지 후보 리스트에서 선택된 후보 블록의 움직임 벡터가 현재 블록의 움직임 벡터로 사용된다. 상기 예측에 관한 정보는 상기 머지 후보 리스트에 포함된 후보 블록들 중에서 선택된 최적의 움직임 벡터를 갖는 후보 블록을 지시하는 머지 인덱스를 포함할 수 있다. 이 때, 예측부(230)는 상기 머지 인덱스를 이용하여, 현재 블록의 움직임 벡터를 도출할 수 있다.For example, when the merge mode is applied, a merge candidate list may be generated using a motion vector of the reconstructed spatial neighboring block and / or a motion vector corresponding to a Col block that is a temporally neighboring block. In the merge mode, the motion vector of the candidate block selected in the merge candidate list is used as the motion vector of the current block. The prediction information may include a merge index indicating a candidate block having an optimal motion vector selected from the candidate blocks included in the merge candidate list. At this time, the predicting unit 230 can derive the motion vector of the current block using the merge index.
다른 예로, MVP(Motion Vector Prediction) 모드가 적용되는 경우, 복원된 공간적 주변 블록의 움직임 벡터 및/또는 시간적 주변 블록인 Col 블록에 대응하는 움직임 벡터를 이용하여, 움직임 벡터 예측자 후보 리스트가 생성될 수 있다. 즉, 복원된 공간적 주변 블록의 움직임 벡터 및/또는 시간적 주변 블록인 Col 블록에 대응하는 움직임 벡터는 움직임 벡터 후보로 사용될 수 있다. 상기 예측에 관한 정보는 상기 리스트에 포함된 움직임 벡터 후보 중에서 선택된 최적의 움직임 벡터를 지시하는 예측 움직임 벡터 인덱스를 포함할 수 있다. 이 때, 예측부(230)는 상기 움직임 벡터 인덱스를 이용하여, 움직임 벡터 후보 리스트에 포함된 움직임 벡터 후보 중에서, 현재 블록의 예측 움직임 벡터를 선택할 수 있다. 인코딩 장치의 예측부는 현재 블록의 움직임 벡터와 움직임 벡터 예측자 간의 움직임 벡터 차분(MVD)을 구할 수 있고, 이를 인코딩하여 비트스트림 형태로 출력할 수 있다. 즉, MVD는 현재 블록의 움직임 벡터에서 상기 움직임 벡터 예측자를 뺀 값으로 구해질 수 있다. 이 때, 예측부(230)는 상기 예측에 관한 정보에 포함된 움직임 벡터 차분을 획득하고, 상기 움직임 벡터 차분과 상기 움직임 벡터 예측자의 가산을 통해 현재 블록의 상기 움직임 벡터를 도출할 수 있다. 예측부는 또한 참조 픽처를 지시하는 참조 픽처 인덱스 등을 상기 예측에 관한 정보로부터 획득 또는 유도할 수 있다. As another example, when a motion vector prediction mode (MVP) is applied, a motion vector predictor candidate list is generated by using a motion vector of the reconstructed spatial neighboring block and / or a motion vector corresponding to a Col block which is a temporally neighboring block . That is, the motion vector of the reconstructed spatial neighboring block and / or the motion vector corresponding to the neighboring block Col may be used as a motion vector candidate. The information on the prediction may include a predicted motion vector index indicating an optimal motion vector selected from the motion vector candidates included in the list. At this time, the predicting unit 230 can use the motion vector index to select a predictive motion vector of the current block from the motion vector candidates included in the motion vector candidate list. The predicting unit of the encoding apparatus can obtain the motion vector difference (MVD) between the motion vector of the current block and the motion vector predictor, and can output it as a bit stream. That is, MVD can be obtained by subtracting the motion vector predictor from the motion vector of the current block. In this case, the predicting unit 230 may obtain the motion vector difference included in the information on the prediction, and derive the motion vector of the current block through addition of the motion vector difference and the motion vector predictor. The prediction unit may also acquire or derive a reference picture index or the like indicating the reference picture from the information on the prediction.
가산부(240)는 레지듀얼 샘플과 예측 샘플을 더하여 현재 블록 혹은 현재 픽처를 복원할 수 있다. 가산부(240)는 레지듀얼 샘플과 예측 샘플을 블록 단위로 더하여 현재 픽처를 복원할 수도 있다. 스킵 모드가 적용된 경우에는 레지듀얼이 전송되지 않으므로, 예측 샘플이 복원 샘플이 될 수 있다. 여기서는 가산부(240)를 별도의 구성으로 설명하였으나, 가산부(240)는 예측부(230)의 일부일 수도 있다. 한편, 가산부(240)는 복원부 또는 복원 블록 생성부로 불릴 수도 있다. The adder 240 may add a residual sample and a prediction sample to reconstruct a current block or a current picture. The adder 240 may add the residual samples and the prediction samples on a block-by-block basis to reconstruct the current picture. When the skip mode is applied, since the residual is not transmitted, the predicted sample can be the restored sample. Here, the adder 240 has been described as an alternative configuration, but the adder 240 may be a part of the predictor 230. Meanwhile, the addition unit 240 may be referred to as a restoration unit or a restoration block generation unit.
필터부(250)는 복원된 픽처에 디블록킹 필터링 샘플 적응적 오프셋, 및/또는 ALF 등을 적용할 수 있다. 이 때, 샘플 적응적 오프셋은 샘플 단위로 적용될 수 있으며, 디블록킹 필터링 이후 적용될 수도 있다. ALF는 디블록킹 필터링 및/또는 샘플 적응적 오프셋 이후 적용될 수도 있다.The filter unit 250 may apply deblocking filtered sample adaptive offsets, and / or ALFs, to the reconstructed pictures. At this time, the sample adaptive offset may be applied on a sample-by-sample basis and may be applied after deblocking filtering. The ALF may be applied after deblocking filtering and / or sample adaptive offsets.
메모리(260)는 복원 픽처(디코딩된 픽처) 또는 디코딩에 필요한 정보를 저장할 수 있다. 여기서 복원 픽처는 상기 필터부(250)에 의하여 필터링 절차가 완료된 복원 픽처일 수 있다. 예컨대, 메모리(260)는 인터 예측에 사용되는 픽처들을 저장할 수 있다. 이 때, 인터 예측에 사용되는 픽처들은 참조 픽처 세트 혹은 참조 픽처 리스트에 의해 지정될 수도 있다. 복원된 픽처는 다른 픽처에 대한 참조 픽처로서 이용될 수 있다. 또한, 메모리(260)는 복원된 픽처를 출력 순서에 따라서 출력할 수도 있다.The memory 260 may store restored pictures (decoded pictures) or information necessary for decoding. Here, the reconstructed picture may be a reconstructed picture whose filtering procedure has been completed by the filter unit 250. For example, the memory 260 may store pictures used for inter prediction. At this time, the pictures used for inter prediction may be designated by a reference picture set or a reference picture list. The reconstructed picture can be used as a reference picture for another picture. In addition, the memory 260 may output the restored picture according to the output order.
상술한 내용과 같이 현재 블록에 대하여 인터 예측이 수행되는 경우, 상기 인터 예측은 움직임 정보를 이용한 움직임 보상(motion compensation)을 통하여 수행될 수 있다. 상기 현재 블록에 대한 상기 움직임 정보는 스킵(skip) 모드, 머지 모드, 또는 AMVP(adaptive motion vector prediction) 모드를 적용하여 생성될 수 있고, 인코딩되어 출력될 수 있다. 상기 움직임 정보는 L0 방향에 대한 L0 움직임 정보 및/또는 L1 방향에 대한 L1 움직임 정보를 포함할 수 있다. 여기서, 상기 L0 움직임 정보는 상기 현재 블록에 대한 참조 픽처 리스트 L0(List 0, L0)에 포함된 L0 참조 픽처를 가리키는 L0 참조 픽처 인덱스 및 움직임 벡터 L0(Motion Vector L0, MVL0)를 포함할 수 있고, 상기 L1 움직임 정보는 상기 현재 블록에 대한 참조 픽처 리스트 L0(List 1, L1)에 포함된 L1 참조 픽처를 가리키는 L1 참조 픽처 인덱스 및 MVL1를 포함할 수 있다. 여기서, 상기 L0 방향은 과거 방향 또는 순방향이라고 불릴 수도 있다. 또한, 상기 L1 방향은 미래 방향 또는 역방향이라고 불릴 수도 있다. 또한, 상기 참조 픽처 리스트 L0는 상기 현재 픽처보다 출력 순서상 이전 픽처들을 포함할 수 있고, 상기 참조 픽처 리스트 L1는 상기 현재 픽처보다 출력 순서상 이후 픽처들을 포함할 수 있다. 또한, 상기 MVL0는 L0 움직임 벡터라고 불릴 수 있고, 상기 MVL1는 L1 움직임 벡터라고 불릴 수 있다.In the case where inter prediction is performed on the current block as described above, the inter prediction may be performed through motion compensation using motion information. The motion information for the current block may be generated by applying a skip mode, a merge mode, or an adaptive motion vector prediction (AMVP) mode, and may be encoded and output. The motion information may include L0 motion information for the L0 direction and / or L1 motion information for the L1 direction. Here, the L0 motion information may include an L0 reference picture index and a motion vector L0 (Motion Vector L0, MVL0) indicating an L0 reference picture included in a reference picture list L0 (List 0, L0) for the current block , The L1 motion information may include an L1 reference picture index and an MVL1 indicating an L1 reference picture contained in a reference picture list L0 (List 1, L1) for the current block. Here, the L0 direction may be referred to as a past direction or a forward direction. Further, the L1 direction may be referred to as a future direction or a reverse direction. Also, the reference picture list L0 may include previous pictures in the output order than the current picture, and the reference picture list L1 may include pictures after the current picture in the output order. Also, the MVL0 may be referred to as an L0 motion vector, and the MVL1 may be referred to as an L1 motion vector.
현재 블록에 대한 예측을 수행함에 있어, L0 움직임 정보를 기반으로 인터 예측을 수행하는 경우 LO 예측이라고 불릴 수 있고, L1 움직임 정보를 기반으로 인터 예측을 수행하는 경우 L1 예측이라고 불릴 수 있으며, 상기 L0 움직임 정보 및 L1 움직임 정보를 기반으로 인터 예측을 수행하는 경우 쌍예측(bi-prediction)이라고 불릴 수 있다.In performing the prediction on the current block, if inter prediction is performed based on the L0 motion information, it may be referred to as LO prediction. When inter prediction is performed based on L1 motion information, it may be referred to as L1 prediction. Prediction may be referred to as bi-prediction when inter prediction is performed based on motion information and L1 motion information.
상기 움직임 정보를 전송하는 방법에는 상기 움직임 정보를 직접 인코딩하여 전송하는 방법(예를 들어 AMVP 모드)과 상기 현재 블록에 대한 주변 블록의 움직임 정보를 기반으로 리스트를 생성하고 상기 리스트에 포함된 후보를 가리키는 인덱스를 전송하는 방법(예를 들어 머지 모드)이 포함될 수 있다. A method of transmitting the motion information includes a method of directly encoding and transmitting the motion information (for example, an AMVP mode) and a method of generating a list based on motion information of a neighboring block with respect to the current block, (E.g., a merge mode) may be included.
현재 블록에 상기 AMVP 모드가 적용되는 경우, 영상 코딩 시스템에서 상기 현재 블록의 움직임 벡터를 인코딩하는 과정은 움직임 벡터 예측 과정과 상기 움직임 벡터와 움직임 벡터 예측자 간의 움직임 벡터 차분을 인코딩하는 과정으로 구성될 수 있다. 한편, 본 발명에서는 상기 움직임 벡터 예측 과정에 관한 발명이 제안된다. 상기 움직임 벡터 예측 과정은 상기 현재 블록의 주변 블록의 움직임 정보를 도출하여 움직임 정보 후보 리스트를 구성하는 과정 및 상기 움직임 정보 후보 리스트에 포함된 후보들 중 하나의 움직임 정보를 선택하여 상기 현재 블록의 움직임 벡터 예측자(motion vector predictor, MVP)로 사용하는 과정을 포함할 수 있다. 여기서, 상기 움직임 정보 후보 리스트는 MVP 후보 리스트라고 나타낼 수 있다. When the AMVP mode is applied to the current block, the process of encoding the motion vector of the current block in the image coding system includes a motion vector prediction process and a process of encoding a motion vector difference between the motion vector and the motion vector predictor . In the present invention, the motion vector prediction process is proposed. The motion vector predicting step may include a step of constructing a motion information candidate list by deriving motion information of a neighboring block of the current block, and a step of selecting one of motion information candidates included in the motion information candidate list, And using them as a motion vector predictor (MVP). Here, the motion information candidate list may be referred to as an MVP candidate list.
인터 예측에서 움직임 벡터의 인코딩에 대한 신텍스(syntax)는 다음의 표와 같을 수 있다.The syntax for encoding the motion vector in inter prediction may be as shown in the following table.
Figure PCTKR2017014073-appb-T000001
Figure PCTKR2017014073-appb-T000001
여기서, x0, y0는 상기 현재 블록의 좌상단(top-left) 샘플의 위치 (x0, y0)를 나타낼 수 있다. 또한, inter_pred_idc는 상기 현재 블록의 인터 예측의 방향을 가리키는 인덱스의 신텍스 요소(syntax element)를 나타낼 수 있다. 다시 말해, inter_pred_idc는 상기 현재 블록에 수행되는 인터 예측이 L0 예측, L1 예측, 및 쌍예측 중 어느 예측인지를 나타내는 신텍스 요소를 나타낼 수 있다. 또한, ref_idx_l0는 상기 L0에 포함된 참조 픽처들 중 상기 현재 블록의 참조 픽처를 가리키는 신텍스 요소, ref_idx_l1는 상기 L1에 포함된 참조 픽처들 중 상기 현재 블록의 참조 픽처를 가리키는 신텍스 요소, mvp_l0_flag는 MVPL0(motion vector predictor L0) 후보 리스트에 포함된 MVPL0 후보들 중 상기 현재 블록의 MVPL0를 가리키는 플래그의 신텍스 요소, mvp_l1_flag는 MVPL1(motion vector predictor L1, MVPL1) 후보 리스트에 포함된 MVPL1 후보들 중 상기 MVPL1를 가리키는 플래그의 신텍스 요소, mvd_coding은 상기 현재 블록의 MVD 정보를 나르며, 예를 들어 상기 현재 블록의 MVDL0(motion vector difference L0, MVDL0) 및/또는 MVDL1(motion vector difference L1, MVDL1)를 나타내는 신텍스 요소들을 포함할 수 있다. Here, x0, y0 may represent the position (x0, y0) of the top-left sample of the current block. In addition, inter_pred_idc may indicate a syntax element of an index indicating the direction of inter prediction of the current block. In other words, inter_pred_idc may indicate a syntax element indicating whether the inter prediction performed on the current block is any of L0 prediction, L1 prediction, and pair prediction. Ref_idx_l0 is a syntax element indicating a reference picture of the current block among the reference pictures included in the L0, ref_idx_l1 is a syntax element indicating a reference picture of the current block among the reference pictures included in the L1, mvp_l0_flag is MVPL0 ( the motion vector predictor L0) is a syntax element of a flag indicating MVPL0 of the current block among the MVPL0 candidates included in the candidate list, mvp_l1_flag is a syntax element of a flag indicating MVPL1 among MVPL1 candidates included in the candidate list MVPL1 (motion vector predictor L1, MVPL1) The syntax element mvd_coding carries the MVD information of the current block and may include syntax elements representing, for example, MVDL0 (motion vector difference L0, MVDL0) and / or MVDL1 (motion vector difference L1, MVDL1) have.
한편, 상기 MVPL0 후보 리스트는 상기 L0에 포함된 참조 픽처에 대한 MVPL0 후보들을 포함하는 움직임 정보 후보 리스트를 나타낼 수 있고, MVPL0는 상기 L0에 포함된 참조 픽처에 연관된 MVP를 나타낼 수 있다. 또한, 상기 MVPL1 후보 리스트는 상기 L1에 포함된 참조 픽처에 대한 MVPL1 후보들을 포함하는 움직임 정보 후보 리스트를 나타낼 수 있고, MVPL1는 상기 L1에 포함된 참조 픽처에 연관된 MVP를 나타낼 수 있다. The MVPL0 candidate list may represent a motion information candidate list including MVPL0 candidates for a reference picture included in the L0, and MVPL0 may represent an MVP associated with a reference picture included in the L0. Also, the MVPL1 candidate list may represent a motion information candidate list including MVPL1 candidates for the reference pictures included in the L1, and MVPL1 may represent MVPs associated with the reference pictures included in the L1.
또한, 상기 ref_idx_l0는 상기 현재 블록에 상기 L0 예측 또는 상기 쌍예측이 수행되는 경우에 전송(시그널링)될 수 있고, 상기 ref_idx_l1는 상기 현재 블록에 상기 L1 예측 또는 상기 쌍예측이 수행되는 경우에 전송될 수 있다. 또한, 상기 mvp_l0_flag는 상기 현재 블록에 상기 L0 예측 또는 상기 쌍예측이 수행되는 경우에 전송될 수 있고, 상기 mvp_l1_flag는 상기 현재 블록에 상기 L1 예측 또는 상기 쌍예측이 수행되는 경우에 전송될 수 있다. 또한, 상기 mvd_coding은 상기 MVDL0 및/또는 상기 MVDL1을 포함할 수 있고, 각각의 MVD는 x성분 및 y성분으로 구성될 수 있으며 각 성분의 부호와 크기가 분리되어 전송될 수 있다. 한편, mvp_l0_flag 또는 mvp_l1_flag 는 상기 MVPL0 후보 리스트 또는 상기 MVPL1 후보 리스트에 포함된 후보를 가리키는 인덱스의 신텍스 요소를 나타낼 수 있는바, 상기 MVPL0 후보 리스트 또는 상기 MVPL1 후보 리스트는 2개의 MVP 후보들을 포함할 수 있고, 이 경우, 상기 두 개의 MVP 후보들 중 하나가 상기 현재 블록의 MVP로 선택되기 때문에 플래그로 표현될 수 있다. The ref_idx_l0 may be transmitted (signaled) when the L0 prediction or the pair prediction is performed on the current block, and ref_idx_l1 is transmitted when the L1 prediction or the pair prediction is performed on the current block . The mvp_l0_flag may be transmitted when the L0 prediction or the pair prediction is performed on the current block, and the mvp_l1_flag may be transmitted when the L1 prediction or the pair prediction is performed on the current block. In addition, the mvd_coding may include the MVDL0 and / or the MVDL1, and each MVD may be composed of an x component and a y component, and the sign and size of each component may be transmitted separately. On the other hand, mvp_l0_flag or mvp_l1_flag may indicate a syntax element of an index indicating a candidate included in the MVPL0 candidate list or the MVPL1 candidate list, and the MVPL0 candidate list or MVPL1 candidate list may include two MVP candidates In this case, since one of the two MVP candidates is selected as the MVP of the current block, it can be expressed by a flag.
한편, 상기 현재 블록의 움직임 정보 후보 리스트는 후술하는 내용과 같이 구성될 수 있다.The motion information candidate list of the current block may be configured as described below.
도 3은 상기 현재 블록의 움직임 정보 후보 리스트 생성을 위한 주변 블록들을 나타낸다. 상기 현재 블록의 움직임 정보 후보 리스트는 상기 현재 블록의 상기 주변 블록들을 기반으로 도출될 수 있다. 즉, 상기 대상 블록 주변 소정 위치의 주변 블록들을 기반으로 상기 머지 후보 리스트 또는 MVP 후보 리스트가 구성될 수 있다. 예를 들어, 도 3에 도시된 것과 같이 상기 대상 블록 좌측에 위치하는 두 개의 블록 A0(310)와 A1(320) 그리고 현재 블록 상측의 세 블록 B0(330), B1(340), B2(350)를 기반으로 상기 머지 후보 리스트 또는 MVP 후보 리스트가 구성될 수 있다. 여기서, A0(310)는 좌하측 주변 블록(lower left neighboring block)으로 불릴 수 있고, A1(320)은 좌측 주변 블록(left neighboring block)으로 불릴 수 있다. 그리고 B0(330)는 우상측 주변 블록(upper right neighboring block)으로, B1(340)은 상측 주변 블록(upper neighboring block)으로, B2(350)은 좌상측 주변 블록(upper left neighboring block)으로 불릴 수 있다. FIG. 3 shows neighboring blocks for generating a motion information candidate list of the current block. The motion information candidate list of the current block may be derived based on the neighboring blocks of the current block. That is, the merge candidate list or the MVP candidate list may be configured based on neighboring blocks at predetermined positions around the target block. For example, as shown in FIG. 3, two blocks A0 310 and A1 320 located on the left side of the target block and three blocks B0 330, B1 340 and B2 350 ), The merge candidate list or MVP candidate list may be constructed. Here, A0 310 may be referred to as a lower left neighboring block, and A1 320 may be referred to as a left neighboring block. In addition, B0 330 is an upper right neighboring block, B1 340 is an upper neighboring block, and B2 350 is an upper left neighboring block .
구체적으로, 상기 현재 블록에 AMVP 모드가 적용되는 경우, 상기 A0(310)의 움직임 벡터 및 상기 A1(320)의 움직임 벡터 중 하나의 움직임 벡터가 상기 현재 블록의 참조 픽처 리스트에 대한 움직임 정보 후보로 도출될 수 있다. 여기서, 상기 참조 픽처 리스트는 상기 L0 또는 상기 L1을 나타낼 수 있고, 상기 움직임 정보 후보는 MVP 후보를 나타낼 수 있다. 한편, 상기 A0(310)의 참조 픽처 및 상기 A1(320)의 참조 픽처가 상기 현재 블록의 상기 참조 픽처 리스트에 포함된 상기 현재 블록의 참조 픽처와 달라 상기 A0(310)의 움직임 벡터 및 상기 A1(320)의 움직임 벡터가 상기 현재 블록의 움직임 정보 후보로 도출될 수 없을 수 있다. 이 경우, 상기 A0(310)의 움직임 벡터 또는 상기 A1(320)의 움직임 벡터가 스케일링(scaling)될 수 있고, 상기 스케일링된 움직임 벡터가 상기 현재 블록의 움직임 정보 후보로 도출될 수 있다.Specifically, when an AMVP mode is applied to the current block, one of a motion vector of the A0 310 and a motion vector of the A1 320 is a motion information candidate for the reference picture list of the current block Can be derived. Here, the reference picture list may indicate the L0 or the L1, and the motion information candidate may indicate the MVP candidate. The reference picture of the A0 310 and the reference picture of the A1 320 are different from the reference picture of the current block included in the reference picture list of the current block, The motion vector of the current block 320 may not be derived as the motion information candidate of the current block. In this case, the motion vector of the A0 310 or the motion vector of the A1 320 may be scaled, and the scaled motion vector may be derived as a motion information candidate of the current block.
또한, 상기 B0(330)의 움직임 벡터, 상기 B1(340)의 움직임 벡터 및 상기 B2(350)의 움직임 벡터 중 하나의 움직임 벡터가 참조 픽처 리스트에 대한 움직임 정보 후보로 도출될 수 있다. 여기서, 상기 참조 픽처 리스트는 상기 L0 또는 상기 L1을 나타낼 수 있다. 한편, 상기 B0(330)의 참조 픽처, 상기 B1(340)의 참조 픽처 및 상기 B2(350)의 참조 픽처가 상기 현재 블록의 상기 참조 픽처 리스트에 포함된 상기 현재 블록의 참조 픽처와 달라 상기 B0(330)의 움직임 벡터, 상기 B1(340)의 움직임 벡터 및 B2(350)의 움직임 벡터가 상기 현재 블록의 움직임 정보 후보로 도출될 수 없을 수 있다. 이 경우, 상기 B0(330)의 움직임 벡터, 상기 B1(340)의 움직임 벡터 또는 상기 B2(350)의 움직임 벡터가 스케일링(scaling)될 수 있고, 상기 스케일링된 움직임 벡터가 상기 현재 블록의 움직임 정보 후보로 도출될 수 있다.The motion vector of the B0 330, the motion vector of the B1 340, and the motion vector of the B2 350 may be derived as motion information candidates for the reference picture list. Here, the reference picture list may represent L0 or L1. The reference picture of the B0 330, the reference picture of the B1 340 and the reference picture of the B2 350 are different from the reference pictures of the current block included in the reference picture list of the current block, The motion vector of the current block 330, the motion vector of the B1 340, and the motion vector of the B2 350 may not be derived as motion information candidates of the current block. In this case, a motion vector of the B0 330, a motion vector of the B1 340, or a motion vector of the B2 350 may be scaled, and the scaled motion vector may be scaled It can be derived as a candidate.
상기 A0 및 상기 A1을 기반으로 도출된 MVP 후보와 상기 B0, 상기 B1 및 상기 B2을 기반으로 도출된 움직임 정보 후보가 동일한 경우, 상기 A0 및 상기 A1을 기반으로 도출된 움직임 정보 후보와 상기 B0, 상기 B1 및 상기 B2을 기반으로 도출된 움직임 정보 후보 중 하나는 삭제될 수 있다. If the MVP candidates derived based on A0 and A1 are identical to the motion information candidates derived on the basis of B0, B1 and B2, the motion information candidates derived based on A0 and A1, One of the motion information candidates derived based on B1 and B2 may be deleted.
상기 A0, 상기 A1, 상기 B0, 상기 B1 및 상기 B2를 기반으로 도출된 동일하지 않은 움직임 정보 후보의 개수가 2개 미만인 경우, 동일 위치 블록(collocated block)의 움직임 벡터가 스케일링될 수 있고, 상기 스케일링된 움직임 벡터는 상기 현재 블록의 움직임 정보 후보 리스트에 움직임 정보 후보로 삽입될 수 있다. 여기서, 상기 동일 위치 블록은 동일 위치 픽처(collocated picture) 내 상기 현재 블록의 대응 블록을 나타낼 수 있고, 상기 움직임 정보 후보 리스트는 MVP 후보 리스트를 나타낼 수 있다. 한편, 상기 동일 위치 블록은 시간적 주변 블록(temporal neighboring block)이라고 불릴 수 있다.If the number of unequal motion information candidates derived based on A0, A1, B0, B1 and B2 is less than 2, a motion vector of a collocated block may be scaled, The scaled motion vector may be inserted as a motion information candidate in the motion information candidate list of the current block. Here, the co-located block may represent a corresponding block of the current block in a collocated picture, and the motion information candidate list may represent an MVP candidate list. On the other hand, the co-located block may be referred to as a temporal neighboring block.
상술한 과정이 수행된 이후에도 상기 현재 블록의 상기 움직임 정보 후보 리스트에 포함된 후보의 개수가 2개 미만인 경우, 영 벡터(zero vector)가 상기 움직임 정보 후보 리스트에 움직임 정보 후보로 삽입될 수 있다. If the number of the candidates included in the motion information candidate list of the current block is less than two, the zero vector may be inserted as the motion information candidate in the motion information candidate list even after the above process is performed.
한편, 상술한 내용과 같이 상기 움직임 정보 후보 리스트가 도출될 수 있으나 수신단측 움직임 정보 유도 방법이 추가적으로 고려되어 상기 움직임 정보 후보 리스트가 갱신(update)될 수 있다. 상기 움직임 정보 후보 리스트의 갱신을 통해 상기 현재 블록의 움직임 벡터 예측 정확도가 향상될 수 있다. 즉, 상기 움직임 정보 후보 리스트의 갱신을 통해 상기 현재 블록의 움직임 벡터와 보다 유사한 MVP가 도출될 수 있다. 상기 현재 블록의 움직임 벡터 예측 정확도가 향상되면 상기 현재 블록의 MVD를 위한 비트량이 줄어들 수 있고, 전반적인 영상 인코딩/디코딩 효율이 향상될 수 있다.Meanwhile, the motion information candidate list may be derived as described above, but the motion information candidate list may be updated by further considering the receiving end motion information derivation method. The motion vector prediction accuracy of the current block can be improved by updating the motion information candidate list. That is, MVP, which is more similar to the motion vector of the current block, can be derived through updating of the motion information candidate list. If the motion vector prediction accuracy of the current block is improved, the bit amount for MVD of the current block can be reduced and the overall video encoding / decoding efficiency can be improved.
상기 수신단측 움직임 정보 유도 방법은 상기 현재 블록의 템플릿(template) 및 상기 현재 블록의 참조 픽처 내 참조 블록의 템플릿을 기반으로 움직임 정보를 도출하는 방법을 나타낼 수 있다. 즉, 상기 현재 블록의 템플릿과 차이가 최소인 템플릿에 대한 참조 블록이 도출될 수 있고, 상기 참조 블록을 나타내는 움직임 정보(또는 움직임 벡터)가 도출될 수 있다. 디코딩 장치는 상기 현재 블록의 임의의 주변 영역을 상기 현재 블록의 템플릿으로 설정할 수 있고, 상기 참조 픽처 상에서 상기 현재 블록의 상기 템플릿과 동일한 형태의 템플릿을 이용하여 상기 현재 블록의 움직임 정보 탐색을 수행할 수 있다.The receiving end side motion information derivation method may represent a method of deriving motion information based on a template of the current block and a template of a reference block in a reference picture of the current block. That is, a reference block for a template having a minimum difference from the template of the current block can be derived, and motion information (or a motion vector) representing the reference block can be derived. The decoding apparatus may set an arbitrary peripheral region of the current block as a template of the current block and perform motion information search on the current block using the same template as the template of the current block on the reference picture .
도 4는 상기 현재 블록의 템플릿의 일 예를 나타낸다. 여기서, 상기 현재 블록의 상기 템플릿은 상기 현재 블록의 주변 샘플들을 포함하는 특정 영역일 수 있다. 상기 현재 블록의 좌측 주변 샘플들, 좌상측 주변 샘플 및 상측 주변 샘플들은 상기 현재 블록의 디코딩 시점에 이미 디코딩되어 있을 수 있고, 따라서 디코딩 장치에서의 움직임 정보 탐색 과정에 사용될 수 있으므로 상기 좌측 주변 샘플들, 상기 좌상측 주변 샘플 및 상기 상측 주변 샘플들은 상기 현재 블록의 템플릿에 포함될 수 있다.FIG. 4 shows an example of a template of the current block. Here, the template of the current block may be a specific region including neighboring samples of the current block. Since the left neighboring samples, the left upper neighbor sample, and the upper neighbor samples of the current block may have already been decoded at the decoding time of the current block and thus can be used for the motion information search process in the decoding apparatus, , The upper left neighbor sample and the upper neighbor sample may be included in the template of the current block.
구체적으로, 도 4의 (a)를 참조하면 상기 템플릿은 상기 현재 블록의 좌측 주변 샘플들, 좌상측 주변 샘플 및 상측 주변 샘플들을 포함하는 특정 영역일 수 있다. 또한, 도 4의 (b)를 참조하면 상기 템플릿은 상기 현재 블록의 상기 좌측 주변 샘플들 및 상기 상측 주변 샘플들을 포함하는 특정 영역일 수 있다. 또한, 도 4의 (c)를 참조하면 상기 템플릿은 상기 현재 블록의 상기 상측 주변 샘플들을 포함하는 특정 영역일 수 있다. 또한, 도 4의 (d)를 참조하면 상기 템플릿은 상기 현재 블록의 상기 좌측 주변 샘플들을 포함하는 특정 영역일 수 있다. Specifically, referring to FIG. 4A, the template may be a specific region including left neighboring samples, upper left neighboring samples, and upper neighboring samples of the current block. Also, referring to FIG. 4B, the template may be a specific region including the left neighboring samples and the upper neighboring samples of the current block. Also, referring to FIG. 4C, the template may be a specific region including the upper neighbor samples of the current block. Also, referring to FIG. 4 (d), the template may be a specific region including the left neighboring samples of the current block.
상기 현재 블록의 템플릿으로 설정된 경우, 상기 참조 픽처 내 블록들의 템플릿들 중 상기 현재 블록의 템플릿과의 차이가 최소인 템플릿이 도출될 수 있고, 상기 도출된 템플릿의 참조 블록을 가리키는 움직임 벡터가 도출될 수 있다. 여기서, 상기 차이는 코스트(cost)라고 불릴 수 있다. 상기 코스트는 상기 현재 블록의 템플릿과 상기 참조 블록의 템플릿의 대응하는 샘플들간 차이의 절대값의 합으로 도출될 수 있다. 또한, 상기 현재 블록의 상기 움직임 벡터를 도출하기 위한 비용함수는 다음과 같은 수학식으로 나타낼 수 있다. 즉, 상기 코스트는 다음과 같은 수학식을 기반으로 도출될 수 있다. A template having a minimum difference from the template of the current block among the templates of the blocks in the reference picture may be derived and a motion vector indicating a reference block of the derived template may be derived . Here, the difference may be called a cost. The cost may be derived as the sum of the absolute values of the differences between the templates of the current block and the corresponding samples of the template of the reference block. Also, a cost function for deriving the motion vector of the current block can be expressed by the following equation. That is, the cost can be derived based on the following equation.
Figure PCTKR2017014073-appb-M000001
Figure PCTKR2017014073-appb-M000001
여기서, i, j는 블록 내 샘플의 위치 (i, j)를 나타내고, Costdistortion은 상기 코스트, Tempref는 상기 참조 픽처 내 상기 참조 블록의 템플릿 내 (i, j) 좌표의 복원 샘플, Tempcur는 상기 현재 블록의 템플릿 내 의 (i, j) 좌표의 복원 샘플을 나타낸다. 상기 참조 블록의 템플릿 및 상기 현재 블록의 템플릿 사이의 대응하는 샘플들 간의 차이를 누적할 수 있고, 상기 참조 픽처 내 블록들 중 상기 차이의 누적이 가장 작은 참조 블록을 가리키는 움직임 벡터가 도출될 수 있다. 여기서, 상기 차이의 누적은 상기 코스트를 나타낼 수 있다. (I, j) represents the position (i, j) of the sample in the block, Cost distortion is the cost and Temp ref is the restored sample of the (i, j) coordinate in the template of the reference block in the reference picture, Temp cur Represents a restoration sample of the (i, j) coordinate in the template of the current block. The difference between the template of the reference block and the corresponding sample between the templates of the current block can be accumulated and a motion vector indicating a reference block having the smallest accumulation of the difference among the blocks in the reference picture can be derived . Here, the accumulation of the difference may represent the cost.
인터 예측을 위한 움직임 정보 후보 리스트의 갱신과 관련하여 상술한 수신단측 움직임 정보 유도 방법은 다음과 같이 적용될 수 있다.The above-described method of deriving the receiving end side motion information with respect to updating of the motion information candidate list for inter prediction can be applied as follows.
일 예로, 상술한 내용과 같이 기존의 상기 현재 블록의 움직임 정보 후보 리스트가 구성될 수 있고, 상기 수신단측 움직임 정보 유도 방법을 통하여 별도의 움직임 정보 후보 리스트가 구성될 수 있고, 그 중에서 상기 현재 블록에 대한 최적의 움직임 정보가 도출될 수 있다. 다시 말해, 상기 현재 블록의 주변 블록을 기반으로 상기 현재 블록의 움직임 정보 후보 리스트가 구성될 수 있고, 상기 현재 블록의 템플릿을 기반으로 상기 현재 블록의 움직임 정보 후보 리스트가 구성될 수 있다. 상기 현재 블록의 주변 블록을 기반으로 구성되는 상기 움직임 정보 후보 리스트는 제1 움직임 정보 후보 리스트라고 나타낼 수 있고, 상기 현재 블록의 템플릿을 기반으로 구성되는 상기 제2 움직임 정보 후보 리스트라고 나타낼 수 있다. 구체적으로, 상기 현재 블록의 템플릿이 설정될 수 있고, 상기 현재 블록의 참조 픽처 내 블록들의 템플릿들 중 상기 현재 블록의 템플릿과의 코스트가 작은 템플릿이 도출될 수 있고, 상기 도출된 템플릿의 참조 블록을 가리키는 움직임 벡터가 상기 제2 움직임 정보 후보 리스트의 후보로 도출될 수 있다. 이 경우, 상기 제2 움직임 정보 후보 리스트의 후보가 상기 제1 움직임 정보 후보 리스트의 후보들과 동일한지 판단될 수 있다. 상기 제2 움직임 정보 후보 리스트의 후보가 상기 제1 움직임 정보 후보 리스트의 후보들과 동일한 경우, 상기 제1 움직임 정보 후보 리스트가 그대로 상기 현재 블록의 인터 예측에 사용될 수 있다. 상기 제2 움직임 정보 후보 리스트의 후보가 상기 제1 움직임 정보 후보 리스트의 후보들과 동일하지 않은 경우, 상기 수신단측 움직임 정보 유도 방법을 통하여 도출된 움직임 벡터, 즉, 상기 제2 움직임 정보 후보 리스트의 후보가 상기 제1 움직임 정보 후보 리스트의 후보로 삽입될 수 있다. For example, the motion information candidate list of the current block may be constructed as described above, and the motion information candidate list may be configured by the receiving end side motion information derivation method. Among the motion information candidate lists, Can be obtained. In other words, the motion information candidate list of the current block may be configured based on the neighboring blocks of the current block, and the motion information candidate list of the current block may be configured based on the template of the current block. The motion information candidate list based on the neighboring blocks of the current block may be referred to as a first motion information candidate list and may be referred to as the second motion information candidate list based on the template of the current block. Specifically, a template of the current block can be set, a template having a small cost with respect to the template of the current block among the templates of blocks in the reference block of the current block can be derived, May be derived as a candidate of the second motion information candidate list. In this case, it may be determined whether the candidate of the second motion information candidate list is the same as the candidates of the first motion information candidate list. If the candidate of the second motion information candidate list is the same as the candidates of the first motion information candidate list, the first motion information candidate list may be used as it is for inter prediction of the current block. If the candidate of the second motion information candidate list is not the same as the candidates of the first motion information candidate list, the motion vector derived through the receiving end side motion information derivation method, that is, the candidate of the second motion information candidate list May be inserted as candidates of the first motion information candidate list.
또한, 상술한 상기 현재 블록의 템플릿을 기반으로 움직임 정보 후보 리스트를 갱신하는 방법은 다음과 같이 나타낼 수 있다.The method of updating the motion information candidate list based on the template of the current block may be described as follows.
도 5는 상기 현재 블록의 템플릿을 기반으로 움직임 정보 후보 리스트를 갱신하는 일 예를 나타낸다. 도 5를 참조하면 디코딩 장치는 상기 현재 블록의 주변 블록을 기반으로 상기 움직임 정보 후보 리스트를 구성할 수 있다(S500). 디코딩 장치는 상기 현재 블록의 템플릿을 기반으로 수정된(modified) 움직임 정보를 도출할 수 있다(S510). 즉, 디코딩 장치는 수신단측 움직임 정보 유도 방법을 이용하여 상기 수정된 움직임 정보를 예측할 수 있다. 디코딩 장치는 상술한 바와 같이 상기 현재 블록의 템플릿을 설정할 수 있고, 상기 현재 블록의 참조 픽처 내 블록들의 템플릿들 중 상기 현재 블록의 템플릿과의 코스트가 작은 템플릿을 도출할 수 있다. 디코딩 장치는 상기 도출된 템플릿의 참조 블록을 가리키는 상기 수정된(modified) 움직임 정보를 도출할 수 있다. 디코딩 장치는 상기 움직임 정보 후보 리스트의 후보들과 상기 수정된(modified) 움직임 정보가 동일한지 판단할 수 있다(S520). 상기 움직임 정보 후보 리스트의 후보들과 상기 수정된 움직임 정보가 동일하지 않은 경우, 디코딩 장치는 상기 수정된 움직임 정보를 상기 움직임 정보 후보 리스트의 후보로 삽입할 수 있다(S530). 상기 수정된 움직임 정보를 나타내는 후보는 수정된 후보라고 불릴 수 있다. 이 경우, 디코딩 장치는 상기 후보가 삽입된 움직임 정보 후보 리스트를 기반으로 상기 현재 블록의 인터 예측을 수행할 수 있다. 한편, 상기 움직임 정보 후보 리스트의 후보들과 상기 수정된 움직임 정보가 동일한 경우, 디코딩 장치는 상기 후보가 삽입되지 않은 움직임 정보 후보 리스트를 기반으로 상기 현재 블록의 인터 예측을 수행할 수 있다. FIG. 5 shows an example of updating a motion information candidate list based on the template of the current block. Referring to FIG. 5, the decoding apparatus may construct the motion information candidate list based on neighboring blocks of the current block (S500). The decoding apparatus may derive modified motion information based on the template of the current block (S510). That is, the decoding apparatus can predict the corrected motion information using the receiving end side motion information derivation method. The decoding apparatus can set the template of the current block as described above and derive a template having a small cost from the template of the current block among the templates of the blocks in the reference picture of the current block. The decoding apparatus may derive the modified motion information indicating a reference block of the derived template. The decoding apparatus may determine whether the candidates of the motion information candidate list are identical to the modified motion information (S520). If the candidates of the motion information candidate list and the modified motion information are not the same, the decoding apparatus may insert the modified motion information as candidates of the motion information candidate list in operation S530. The candidate representing the modified motion information may be referred to as a modified candidate. In this case, the decoding apparatus can perform inter-prediction of the current block based on the candidate motion information candidate list. On the other hand, when the candidates of the motion information candidate list are identical to the modified motion information, the decoding apparatus can perform inter prediction of the current block based on the motion information candidate list in which the candidate is not inserted.
상술한 상기 현재 블록의 템플릿을 기반으로 움직임 정보 후보 리스트를 갱신하는 방법의 다른 일 예로, 구성된 움직임 정보 후보 리스트의 후보들에 상기 수신단측 움직임 정보 유도 방법을 적용하여 상기 후보들의 순서를 결정하는 방법이 있을 수 있다. As another example of the method of updating the motion information candidate list based on the template of the current block, a method of determining the order of the candidates by applying the receiving end side motion information derivation method to the candidates of the configured motion information candidate list Can be.
구체적으로, 예를 들어, 상기 현재 블록의 주변 블록들을 기반으로 상기 현재 블록의 움직임 정보 후보 리스트가 도출될 수 있고, 상기 움직임 정보 후보 리스트의 후보들의 개수가 2개인 경우, 상기 후보들이 가리키는 참조 블록들의 템플릿들과 상기 현재 블록의 템플릿에 상기 수신단측 움직임 정보 유도 방법을 적용하여 비용함수가 계산될 수 있고, 상기 비용함수의 코스트가 적은 순으로 상기 움직임 정보 후보 리스트가 재정렬될 수 있다. 다시 말해, 상기 움직임 정보 후보 리스트의 후보들이 가리키는 참조 블록들이 도출될 수 있고, 상기 참조 블록들의 템플릿들과 상기 현재 블록의 템플릿과의 코스트가 계산될 수 있고, 상기 코스트가 적은 순으로 상기 움직임 정보 후보 리스트의 후보들이 재정렬될 수 있다. 한편, 상기 움직임 정보 후보 리스트의 후보들의 개수가 2개이므로 인코딩되는 정보량에는 변화가 없을 수 있지만, 선택될 확률이 높은 후보가 상기 움직임 정보 후보 리스트의 첫번째 후보로 도출될 수 있으므로 엔트로피 인코딩된 비트량이 줄어들 수 있다. 상기 움직임 정보 후보 리스트의 후보들을 나타내는 인덱스의 비트수는 가변적일 수 있고, 상기 움직임 정보 후보 리스트의 후보들 중 상기 첫번째 후보가 가장 작은 비트수로 코딩될 수 있다. Specifically, for example, if a motion information candidate list of the current block is derived based on neighboring blocks of the current block, and if the number of candidates of the motion information candidate list is 2, The cost function can be calculated by applying the receiving end side motion information derivation method to the templates of the current block and the template of the current block and the motion information candidate list can be rearranged in order of decreasing cost of the cost function. In other words, the reference blocks indicated by the candidates of the motion information candidate list can be derived, the cost of the templates of the reference blocks and the template of the current block can be calculated, and the cost of the motion information Candidates in the candidate list can be rearranged. Since the number of candidates in the motion information candidate list is two, there is no change in the amount of information to be encoded. However, since a candidate with a high probability of being selected can be derived as the first candidate of the motion information candidate list, the entropy- Can be reduced. The number of bits of the index indicating the candidates of the motion information candidate list may be variable and the first candidate among the candidates of the motion information candidate list may be coded with the smallest bit number.
또한, 상술한 상기 현재 블록의 템플릿을 기반으로 움직임 정보 후보 리스트를 갱신하는 방법은 다음과 같이 나타낼 수 있다.The method of updating the motion information candidate list based on the template of the current block may be described as follows.
도 6은 상기 현재 블록의 템플릿을 기반으로 움직임 정보 후보 리스트를 갱신하는 일 예를 나타낸다. 도 6을 참조하면 디코딩 장치는 상기 현재 블록의 주변 블록을 기반으로 상기 움직임 정보 후보 리스트를 구성할 수 있다(S600). 디코딩 장치는 상기 현재 블록의 템플릿을 기반으로 상기 움직임 정보 후보 리스트의 후보들의 비용 함수 값을 계산할 수 있다(S610). 즉, 디코딩 장치는 수신단측 움직임 정보 유도 방법을 기반으로 상기 움직임 정보 후보 리스트의 후보들의 비용 함수 값을 계산할 수 있다. 디코딩 장치는 상술한 바와 같이 상기 현재 블록의 템플릿을 설정할 수 있고, 상기 움직임 정보 후보 리스트의 후보들이 가리키는 참조 블록들의 템플릿들이 도출될 수 있다. 상기 참조 블록들의 템플릿들은 상기 현재 블록의 템플릿과 동일한 형태를 가질 수 있다. 상기 현재 블록의 템플릿과 각 참조 블록의 템플릿과의 코스트가 계산될 수 있다. 상기 코스트는 상기 비용 함수 값을 나타낼 수 있다. 디코딩 장치는 상기 움직임 정보 후보 리스트의 후보들의 순서가 상기 후보들의 상기 비용 함수 값들의 오름차순과 동일한지 판단할 수 있다(S620). 상기 움직임 정보 후보 리스트의 후보들의 순서가 상기 후보들의 상기 비용 함수 값들의 오름차순과 동일하지 않은 경우, 디코딩 장치는 상기 비용 함수 값이 적은 순으로 상기 움직임 정보 후보 리스트의 후보들을 재정렬할 수 있다(S630). 이 경우, 디코딩 장치는 상기 재정렬된 움직임 정보 후보 리스트를 기반으로 상기 현재 블록의 인터 예측을 수행할 수 있다. 한편, 상기 움직임 정보 후보 리스트의 후보들과 상기 수정된 움직임 정보가 동일한 경우, 디코딩 장치는 재정렬되지 않은 움직임 정보 후보 리스트를 기반으로 상기 현재 블록의 인터 예측을 수행할 수 있다.FIG. 6 shows an example of updating a motion information candidate list based on the template of the current block. Referring to FIG. 6, the decoding apparatus may construct the motion information candidate list based on neighboring blocks of the current block (S600). The decoding apparatus may calculate a cost function value of the candidates of the motion information candidate list based on the template of the current block (S610). That is, the decoding apparatus can calculate the cost function value of the candidates of the motion information candidate list based on the method of deriving the receiving end side motion information. The decoding apparatus can set the template of the current block as described above and the templates of the reference blocks indicated by the candidates of the motion information candidate list can be derived. The templates of the reference blocks may have the same shape as the template of the current block. The cost of the template of the current block and the template of each reference block can be calculated. The cost may represent the cost function value. The decoding apparatus may determine whether the order of the candidates in the motion information candidate list is the same as the ascending order of the cost function values of the candidates in operation S620. If the order of the candidates of the motion information candidate list is not equal to the ascending order of the cost function values of the candidates, the decoding apparatus may rearrange the candidates of the motion information candidate list in order of decreasing the cost function value (S630 ). In this case, the decoding apparatus can perform inter prediction of the current block based on the reordered motion information candidate list. Meanwhile, when the candidates of the motion information candidate list and the modified motion information are the same, the decoding apparatus can perform the inter prediction of the current block based on the motion information candidate list that has not been rearranged.
상술한 상기 현재 블록의 템플릿을 기반으로 움직임 정보 후보 리스트를 갱신하는 방법의 다른 일 예로, 2개보다 더 많은 후보들을 포함하는 움직임 정보 후보 리스트가 구성되고, 상기 움직임 정보 후보 리스트의 후보들에 상기 수신단측 움직임 정보 유도 방법을 적용하여 상기 후보들의 순서를 결정하는 방법이 있을 수 있다. As another example of the method of updating the motion information candidate list based on the template of the current block described above, a motion information candidate list including more than two candidates is constructed, and the motion information candidate list A method of determining the order of the candidates by applying the side motion information derivation method may be used.
구체적으로, 예를 들어, 상기 현재 블록의 주변 블록들을 기반으로 2개보다 많은 N개의 후보들을 포함한 움직임 정보 후보 리스트가 도출될 수 있고, 상기 후보들이 가리키는 참조 블록들의 템플릿들과 상기 현재 블록의 템플릿에 상기 수신단측 움직임 정보 유도 방법을 적용하여 비용함수가 계산될 수 있고, 상기 비용함수의 코스트가 적은 순으로 상기 움직임 정보 후보 리스트가 재정렬될 수 있다. 다시 말해, 상기 움직임 정보 후보 리스트의 후보들이 가리키는 참조 블록들이 도출될 수 있고, 상기 참조 블록들의 템플릿들과 상기 현재 블록의 템플릿과의 코스트가 계산될 수 있고, 상기 코스트가 적은 순으로 상기 움직임 정보 후보 리스트의 후보들이 재정렬될 수 있다. 상기 움직임 정보 후보 리스트가 재정렬된 경우, 상기 움직임 정보 후보 리스트의 후보들 중 2개의 후보들이 선택되어 수정된(modified) 움직임 정보 후보 리스트가 구성될 수 있다. 예를 들어, 상기 재정렬된 움직임 정보 후보 리스트의 후보들 중 첫번째 후보 및 두번째 후보가 선택될 수 있고, 상기 첫번째 후보 및 상기 두번째 후보를 기반으로 상기 수정된 움직임 정보 후보 리스트가 구성될 수 있다. 이 경우, 상기 수정된 움직임 정보 후보 리스트를 사용하여 인터 예측을 수행하는 경우, 기존의 움직임 정보 후보 리스트를 사용하여 인터 예측을 수행하는 경우에 비하여 예측 정확도가 향상될 수 있다.Specifically, for example, a motion information candidate list including N candidates of more than two can be derived based on neighboring blocks of the current block, and templates of reference blocks indicated by the candidates and templates of the current block The cost function can be calculated by applying the receiving end side motion information derivation method to the motion information candidate list, and the motion information candidate list can be rearranged in a descending order of cost. In other words, the reference blocks indicated by the candidates of the motion information candidate list can be derived, the cost of the templates of the reference blocks and the template of the current block can be calculated, and the cost of the motion information Candidates in the candidate list can be rearranged. When the motion information candidate list is rearranged, two candidates of the candidates of the motion information candidate list are selected and modified to form a motion information candidate list. For example, the first candidate and the second candidate among the candidates of the reordered motion information candidate list may be selected, and the modified motion information candidate list may be configured based on the first candidate and the second candidate. In this case, when the inter prediction is performed using the modified motion information candidate list, the prediction accuracy can be improved as compared with the case of performing the inter prediction using the existing motion information candidate list.
또한, 상술한 상기 현재 블록의 템플릿을 기반으로 움직임 정보 후보 리스트를 갱신하는 방법은 다음과 같이 나타낼 수 있다.The method of updating the motion information candidate list based on the template of the current block may be described as follows.
도 7은 상기 현재 블록의 템플릿을 기반으로 움직임 정보 후보 리스트를 갱신하는 일 예를 나타낸다. 도 7을 참조하면 디코딩 장치는 상기 현재 블록의 주변 블록을 기반으로 N개의 후보들을 포함하는 상기 움직임 정보 후보 리스트를 구성할 수 있다(S700). 여기서, 상기 N은 2보다 큰 수일 수 있다(N>2). 디코딩 장치는 상기 현재 블록의 템플릿을 기반으로 상기 움직임 정보 후보 리스트의 후보들의 비용 함수 값을 계산할 수 있다(S710). 디코딩 장치는 상술한 바와 같이 상기 현재 블록의 템플릿을 설정할 수 있고, 상기 움직임 정보 후보 리스트의 후보들이 가리키는 참조 블록들의 템플릿들이 도출될 수 있다. 상기 참조 블록들의 템플릿들은 상기 현재 블록의 템플릿과 동일한 형태를 가질 수 있다. 상기 현재 블록의 템플릿과 각 참조 블록의 템플릿과의 코스트가 계산될 수 있다. 상기 코스트는 상기 비용 함수 값을 나타낼 수 있다. FIG. 7 shows an example of updating a motion information candidate list based on the template of the current block. Referring to FIG. 7, the decoding apparatus may construct the motion information candidate list including N candidates based on neighboring blocks of the current block (S700). Where N may be a number greater than two (N > 2). The decoding apparatus may calculate a cost function value of the candidates of the motion information candidate list based on the template of the current block (S710). The decoding apparatus can set the template of the current block as described above and the templates of the reference blocks indicated by the candidates of the motion information candidate list can be derived. The templates of the reference blocks may have the same shape as the template of the current block. The cost of the template of the current block and the template of each reference block can be calculated. The cost may represent the cost function value.
디코딩 장치는 상기 움직임 정보 후보 리스트의 후보들의 순서가 상기 후보들을 상기 비용 함수 값들의 오름차순으로 정렬할 수 있고, 앞선 순서의 후보들을 기반으로 수정된 움직임 정보 후보 리스트를 구성할 수 있다(S720). 상기 움직임 정보 후보 리스트의 후보들의 순서가 상기 후보들의 상기 비용 함수 값들의 오름차순과 동일하지 않은 경우, 디코딩 장치는 상기 비용 함수 값이 적은 순으로 상기 움직임 정보 후보 리스트의 후보들을 재정렬할 수 있다. 다음으로 디코딩 장치는 상기 움직임 정보 후보 리스트의 후보들 중 앞선 순서의 후보들을 기반으로 수정된 움직임 정보 후보 리스트를 구성할 수 있다. 예를 들어, 상기 재정렬된 움직임 정보 후보 리스트의 후보들 중 첫번째 후보 및 두번째 후보를 기반으로 상기 수정된 움직임 정보 후보 리스트가 구성될 수 있다. 이 경우, 디코딩 장치는 상기 수정된 움직임 정보 후보 리스트를 기반으로 상기 현재 블록의 인터 예측을 수행할 수 있다. The decoding apparatus can arrange the candidates of the motion information candidate list in ascending order of the cost function values in the order of the candidates of the motion information candidate list and construct the modified motion information candidate list based on the candidates of the previous order in operation S720. If the order of the candidates of the motion information candidate list is not the same as the ascending order of the cost function values of the candidates, the decoding apparatus can rearrange the candidates of the motion information candidate list in descending order of the cost function value. Next, the decoding apparatus can construct a modified motion information candidate list based on the candidates of the motion information candidate list in the order ahead of the motion information candidate list. For example, the modified motion information candidate list may be configured based on the first candidate and the second candidate among the candidates of the reordered motion information candidate list. In this case, the decoding apparatus can perform inter-prediction of the current block based on the modified motion information candidate list.
한편, 움직임 정보 후보 리스트를 갱신하는 방법에 있어서 움직임 정보 후보 리스트의 후보가 나타내는 움직임 벡터의 방향을 고려하여 상기 움직임 정보 후보 리스트의 후보들을 재정렬하는 방법이 제안될 수 있다. 현재 블록의 움직임 벡터의 예측에 있어서 움직임 추정(motion estimation)을 통해 도출된 움직임 벡터와 예측된 움직임 벡터, 즉, 상기 움직임 정보 후보 리스트에 포함된 후보와의 차이를 최소화 하는 것이 보다 코딩 효율을 향상시킬 수 있다. 따라서, 상기 움직임 정보 후보 리스트의 후보들이 서로 다른 방향을 가리키는 것이 상기 현재 블록의 움직임 벡터 차분(motion vector difference, MVD)를 보다 줄일 수 있다. Meanwhile, in the method of updating the motion information candidate list, a method of rearranging the candidates of the motion information candidate list considering the direction of the motion vector indicated by the candidate of the motion information candidate list may be proposed. Minimizing the difference between a motion vector derived through motion estimation and a predicted motion vector, i.e., a candidate included in the motion information candidate list, in predicting the motion vector of the current block improves the coding efficiency . Therefore, it is possible to further reduce the motion vector difference (MVD) of the current block if the candidates of the motion information candidate list indicate different directions.
이에, 상기 현재 블록의 움직임 벡터를 도출하기 위하여 구성된 움직임 정보 후보 리스트에 포함된 각 후보의 움직임 벡터의 방향은 상기 움직임 벡터의 x 성분과 y 성분으로 나뉠 수 있고, 후보들의 각 성분의 부호가 다른 경우를 서로 방향이 다르다고 정의할 수 있다. 다시 말해, 상기 움직임 정보 후보 리스트에 포함된 제1 후보가 나타내는 움직임 벡터의 x 성분과 제2 후보가 나타내는 움직임 벡터의 x 성분의 부호가 다른 경우, 상기 제1 후보와 상기 제2 후보의 x 성분 방향이 다르다고 할 수 있고, 상기 제1 후보가 나타내는 움직임 벡터의 y 성분과 상기 제2 후보가 나타내는 움직임 벡터의 y 성분의 부호가 다른 경우, 상기 제1 후보와 상기 제2 후보의 y 성분 방향이 다르다고 할 수 있다. 한편, 상기 제1 후보는 상기 움직임 정보 후보 리스트의 첫번째 후보를 나타낼 수 있고, 상기 제2 후보는 상기 움직임 정보 후보 리스트의 후보들 중 상기 첫번째 후보 이외의 후보를 나타낼 수 있다. The direction of the motion vector of each candidate included in the motion information candidate list configured to derive the motion vector of the current block may be divided into an x component and a y component of the motion vector, The cases can be defined as different directions. In other words, when the sign of the x component of the motion vector represented by the first candidate included in the motion information candidate list is different from the sign of the x component of the motion vector represented by the second candidate, the x component of the first candidate and the second candidate When the y component of the motion vector represented by the first candidate and the y component of the motion vector represented by the second candidate are different from each other, the direction of the y component of the first candidate and the second candidate is It can be said that it is different. The first candidate may represent a first candidate of the motion information candidate list, and the second candidate may represent a candidate other than the first candidate among the candidates of the motion information candidate list.
한편, 상기 제1 후보 및 상기 제2 후보의 x 성분 방향 및 y 성분 방향이 모두 다른 경우, 가장 높은 우선 순위로 설정될 수 있고, 상기 제1 후보 및 상기 제2 후보의 x 성분 방향 또는 y 성분 방향만이 다른 경우, 중간 우선 순위로 설정될 수 있고, 상기 제1 후보 및 상기 제2 후보의 x 성분 방향 및 y 성분 방향이 모두 동일한 경우, 가장 낮은 우선 순위로 설정될 수 있다. 상기 제1 후보가 나타내는 움직임 벡터 및 상기 제2 후보가 나타내는 움직임 벡터의 방향을 고려하여 우선 순위를 설정하는 pseudo code는 다음과 같다. On the other hand, when both the x component direction and the y component direction of the first candidate and the second candidate are different, it can be set to the highest priority, and the x component direction or the y component of the first candidate and the second candidate If only the directions are different, it can be set to the medium priority, and if the x component direction and the y component direction of the first candidate and the second candidate are all the same, the lowest priority can be set. The pseudo code for setting the priority order considering the directions of the motion vector represented by the first candidate and the motion vector represented by the second candidate is as follows.
Figure PCTKR2017014073-appb-T000002
Figure PCTKR2017014073-appb-T000002
여기서, mv0.x 는 상기 제1 후보가 나타내는 움직임 벡터의 x 성분을 나타낼 수 있고, mv0.y 는 상기 제1 후보가 나타내는 움직임 벡터의 y 성분을 나타낼 수 있다. mv1.x 는 상기 제2 후보가 나타내는 움직임 벡터의 x 성분을 나타낼 수 있고, mv1.y 는 상기 제2 후보가 나타내는 움직임 벡터의 y 성분을 나타낼 수 있다. Here, mv0.x may represent the x component of the motion vector represented by the first candidate, and mv0.y may represent the y component of the motion vector represented by the first candidate. mv1.x may represent the x component of the motion vector represented by the second candidate, and mv1.y may represent the y component of the motion vector represented by the second candidate.
상술한 방법과 같이 상기 제1 후보와의 우선 순위가 도출된 경우, 상기 우선 순위를 기반으로 상기 움직임 정보 후보 리스트가 재정렬될 수 있다. If the priority of the first candidate is derived, the motion information candidate list may be rearranged based on the priority.
상술한 상기 제1 후보와의 우선 순위를 기반으로 움직임 정보 후보 리스트를 갱신하는 방법은 다음과 같이 나타낼 수 있다.A method of updating the motion information candidate list based on the priority of the first candidate may be described as follows.
도 8은 후보들의 움직임 벡터들의 방향에 따라 도출된 우선 순위를 기반으로 움직임 정보 후보 리스트를 갱신하는 일 예를 나타낸다. 도 8을 참조하면 디코딩 장치는 상기 현재 블록의 주변 블록을 기반으로 N개의 후보들을 포함하는 상기 움직임 정보 후보 리스트를 구성할 수 있다(S800). 여기서, 상기 N은 2보다 큰 수일 수 있다 (N>2). 디코딩 장치는 상기 움직임 정보 후보 리스트의 첫번째 후보를 기반으로 우선 순위를 도출할 n번째 후보로 두번째 후보를 도출할 수 있다(S810). 디코딩 장치는 상기 첫번째 후보의 움직임 벡터와 상기 n번째 후보의 움직임 벡터의 방향을 기반으로 상기 n번째 후보의 우선 순위를 계산할 수 있다(S820). 상기 n번째 후보로 상기 두번째 후보가 도출된 경우, 디코딩 장치는 상기 첫번째 후보 및 상기 두번째 후보의 x 성분 방향 및 y 성분 방향을 기반으로 상기 우선 순위를 계산할 수 있다. 예를 들어, 상기 첫번째 후보 및 상기 두번째 후보의 x 성분 방향 및 y 성분 방향이 모두 다른 경우, 가장 높은 우선 순위로 설정될 수 있고, 상기 첫번째 후보 및 상기 두번째 후보의 x 성분 방향 또는 y 성분 방향만이 다른 경우, 중간 우선 순위로 설정될 수 있고, 상기 첫번째 후보 및 상기 두번째 후보의 x 성분 방향 및 y 성분 방향이 모두 동일한 경우, 가장 낮은 우선 순위로 설정될 수 있다. 구체적으로, 상기 첫번째 후보의 움직임 벡터의 x성분 및 상기 두번째 후보의 움직임 벡터의 x성분을 곱한 값이 0보다 작은 경우, 상기 첫번째 후보 및 상기 두번째 후보의 x 성분 방향이 다르다고 할 수 있다. 또한, 상기 첫번째 후보의 움직임 벡터의 y성분 및 상기 두번째 후보의 움직임 벡터의 y성분을 곱한 값이 0보다 작은 경우, 상기 첫번째 후보 및 상기 두번째 후보의 y 성분 방향이 다르다고 할 수 있다.FIG. 8 shows an example of updating the motion information candidate list based on the priorities derived according to the directions of the motion vectors of the candidates. Referring to FIG. 8, the decoding apparatus may construct the motion information candidate list including N candidates based on neighboring blocks of the current block (S800). Where N may be a number greater than two (N > 2). The decoding apparatus may derive a second candidate as an n-th candidate to derive a priority based on the first candidate of the motion information candidate list (S810). The decoding apparatus may calculate the priority of the n-th candidate based on the motion vector of the first candidate and the direction of the motion vector of the n-th candidate (S820). When the second candidate is derived as the n-th candidate, the decoding apparatus may calculate the priority based on the x-component direction and the y-component direction of the first candidate and the second candidate. For example, if both the x component direction and the y component direction of the first candidate and the second candidate are different, it can be set to the highest priority, and only the x component direction or the y component direction of the first candidate and the second candidate Can be set to the intermediate priority and the lowest priority can be set if the x component direction and y component direction of the first candidate and the second candidate are all the same. Specifically, when the value obtained by multiplying the x component of the motion vector of the first candidate by the x component of the motion vector of the second candidate is less than 0, the direction of the x component of the first candidate and the second candidate may be different. When the y component of the motion vector of the first candidate and the y component of the motion vector of the second candidate are smaller than 0, the direction of the y component of the first candidate and the second candidate may be different.
상기 n번째 후보에 대한 우선 순위가 계산된 경우, 디코딩 장치는 상기 n번째 후보가 N번째 후보인지 판단할 수 있다(S830). 상기 n번째 후보가 N번째 후보가 아닌 경우, 디코딩 장치는 상기 첫번째 후보의 움직임 벡터와 n+1번째 후보의 움직임 벡터의 방향을 기반으로 상기 n+1번째 후보의 우선 순위를 계산할 수 있다(S840). 상기 n번째 후보가 N번째 후보인 경우, 디코딩 장치는 상기 움직임 정보 후보 리스트의 후보들의 순서를 상기 후보들의 우선 순위를 기반으로 정렬할 수 있고, 앞선 순서의 후보들을 기반으로 수정된 움직임 정보 후보 리스트를 구성할 수 있다(S850). 디코딩 장치는 상기 움직임 정보 후보 리스트의 후보들의 순서를 상기 후보들의 우선 순위가 높은 순으로 정렬할 수 있다. 디코딩 장치는 상기 정렬된 움직임 정보 후보 리스트들 중 앞선 순서의 후보들을 기반으로 수정된 움직임 정보 후보 리스트를 구성할 수 있다. 예를 들어, 상기 정렬된 움직임 정보 후보 리스트의 후보들 중 첫번째 후보 및 두번째 후보를 기반으로 상기 수정된 움직임 정보 후보 리스트가 구성될 수 있다. 이 경우, 디코딩 장치는 상기 수정된 움직임 정보 후보 리스트를 기반으로 상기 현재 블록의 인터 예측을 수행할 수 있다. If the priority of the n-th candidate is calculated, the decoding apparatus may determine whether the n-th candidate is the N-th candidate (S830). If the nth candidate is not the Nth candidate, the decoding apparatus may calculate the priority of the (n + 1) th candidate based on the direction of the motion vector of the first candidate and the motion vector of the (n + 1) th candidate ). If the n-th candidate is the N-th candidate, the decoding apparatus can sort the order of the candidates of the motion information candidate list based on the priorities of the candidates, and the motion information candidate list (S850). The decoding apparatus can sort the order of the candidates of the motion information candidate list in descending order of priority of the candidates. The decoding apparatus may construct a modified motion information candidate list based on the candidates in the preceding order among the aligned motion information candidate lists. For example, the modified motion information candidate list may be configured based on the first candidate and the second candidate among the candidates of the aligned motion information candidate list. In this case, the decoding apparatus can perform inter-prediction of the current block based on the modified motion information candidate list.
한편, 움직임 정보 후보 리스트를 갱신하는 방법에 있어서 상술한 수신단측 움직임 정보 유도 방법 및 상기 움직임 정보 후보 리스트의 첫번째 후보를 기반으로 도출되는 우선 순위를 고려하는 방법이 모두 고려될 수 있다. On the other hand, in the method of updating the motion information candidate list, both the above-described method of deriving the receiving end side motion information and the method of considering the priority derived based on the first candidate of the motion information candidate list can be considered.
도 9는 상기 현재 블록의 템플릿 및 상기 움직임 정보 후보 리스트의 후보들의 움직임 벡터들의 방향에 따라 도출된 우선 순위를 기반으로 상기 움직임 정보 후보 리스트를 갱신하는 일 예를 나타낸다. 도 9를 참조하면 디코딩 장치는 상기 현재 블록의 주변 블록을 기반으로 N개의 후보들을 포함하는 상기 움직임 정보 후보 리스트를 구성할 수 있다(S900). 여기서, 상기 N은 2보다 큰 수일 수 있다 (N>2). 디코딩 장치는 상기 현재 블록의 템플릿을 기반으로 수정된(modified) 움직임 정보를 도출할 수 있다(S910). 디코딩 장치는 상술한 바와 같이 상기 현재 블록의 템플릿을 설정할 수 있고, 상기 현재 블록의 참조 픽처 내 블록들의 템플릿들 중 상기 현재 블록의 템플릿과의 코스트가 작은 템플릿을 도출할 수 있다. 디코딩 장치는 상기 도출된 템플릿의 참조 블록을 가리키는 상기 수정된(modified) 움직임 정보를 도출할 수 있다. 디코딩 장치는 상기 움직임 정보 후보 리스트의 후보들과 상기 수정된(modified) 움직임 정보가 동일한지 판단할 수 있다(S920). 상기 움직임 정보 후보 리스트의 후보들과 상기 수정된 움직임 정보가 동일하지 않은 경우, 디코딩 장치는 상기 수정된 움직임 정보를 상기 움직임 정보 후보 리스트의 후보로 삽입할 수 있다(S930). 한편, 상기 움직임 정보 후보 리스트의 후보들과 상기 수정된 움직임 정보가 동일한 경우, 상기 수정된 움직임 정보는 상기 움직임 정보 후보 리스트의 후보로 삽입되지 않을 수 있다.FIG. 9 shows an example of updating the motion information candidate list based on the template of the current block and the priorities derived according to the directions of the motion vectors of the candidates of the motion information candidate list. Referring to FIG. 9, the decoding apparatus may construct the motion information candidate list including N candidates based on neighboring blocks of the current block (S900). Where N may be a number greater than two (N > 2). The decoding apparatus may derive modified motion information based on the template of the current block (S910). The decoding apparatus can set the template of the current block as described above and derive a template having a small cost from the template of the current block among the templates of the blocks in the reference picture of the current block. The decoding apparatus may derive the modified motion information indicating a reference block of the derived template. The decoding apparatus may determine whether the candidates of the motion information candidate list are identical to the modified motion information (S920). If the candidates of the motion information candidate list and the corrected motion information are not the same, the decoding apparatus may insert the modified motion information as candidates of the motion information candidate list (S930). On the other hand, when the candidates of the motion information candidate list are identical to the modified motion information, the modified motion information may not be inserted as candidates of the motion information candidate list.
디코딩 장치는 상기 움직임 정보 후보 리스트의 첫번째 후보를 기반으로 우선 순위를 도출할 n번째 후보로 두번째 후보를 도출할 수 있다(S940). 디코딩 장치는 상기 첫번째 후보의 움직임 벡터와 상기 n번째 후보의 움직임 벡터의 방향을 기반으로 상기 n번째 후보의 우선 순위를 계산할 수 있다(S950). 상기 n번째 후보로 상기 두번째 후보가 도출된 경우, 디코딩 장치는 상기 첫번째 후보 및 상기 두번째 후보의 x 성분 방향 및 y 성분 방향을 기반으로 상기 우선 순위를 계산할 수 있다. 예를 들어, 상기 첫번째 후보 및 상기 두번째 후보의 x 성분 방향 및 y 성분 방향이 모두 다른 경우, 가장 높은 우선 순위로 설정될 수 있고, 상기 첫번째 후보 및 상기 두번째 후보의 x 성분 방향 또는 y 성분 방향만이 다른 경우, 중간 우선 순위로 설정될 수 있고, 상기 첫번째 후보 및 상기 두번째 후보의 x 성분 방향 및 y 성분 방향이 모두 동일한 경우, 가장 낮은 우선 순위로 설정될 수 있다. 구체적으로, 상기 첫번째 후보의 움직임 벡터의 x성분 및 상기 두번째 후보의 움직임 벡터의 x성분을 곱한 값이 0보다 작은 경우, 상기 첫번째 후보 및 상기 두번째 후보의 x 성분 방향이 다르다고 할 수 있다. 또한, 상기 첫번째 후보의 움직임 벡터의 y성분 및 상기 두번째 후보의 움직임 벡터의 y성분을 곱한 값이 0보다 작은 경우, 상기 첫번째 후보 및 상기 두번째 후보의 y 성분 방향이 다르다고 할 수 있다.The decoding apparatus may derive a second candidate as an n-th candidate to derive a priority based on the first candidate of the motion information candidate list (S940). The decoding apparatus may calculate the priority of the n-th candidate based on the motion vector of the first candidate and the direction of the motion vector of the n-th candidate (S950). When the second candidate is derived as the n-th candidate, the decoding apparatus may calculate the priority based on the x-component direction and the y-component direction of the first candidate and the second candidate. For example, if both the x component direction and the y component direction of the first candidate and the second candidate are different, it can be set to the highest priority, and only the x component direction or the y component direction of the first candidate and the second candidate Can be set to the intermediate priority and the lowest priority can be set if the x component direction and y component direction of the first candidate and the second candidate are all the same. Specifically, when the value obtained by multiplying the x component of the motion vector of the first candidate by the x component of the motion vector of the second candidate is less than 0, the direction of the x component of the first candidate and the second candidate may be different. When the y component of the motion vector of the first candidate and the y component of the motion vector of the second candidate are smaller than 0, the direction of the y component of the first candidate and the second candidate may be different.
상기 n번째 후보에 대한 우선 순위가 계산된 경우, 디코딩 장치는 상기 n번째 후보가 N번째 후보인지 판단할 수 있다(S960). 상기 n번째 후보가 N번째 후보가 아닌 경우, 디코딩 장치는 상기 첫번째 후보의 움직임 벡터와 n+1번째 후보의 움직임 벡터의 방향을 기반으로 상기 n+1번째 후보의 우선 순위를 계산할 수 있다(S970). 상기 n번째 후보가 N번째 후보인 경우, 디코딩 장치는 상기 움직임 정보 후보 리스트의 후보들의 순서를 상기 후보들의 우선 순위를 기반으로 정렬할 수 있고, 앞선 순서의 후보들을 기반으로 수정된 움직임 정보 후보 리스트를 구성할 수 있다(S980). 디코딩 장치는 상기 움직임 정보 후보 리스트의 후보들의 순서를 상기 후보들의 우선 순위가 높은 순으로 정렬할 수 있다. 디코딩 장치는 상기 정렬된 움직임 정보 후보 리스트들 중 앞선 순서의 후보들을 기반으로 수정된 움직임 정보 후보 리스트를 구성할 수 있다. 예를 들어, 상기 정렬된 움직임 정보 후보 리스트의 후보들 중 첫번째 후보 및 두번째 후보를 기반으로 상기 수정된 움직임 정보 후보 리스트가 구성될 수 있다. 이 경우, 디코딩 장치는 상기 수정된 움직임 정보 후보 리스트를 기반으로 상기 현재 블록의 인터 예측을 수행할 수 있다. 상술한 내용과 같이 상기 수정된 움직임 정보 후보 리스트가 도출되는 경우, 상기 움직임 정보 후보 리스트의 후보들 중 상기 현재 블록의 움직임 벡터와 가장 유사한 상기 수정된 후보가 상기 수정된 움직임 정보 후보 리스트의 첫번째 후보로 설정될 수 있고, 상기 첫번째 후보와 가장 반대 방향인 움직임 벡터가 상기 수정된 움직임 정보 후보 리스트의 두번째 후보로 설정될 수 있다. 상기 수정된 움직임 정보 리스트의 후보들이 나타내는 움직임 벡터들의 다양성이 보장될 수 있고, 이를 통하여 인터 예측의 코딩 효율이 향상될 수 있다.If the priority of the n-th candidate is calculated, the decoding device may determine whether the n-th candidate is the N-th candidate (S960). If the nth candidate is not the Nth candidate, the decoding apparatus may calculate the priority of the (n + 1) th candidate based on the direction of the motion vector of the first candidate and the motion vector of the (n + 1) th candidate ). If the n-th candidate is the N-th candidate, the decoding apparatus can sort the order of the candidates of the motion information candidate list based on the priorities of the candidates, and the motion information candidate list (S980). The decoding apparatus can sort the order of the candidates of the motion information candidate list in descending order of priority of the candidates. The decoding apparatus may construct a modified motion information candidate list based on the candidates in the preceding order among the aligned motion information candidate lists. For example, the modified motion information candidate list may be configured based on the first candidate and the second candidate among the candidates of the aligned motion information candidate list. In this case, the decoding apparatus can perform inter-prediction of the current block based on the modified motion information candidate list. When the modified motion information candidate list is derived as described above, the modified candidate most similar to the motion vector of the current block among the candidates of the motion information candidate list is the first candidate of the modified motion information candidate list And a motion vector which is the direction opposite to the first candidate may be set as the second candidate of the modified motion information candidate list. Diversity of the motion vectors represented by the candidates of the modified motion information list can be guaranteed, and coding efficiency of the inter prediction can be improved.
한편, 상기 현재 블록의 템플릿을 기반으로 도출된 상기 움직임 정보 후보 리스트의 후보들의 비용 함수 값들 및 상기 움직임 정보 후보 리스트의 후보들의 움직임 벡터들의 방향에 따라 도출된 우선 순위를 기반으로 상기 움직임 정보 후보 리스트를 갱신될 수도 있다. 구체적으로, 디코딩 장치는 상기 현재 블록의 템플릿을 기반으로 상기 움직임 정보 후보 리스트의 후보들의 비용 함수 값을 계산할 수 있고, 상기 비용 함수 값이 적은 순으로 상기 움직임 정보 후보 리스트의 후보들을 재정렬할 수 있다. 다음으로 디코딩 장치는 상기 움직임 정보 후보 리스트의 첫번째 후보를 기반으로 도출된 후보들의 우선 순위를 기반으로 상기 움직임 정보 후보 리스트를 정렬할 수 있고, 앞선 순서의 후보들을 기반으로 수정된 움직임 정보 후보 리스트를 구성할 수 있다. 이 경우, 상기 현재 블록의 템플릿을 기반으로 도출된 비용 함수 값이 가장 작은 후보가 상기 움직임 정보 후보 리스트의 첫번째 후보로 설정될 수 있고, 상기 첫번째 후보의 움직임 벡터와 방향이 반대되는 순서로 상기 움직임 정보 후보 리스트가 재구성될 수 있는바, 상기 수정된 움직임 정보 리스트의 후보들이 나타내는 움직임 벡터들의 다양성이 보장될 수 있고, 이를 통하여 인터 예측의 코딩 효율이 향상될 수 있다.On the other hand, based on the cost function values of the candidates of the motion information candidate list derived based on the template of the current block and the priorities derived according to the directions of the motion vectors of the candidates of the motion information candidate list, May be updated. Specifically, the decoding apparatus can calculate the cost function values of the candidates of the motion information candidate list based on the template of the current block, and rearrange the candidates of the motion information candidate list in order of decreasing the cost function value . Next, the decoding apparatus can sort the motion information candidate list based on the priorities of the candidates derived based on the first candidate of the motion information candidate list, and generate a motion information candidate list based on the candidates of the previous order Can be configured. In this case, the candidate with the smallest cost function value derived based on the template of the current block may be set as the first candidate of the motion information candidate list, and the motion Since the information candidate list can be reconstructed, the diversity of the motion vectors represented by the candidates of the modified motion information list can be guaranteed, and the coding efficiency of the inter prediction can be improved through this.
도 10은 본 발명에 따른 인코딩 장치에 의한 비디오 인코딩 방법을 개략적으로 나타낸다. 도 10에서 개시된 방법은 도 1에서 개시된 인코딩 장치에 의하여 수행될 수 있다. 구체적으로 예를 들어, 도 10의 S1000 내지 S1020은 상기 인코딩 장치의 예측부에 의하여 수행될 수 있고, S1030은 상기 인코딩 장치의 엔트로피 인코딩부에 의하여 수행될 수 있다.10 schematically shows a video encoding method by an encoding apparatus according to the present invention. The method disclosed in Fig. 10 can be performed by the encoding apparatus disclosed in Fig. Specifically, for example, S1000 to S1020 in FIG. 10 may be performed by the predicting unit of the encoding apparatus, and S1030 may be performed by the entropy encoding unit of the encoding apparatus.
인코딩 장치는 현재 블록의 움직임 정보를 생성한다(S1000). 인코딩 장치는 상기 현재 블록에 대하여 인터 예측을 적용할 수 있다. 상기 현재 블록에 인터 예측이 적용되는 경우, 인코딩 장치는 스킵(skip) 모드, 머지(merge) 모드, 및 AMVP(adaptive motion vector prediction) 모드 중 어느 하나를 적용하여 상기 현재 블록에 대한 움직임 정보를 생성할 수 있다. 스킵 모드와 머지 모드의 경우에, 인코딩 장치는 상기 현재 블록의 주변 블록의 움직임 정보를 기반으로 상기 현재 블록의 움직임 정보로 생성할 수 있다. 상기 움직임 정보는 움직임 벡터와 참조 픽처 인덱스를 포함할 수 있다. 상기 움직임 정보는 쌍예측(bi-prediction) 움직임 정보일 수 있고, 또는 단예측(uni-prediction) 움직임 정보일 수 있다. 상기 쌍예측 움직임 정보는 L0 참조 픽처 인덱스 및 L0 움직임 벡터, L1 참조 픽처 인덱스 및 L1 움직임 벡터를 포함할 수 있고, 상기 단예측 움직임 정보는 L0 참조 픽처 인덱스 및 L0 움직임 벡터를 포함할 수 있고, 또는 L1 참조 픽처 인덱스 및 L1 움직임 벡터를 포함할 수 있다. 상기 L0은 참조 픽처 리스트 L0(List 0)를 나타내고, 상기 L1은 참조 픽처 리스트 L1(List 1)를 나타낸다. The encoding apparatus generates motion information of the current block (S1000). The encoding apparatus may apply inter prediction to the current block. When inter prediction is applied to the current block, the encoding apparatus generates motion information on the current block by applying any one of a skip mode, a merge mode, and an adaptive motion vector prediction (AMVP) mode can do. In the skip mode and the merge mode, the encoding apparatus can generate motion information of the current block based on motion information of a neighboring block of the current block. The motion information may include a motion vector and a reference picture index. The motion information may be bi-prediction motion information, or may be uni-prediction motion information. The bi-predictive motion information may include an L0 reference picture index, an L0 motion vector, an L1 reference picture index, and an L1 motion vector, the short motion prediction information may include an L0 reference picture index and a L0 motion vector, An L1 reference picture index and an L1 motion vector. L0 denotes a reference picture list L0 (List 0), and L1 denotes a reference picture list L1 (List 1).
AMVP 모드의 경우, 인코딩 장치는 상기 현재 블록의 주변 블록의 움직임 벡터를 상기 현재 블록의 움직임 벡터 예측자(motion vector predictor, MVP)로 이용하여 상기 현재 블록의 움직임 벡터를 유도할 수 있다. 이에, 인코딩 장치는 움직임 정보 후보 리스트에 포함된 후보들 중 하나의 후보를 가리키는 MVP 플래그 및 상기 움직임 벡터에 대한 참조 픽처 인덱스를 포함한 상기 움직임 정보를 생성할 수 있다.In the AMVP mode, the encoding apparatus may derive a motion vector of the current block using a motion vector of a neighboring block of the current block as a motion vector predictor (MVP) of the current block. Accordingly, the encoding apparatus can generate the motion information including the MVP flag indicating one of the candidates included in the motion information candidate list and the reference picture index for the motion vector.
인코딩 장치는 상기 현재 블록의 주변 블록들을 기반으로 움직임 정보 후보 리스트를 생성한다(S1010). 인코딩 장치는 상기 현재 블록의 주변 블록들을 기반으로 움직임 정보 후보 리스트를 생성할 수 있다. 상기 현재 블록에 스킵 또는 머지 모드가 적용된 경우, 상기 움직임 정보 후보 리스트는 머지 후보 리스트를 나타낼 수 있고, 상기 현재 블록에 AMVP 모드가 적용된 경우, 상기 움직임 정보 후보 리스트는 MVP(motion vector predictor) 후보 리스트를 나타낼 수 있다. 상기 현재 블록에 스킵 모드 또는 머지 모드가 적용되는 경우, 인코딩 장치는 상기 현재 블록의 주변 블록들을 포함하는 움직임 정보 후보 리스트를 생성할 수 있고, 상기 현재 블록에 AMVP 모드가 적용되는 경우, 인코딩 장치는 상기 현재 블록의 주변 블록들의 움직임 벡터들을 기반으로 상기 움직임 정보 후보 리스트를 생성할 수 있다. 여기서, 상기 움직임 벡터들은 상기 움직임 정보 후보 리스트에 포함된 (MVP) 후보들로 도출될 수 있다.The encoding apparatus generates a motion information candidate list based on neighboring blocks of the current block (S1010). The encoding apparatus may generate a motion information candidate list based on neighboring blocks of the current block. When a skip or merge mode is applied to the current block, the motion information candidate list may indicate a merge candidate list. When the AMVP mode is applied to the current block, the motion information candidate list may include a motion vector predictor (MVP) candidate list Lt; / RTI > When a skip mode or merge mode is applied to the current block, the encoding apparatus can generate a motion information candidate list including neighboring blocks of the current block, and when the AMVP mode is applied to the current block, The motion information candidate list may be generated based on motion vectors of neighboring blocks of the current block. Here, the motion vectors may be derived as (MVP) candidates included in the motion information candidate list.
한편, 상기 현재 블록에 AMVP 모드가 적용되는 경우, 인코딩 장치는 상기 현재 블록의 주변 블록들의 움직임 벡터들을 기반으로 상기 움직임 정보 후보 리스트를 생성할 수 있는바, 상기 움직임 정보 후보 리스트는 2개의 후보들을 포함할 수 있다. 또는, 상기 움직임 정보 후보 리스트는 N개의 후보들을 포함할 수도 있다. Meanwhile, when the AMVP mode is applied to the current block, the encoding apparatus can generate the motion information candidate list based on motion vectors of neighboring blocks of the current block, and the motion information candidate list includes two candidates . Alternatively, the motion information candidate list may include N candidates.
한편, 상기 움직임 정보 후보 리스트는 상기 현재 블록의 수정된 후보를 포함할 수 있다. 인코딩 장치는 상기 현재 블록의 템플릿(template)을 기반으로 상기 수정된 후보를 도출할 수 있다. 상기 현재 블록의 템플릿은 상기 현재 블록의 주변 샘플들을 포함하는 특정 영역으로 나타낼 수 있다. 상기 템플릿은 상기 현재 블록의 좌측 주변 샘플들, 좌상측 주변 샘플 및 상측 주변 샘플들을 포함하는 특정 영역일 수 있다. 또는, 상기 템플릿은 상기 현재 블록의 상기 좌측 주변 샘플들 및 상기 상측 주변 샘플들을 포함하는 특정 영역일 수 있다. 또는, 상기 템플릿은 상기 현재 블록의 상기 상측 주변 샘플들을 포함하는 특정 영역일 수 있다. 또는, 상기 템플릿은 상기 현재 블록의 상기 좌측 주변 샘플들을 포함하는 특정 영역일 수 있다. 상기 현재 블록의 주변 샘플들을 기반으로 현재 블록의 템플릿(template)이 도출될 수 있고, 상기 현재 블록의 참조 픽처 내 참조 블록들 중 상기 현재 블록의 템플릿과의 코스트가 최소인 템플릿을 갖는 참조 블록이 특정 참조 블록으로 도출될 수 있고, 상기 특정 참조 블록을 가리키는 움직임 정보를 기반으로 상기 수정된 후보가 도출될 수 있다. 즉, 상기 수정된 후보는 상기 특정 참조 블록을 가리키는 움직임 벡터(또는 움직임 정보)를 나타낼 수 있다. 여기서, 상기 코스트는 상술한 수학식 1을 기반으로 결정될 수 있다. Meanwhile, the motion information candidate list may include modified candidates of the current block. The encoding apparatus may derive the modified candidate based on a template of the current block. The template of the current block may be represented as a specific region including surrounding samples of the current block. The template may be a specific region including left neighboring samples, upper left neighboring samples, and upper neighboring samples of the current block. Alternatively, the template may be a specific region including the left neighboring samples of the current block and the upper neighboring samples. Alternatively, the template may be a specific region including the upper neighbor samples of the current block. Alternatively, the template may be a specific region including the left neighboring samples of the current block. A template of a current block can be derived based on neighboring samples of the current block and a reference block having a template having a minimum cost from a template of the current block among the reference blocks in the reference block of the current block And the modified candidate may be derived based on the motion information indicating the specific reference block. That is, the modified candidate may represent a motion vector (or motion information) indicating the specific reference block. Here, the cost may be determined based on Equation (1).
인코딩 장치는 상기 움직임 정보 후보 리스트의 후보들을 갱신(update)하여 수정된(modified) 움직임 정보 후보 리스트를 생성한다(S1020). 인코딩 장치는 상기 움직임 정보 후보 리스트를 갱신하여 상기 수정된 움직임 정보 후보 리스트를 생성할 수 있다. The encoding apparatus updates the candidates of the motion information candidate list to generate a modified motion information candidate list (S1020). The encoding apparatus can update the motion information candidate list to generate the modified motion information candidate list.
일 예로, 인코딩 장치는 상기 현재 블록의 템플릿을 기반으로 상기 수정된 움직임 정보 후보 리스트를 생성할 수 있다. 구체적으로, 상기 현재 블록의 주변 샘플들을 기반으로 현재 블록의 템플릿이 도출될 수 있고, 상기 움직임 정보 후보 리스트의 후보들이 가리키는 참조 블록들의 템플릿들이 도출될 수 있다. 상기 현재 블록의 템플릿은 상술한 내용과 같이 상기 현재 블록의 주변 샘플들을 포함하는 특정 영역으로 나타낼 수 있다. 상기 참조 블록들의 템플릿들은 상기 현재 블록의 템플릿과 대응하는 특정 영역들을 나타낼 수 있다. 즉, 참조 블록들의 템플릿들 각각은 상기 현재 블록의 상기 주변 샘플들과 대응하는 참조 블록들의 주변 샘플들을 기반으로 도출될 수 있다. 상기 참조 블록들의 템플릿들은 상기 현재 블록의 템플릿과 동일한 형태를 가질 수 있다. 상기 참조 블록들의 템플릿들 및 상기 현재 블록의 템플릿을 기반으로 상기 후보들의 코스트들이 도출될 수 있다. 상기 코스트는 상술한 수학식 1을 기반으로 결정될 수 있다. 상기 후보들의 코스트들을 기반으로 상기 움직임 정보 후보 리스트의 후보들의 순서가 갱신될 수 있다. 즉, 코스트가 작은 순으로 상기 움직임 정보 후보 리스트의 후보들의 순서가 갱신되어 상기 수정된 움직임 정보 후보 리스트가 생성될 수 있다. 다시 말해, 상기 수정된 움직임 정보 후보 리스트는 상기 후보들 중 가장 작은 코스트를 갖는 후보에서 가장 큰 코스트를 갖는 후보 순서로 정렬되어 생성될 수 있다. For example, the encoding apparatus may generate the modified motion information candidate list based on the template of the current block. Specifically, the template of the current block can be derived based on the surrounding samples of the current block, and the templates of the reference blocks indicated by the candidates of the motion information candidate list can be derived. The template of the current block may be represented as a specific region including surrounding samples of the current block as described above. The templates of the reference blocks may represent specific regions corresponding to the template of the current block. That is, each of the templates of the reference blocks may be derived based on the surrounding samples of the neighboring samples and the corresponding reference blocks of the current block. The templates of the reference blocks may have the same shape as the template of the current block. The costs of the candidates may be derived based on the templates of the reference blocks and the template of the current block. The cost may be determined based on Equation (1). The order of the candidates of the motion information candidate list may be updated based on the costs of the candidates. That is, the order of the candidates of the motion information candidate list is updated in the order of smaller cost, and the modified motion information candidate list can be generated. In other words, the modified motion information candidate list can be generated by arranging in the candidate order having the largest cost in the candidate having the smallest cost among the candidates.
또는, 상기 움직임 정보 후보 리스트가 N개의 후보들을 포함하는 경우, 상기 후보들은 가장 작은 코스트를 갖는 후보에서 가장 큰 코스트를 갖는 후보 순서로 정렬될 수 있고, 상기 정렬된 후보들 중 첫번째 후보 및 두번째 후보를 기반으로 상기 수정된 움직임 정보 후보 리스트가 생성될 수 있다. 즉, 상기 갱신된 순서에서 첫번째 후보 및 두번째 후보를 기반으로 상기 수정된 움직임 정보 후보 리스트가 생성될 수 있다. Alternatively, when the motion information candidate list includes N candidates, the candidates may be sorted in the candidate order having the largest cost in the candidate having the smallest cost, and the first candidate and the second candidate in the sorted candidate The modified motion information candidate list can be generated. That is, the modified motion information candidate list may be generated based on the first candidate and the second candidate in the updated order.
다른 일 예로, 인코딩 장치는 상기 움직임 정보 후보 리스트의 후보들이 나타내는 움직임 벡터들의 방향을 기반으로 상기 수정된 움직임 정보 후보 리스트를 생성할 수 있다. 구체적으로, 상기 움직임 정보 후보 리스트의 첫번째 후보가 나타내는 움직임 벡터 및 나머지 후보들이 나타내는 움직임 벡터들의 방향을 기반으로 상기 나머지 후보들 각각의 우선 순위가 도출될 수 있고, 상기 나머지 후보들의 상기 각 후보의 우선 순위를 기반으로 상기 움직임 정보 후보 리스트가 갱신되어 상기 수정된 움직임 정보 후보 리스트가 생성될 수 있다. 여기서, 상기 나머지 후보들은 상기 움직임 정보 후보 리스트의 후보들 중 상기 첫번째 후보 이외의 후보들을 나타낼 수 있다. In another example, the encoding apparatus may generate the modified motion information candidate list based on the directions of the motion vectors indicated by the candidates of the motion information candidate list. Specifically, the priority of each of the remaining candidates may be derived based on a motion vector represented by the first candidate of the motion information candidate list and the motion vectors represented by the remaining candidates, and the priority of each candidate of the remaining candidates The motion information candidate list is updated based on the motion information candidate list, and the modified motion information candidate list is generated. Here, the remaining candidates may represent candidates other than the first candidate among the candidates of the motion information candidate list.
상기 나머지 후보들의 각 후보의 우선 순위는 다음과 같이 도출될 수 있다. 상기 첫번째 후보가 나타내는 움직임 벡터와 상기 각 후보가 나타내는 움직임 벡터의 x성분 방향 및 y성분 방향이 모두 다른 경우, 상기 각 후보의 우선 순위는 가장 높은 우선 순위로 도출될 수 있다. 또한, 상기 첫번째 후보가 나타내는 움직임 벡터와 상기 각 후보가 나타내는 움직임 벡터의 x성분 방향 및 y성분 방향 중 하나의 방향이 다른 경우, 상기 각 후보의 우선 순위는 중간 우선 순위로 도출될 수 있다. 또한, 상기 첫번째 후보가 나타내는 움직임 벡터와 상기 각 후보가 나타내는 움직임 벡터의 x성분 방향 및 y성분 방향이 모두 같은 경우, 상기 각 후보의 우선 순위는 가장 낮은 우선 순위로 도출될 수 있다. 여기서, 상기 첫번째 후보가 나타내는 움직임 벡터의 x성분과 상기 각 후보가 나타내는 움직임 벡터의 x성분을 곱한 값이 0보다 작은 경우, 상기 첫번째 후보가 나타내는 움직임 벡터와 상기 각 후보가 나타내는 움직임 벡터의 x성분 방향은 다를 수 있고, 상기 첫번째 후보가 나타내는 움직임 벡터의 x성분과 상기 각 후보가 나타내는 움직임 벡터의 x성분을 곱한 값이 0보다 큰 경우, 상기 첫번째 후보가 나타내는 움직임 벡터와 상기 각 후보가 나타내는 움직임 벡터의 x성분 방향은 같을 수 있다. 또한, 상기 첫번째 후보가 나타내는 움직임 벡터의 y성분과 상기 각 후보가 나타내는 움직임 벡터의 y성분을 곱한 값이 0보다 작은 경우, 상기 첫번째 후보가 나타내는 움직임 벡터와 상기 각 후보가 나타내는 움직임 벡터의 y성분 방향은 다를 수 있고, 상기 첫번째 후보가 나타내는 움직임 벡터의 y성분과 상기 각 후보가 나타내는 움직임 벡터의 y성분을 곱한 값이 0보다 큰 경우, 상기 첫번째 후보가 나타내는 움직임 벡터와 상기 각 후보가 나타내는 움직임 벡터의 y성분 방향은 같을 수 있다. 따라서, 상기 첫번째 후보가 나타내는 움직임 벡터의 x성분과 상기 각 후보가 나타내는 움직임 벡터의 x성분을 곱한 값이 0보다 작고, 상기 첫번째 후보가 나타내는 움직임 벡터의 y성분과 상기 각 후보가 나타내는 움직임 벡터의 y성분을 곱한 값이 0보다 작은 경우, 상기 각 후보의 우선 순위는 가장 높은 우선 순위로 도출될 수 있다. 또한, 상기 첫번째 후보가 나타내는 움직임 벡터의 x성분과 상기 각 후보가 나타내는 움직임 벡터의 x성분을 곱한 값이 0보다 작고, 상기 첫번째 후보가 나타내는 움직임 벡터의 y성분과 상기 각 후보가 나타내는 움직임 벡터의 y성분을 곱한 값이 0보다 큰 경우, 상기 각 후보의 우선 순위는 중간 우선 순위로 도출될 수 있다. 또한, 상기 첫번째 후보가 나타내는 움직임 벡터의 x성분과 상기 각 후보가 나타내는 움직임 벡터의 x성분을 곱한 값이 0보다 크고, 상기 첫번째 후보가 나타내는 움직임 벡터의 y성분과 상기 각 후보가 나타내는 움직임 벡터의 y성분을 곱한 값이 0보다 작은 경우, 상기 각 후보의 우선 순위는 중간 우선 순위로 도출될 수 있다. 또한, 상기 첫번째 후보가 나타내는 움직임 벡터의 x성분과 상기 각 후보가 나타내는 움직임 벡터의 x성분을 곱한 값이 0보다 크고, 상기 첫번째 후보가 나타내는 움직임 벡터의 y성분과 상기 각 후보가 나타내는 움직임 벡터의 y성분을 곱한 값이 0보다 큰 경우, 상기 각 후보의 우선 순위는 가장 낮은 우선 순위로 도출될 수 있다.The priority of each candidate of the remaining candidates can be derived as follows. If the x-component direction and the y-component direction of the motion vector represented by the first candidate and the motion vector represented by the candidate are all different, the priority of each candidate can be derived with the highest priority. When the direction of one of the x component direction and the y component direction of the motion vector indicated by the first candidate and the motion vector indicated by the candidate is different, the priority of each candidate may be derived as a medium priority. In addition, when the x-component direction and the y-component direction of the motion vector represented by the first candidate and the motion vector represented by the candidate are all the same, the priority of each candidate can be derived with the lowest priority. Here, when the value obtained by multiplying the x component of the motion vector represented by the first candidate by the x component of the motion vector represented by the candidate is less than 0, the motion vector represented by the first candidate and the x component And when the value obtained by multiplying the x component of the motion vector represented by the first candidate by the x component of the motion vector represented by the candidate is greater than 0, the motion vector represented by the first candidate and the motion represented by each candidate The x component direction of the vector may be the same. When a value obtained by multiplying the y component of the motion vector represented by the first candidate by the y component of the motion vector represented by the candidate is less than 0, the motion vector represented by the first candidate and the y component And a motion vector represented by the first candidate is multiplied by a y component of a motion vector represented by each candidate is greater than 0, a motion vector represented by the first candidate and a motion represented by each candidate The y component direction of the vector may be the same. Therefore, when the value obtained by multiplying the x component of the motion vector represented by the first candidate by the x component of the motion vector represented by the candidate is smaller than 0, and the y component of the motion vector represented by the first candidate and the motion vector represented by each candidate If the value obtained by multiplying the y component is smaller than 0, the priority of each candidate can be derived with the highest priority. A value obtained by multiplying the x component of the motion vector represented by the first candidate by the x component of the motion vector represented by the candidate is smaller than 0 and the y component of the motion vector represented by the first candidate and the motion vector represented by each candidate If the value obtained by multiplying the y component is greater than 0, the priority of each candidate can be derived as a medium priority. The value of the x component of the motion vector represented by the first candidate multiplied by the x component of the motion vector represented by the candidate is greater than 0 and the y component of the motion vector represented by the first candidate and the motion vector represented by each candidate If the value obtained by multiplying the y component is smaller than 0, the priority of each candidate can be derived as a medium priority. The value of the x component of the motion vector represented by the first candidate multiplied by the x component of the motion vector represented by the candidate is greater than 0 and the y component of the motion vector represented by the first candidate and the motion vector represented by each candidate If the value obtained by multiplying the y component is greater than 0, the priority of each candidate can be derived with the lowest priority.
상기 나머지 후보들의 각 후보의 우선 순위를 기반으로 상기 움직임 정보 후보 리스트의 후보들의 순서가 갱신될 수 있다. 즉, 가장 높은 우선 순위의 후보에서 가장 낮은 우선 순위의 후보 순으로 상기 나머지 후보들의 순서가 갱신되어 상기 수정된 움직임 정보 후보 리스트가 생성될 수 있다. 즉, 우선 순위가 높은 순으로 상기 나머지 후보들의 순서가 갱신되어 상기 수정된 움직임 정보 후보 리스트가 생성될 수 있다. 다시 말해, 상기 수정된 움직임 정보 후보 리스트는 상기 첫번째 후보 다음으로 가장 높은 우선 순위의 후보에서 가장 낮은 우선 순위의 후보 순서로 정렬되어 생성될 수 있다. The order of the candidates of the motion information candidate list may be updated based on the priority of each candidate of the remaining candidates. That is, the order of the remaining candidates may be updated in the order of the highest-priority candidate to the lowest-priority candidate, and the modified motion information candidate list may be generated. That is, the order of the remaining candidates may be updated in descending order of priority, and the modified motion information candidate list may be generated. In other words, the modified motion information candidate list may be generated in the order of the highest priority candidate to the lowest priority candidate next to the first candidate.
또는, 상기 움직임 정보 후보 리스트가 N개의 후보들을 포함하는 경우, 상기 후보들은 가장 높은 우선 순위의 후보에서 가장 낮은 우선 순위의 후보 순서로 정렬될 수 있고, 상기 정렬된 후보들 중 첫번째 후보 및 두번째 후보를 기반으로 상기 수정된 움직임 정보 후보 리스트가 생성될 수 있다. 즉, 상기 갱신된 순서에서 첫번째 후보 및 두번째 후보를 기반으로 상기 수정된 움직임 정보 후보 리스트가 생성될 수 있다. Alternatively, when the motion information candidate list includes N candidates, the candidates may be sorted in order of the highest priority candidate to the lowest priority candidate, and the first candidate and the second candidate of the aligned candidates The modified motion information candidate list can be generated. That is, the modified motion information candidate list may be generated based on the first candidate and the second candidate in the updated order.
다른 일 예로, 인코딩 장치는 상기 현재 블록의 템플릿 및 상기 움직임 정보 후보 리스트의 후보들이 나타내는 움직임 벡터들의 방향을 기반으로 상기 수정된 움직임 정보 후보 리스트를 생성할 수 있다. 구체적으로, 상기 현재 블록의 주변 샘플들을 기반으로 상기 현재 블록의 템플릿이 도출될 수 있고, 상기 움직임 정보 후보 리스트의 후보들이 가리키는 참조 블록들의 템플릿들이 도출될 수 있고, 상기 참조 블록들의 템플릿들 및 상기 현재 블록의 템플릿을 기반으로 상기 후보들의 코스트들이 도출될 수 있다. 상기 코스트는 상술한 수학식 1을 기반으로 결정될 수 있다. 상기 후보들의 코스트들을 기반으로 상기 움직임 정보 후보 리스트의 후보들의 순서가 갱신되어 제1 움직임 정보 후보 리스트가 생성될 수 있다. 즉, 코스트가 작은 순으로 상기 움직임 정보 후보 리스트의 후보들의 순서가 갱신되어 상기 제1 움직임 정보 후보 리스트가 생성될 수 있다. 다시 말해, 상기 제1 움직임 정보 후보 리스트는 상기 후보들 중 가장 작은 코스트를 갖는 후보에서 가장 큰 코스트를 갖는 후보 순서로 정렬되어 생성될 수 있다. In another example, the encoding apparatus may generate the modified motion information candidate list based on the template of the current block and the directions of the motion vectors indicated by the candidates of the motion information candidate list. Specifically, the template of the current block can be derived based on the neighboring samples of the current block, the templates of the reference blocks indicated by the candidates of the motion information candidate list can be derived, The costs of the candidates can be derived based on the template of the current block. The cost may be determined based on Equation (1). The order of the candidates of the motion information candidate list is updated based on the costs of the candidates so that the first motion information candidate list can be generated. That is, the order of the candidates of the motion information candidate list is updated in the order of smaller cost so that the first motion information candidate list can be generated. In other words, the first motion information candidate list may be generated by arranging in the candidate order having the largest cost in the candidate having the smallest cost among the candidates.
상기 제1 움직임 정보 후보 리스트가 생성된 경우, 상기 제1 움직임 정보 후보 리스트의 첫번째 후보 및 나머지 후보들이 나타내는 움직임 벡터들의 방향을 기반으로 상기 나머지 후보들의 각 후보의 우선 순위가 도출될 수 있고, 상기 나머지 후보들의 상기 각 후보의 우선 순위를 기반으로 상기 제1 움직임 정보 후보 리스트가 갱신되어 상기 수정된 움직임 정보 후보 리스트가 생성될 수 있다. 여기서, 상기 나머지 후보들은 상기 제1 움직임 정보 후보 리스트의 후보들 중 상기 첫번째 후보 이외의 후보들을 나타낼 수 있다. When the first motion information candidate list is generated, the priority of each candidate of the remaining candidates can be derived based on the directions of the motion vectors indicated by the first candidate and the remaining candidates of the first motion information candidate list, The first motion information candidate list is updated based on the priorities of the candidates of the remaining candidates so that the modified motion information candidate list can be generated. Here, the remaining candidates may represent candidates other than the first candidate among the candidates of the first motion information candidate list.
상기 나머지 후보들의 각 후보의 우선 순위는 다음과 같이 도출될 수 있다. 상기 첫번째 후보가 나타내는 움직임 벡터와 상기 각 후보가 나타내는 움직임 벡터의 x성분 방향 및 y성분 방향이 모두 다른 경우, 상기 각 후보의 우선 순위는 가장 높은 우선 순위로 도출될 수 있다. 또한, 상기 첫번째 후보가 나타내는 움직임 벡터와 상기 각 후보가 나타내는 움직임 벡터의 x성분 방향 및 y성분 방향 중 하나의 방향이 다른 경우, 상기 각 후보의 우선 순위는 중간 우선 순위로 도출될 수 있다. 또한, 상기 첫번째 후보가 나타내는 움직임 벡터와 상기 각 후보가 나타내는 움직임 벡터의 x성분 방향 및 y성분 방향이 모두 같은 경우, 상기 각 후보의 우선 순위는 가장 낮은 우선 순위로 도출될 수 있다. 여기서, 상기 첫번째 후보가 나타내는 움직임 벡터의 x성분과 상기 각 후보가 나타내는 움직임 벡터의 x성분을 곱한 값이 0보다 작은 경우, 상기 첫번째 후보가 나타내는 움직임 벡터와 상기 각 후보가 나타내는 움직임 벡터의 x성분 방향은 다를 수 있고, 상기 첫번째 후보가 나타내는 움직임 벡터의 x성분과 상기 각 후보가 나타내는 움직임 벡터의 x성분을 곱한 값이 0보다 큰 경우, 상기 첫번째 후보가 나타내는 움직임 벡터와 상기 각 후보가 나타내는 움직임 벡터의 x성분 방향은 같을 수 있다. 또한, 상기 첫번째 후보가 나타내는 움직임 벡터의 y성분과 상기 각 후보가 나타내는 움직임 벡터의 y성분을 곱한 값이 0보다 작은 경우, 상기 첫번째 후보가 나타내는 움직임 벡터와 상기 각 후보가 나타내는 움직임 벡터의 y성분 방향은 다를 수 있고, 상기 첫번째 후보가 나타내는 움직임 벡터의 y성분과 상기 각 후보가 나타내는 움직임 벡터의 y성분을 곱한 값이 0보다 큰 경우, 상기 첫번째 후보가 나타내는 움직임 벡터와 상기 각 후보가 나타내는 움직임 벡터의 y성분 방향은 같을 수 있다. 따라서, 상기 첫번째 후보가 나타내는 움직임 벡터의 x성분과 상기 각 후보가 나타내는 움직임 벡터의 x성분을 곱한 값이 0보다 작고, 상기 첫번째 후보가 나타내는 움직임 벡터의 y성분과 상기 각 후보가 나타내는 움직임 벡터의 y성분을 곱한 값이 0보다 작은 경우, 상기 각 후보의 우선 순위는 가장 높은 우선 순위로 도출될 수 있다. 또한, 상기 첫번째 후보가 나타내는 움직임 벡터의 x성분과 상기 각 후보가 나타내는 움직임 벡터의 x성분을 곱한 값이 0보다 작고, 상기 첫번째 후보가 나타내는 움직임 벡터의 y성분과 상기 각 후보가 나타내는 움직임 벡터의 y성분을 곱한 값이 0보다 큰 경우, 상기 각 후보의 우선 순위는 중간 우선 순위로 도출될 수 있다. 또한, 상기 첫번째 후보가 나타내는 움직임 벡터의 x성분과 상기 각 후보가 나타내는 움직임 벡터의 x성분을 곱한 값이 0보다 크고, 상기 첫번째 후보가 나타내는 움직임 벡터의 y성분과 상기 각 후보가 나타내는 움직임 벡터의 y성분을 곱한 값이 0보다 작은 경우, 상기 각 후보의 우선 순위는 중간 우선 순위로 도출될 수 있다. 또한, 상기 첫번째 후보가 나타내는 움직임 벡터의 x성분과 상기 각 후보가 나타내는 움직임 벡터의 x성분을 곱한 값이 0보다 크고, 상기 첫번째 후보가 나타내는 움직임 벡터의 y성분과 상기 각 후보가 나타내는 움직임 벡터의 y성분을 곱한 값이 0보다 큰 경우, 상기 각 후보의 우선 순위는 가장 낮은 우선 순위로 도출될 수 있다.The priority of each candidate of the remaining candidates can be derived as follows. If the x-component direction and the y-component direction of the motion vector represented by the first candidate and the motion vector represented by the candidate are all different, the priority of each candidate can be derived with the highest priority. When the direction of one of the x component direction and the y component direction of the motion vector indicated by the first candidate and the motion vector indicated by the candidate is different, the priority of each candidate may be derived as a medium priority. In addition, when the x-component direction and the y-component direction of the motion vector represented by the first candidate and the motion vector represented by the candidate are all the same, the priority of each candidate can be derived with the lowest priority. Here, when the value obtained by multiplying the x component of the motion vector represented by the first candidate by the x component of the motion vector represented by the candidate is less than 0, the motion vector represented by the first candidate and the x component And when the value obtained by multiplying the x component of the motion vector represented by the first candidate by the x component of the motion vector represented by the candidate is greater than 0, the motion vector represented by the first candidate and the motion represented by each candidate The x component direction of the vector may be the same. When a value obtained by multiplying the y component of the motion vector represented by the first candidate by the y component of the motion vector represented by the candidate is less than 0, the motion vector represented by the first candidate and the y component And a motion vector represented by the first candidate is multiplied by a y component of a motion vector represented by each candidate is greater than 0, a motion vector represented by the first candidate and a motion represented by each candidate The y component direction of the vector may be the same. Therefore, when the value obtained by multiplying the x component of the motion vector represented by the first candidate by the x component of the motion vector represented by the candidate is smaller than 0, and the y component of the motion vector represented by the first candidate and the motion vector represented by each candidate If the value obtained by multiplying the y component is smaller than 0, the priority of each candidate can be derived with the highest priority. A value obtained by multiplying the x component of the motion vector represented by the first candidate by the x component of the motion vector represented by the candidate is smaller than 0 and the y component of the motion vector represented by the first candidate and the motion vector represented by each candidate If the value obtained by multiplying the y component is greater than 0, the priority of each candidate can be derived as a medium priority. The value of the x component of the motion vector represented by the first candidate multiplied by the x component of the motion vector represented by the candidate is greater than 0 and the y component of the motion vector represented by the first candidate and the motion vector represented by each candidate If the value obtained by multiplying the y component is smaller than 0, the priority of each candidate can be derived as a medium priority. The value of the x component of the motion vector represented by the first candidate multiplied by the x component of the motion vector represented by the candidate is greater than 0 and the y component of the motion vector represented by the first candidate and the motion vector represented by each candidate If the value obtained by multiplying the y component is greater than 0, the priority of each candidate can be derived with the lowest priority.
상기 나머지 후보들의 각 후보의 우선 순위를 기반으로 상기 제1 움직임 정보 후보 리스트의 후보들의 순서가 갱신될 수 있다. 즉, 가장 높은 우선 순위의 후보에서 가장 낮은 우선 순위의 후보 순으로 상기 나머지 후보들의 순서가 갱신되어 상기 수정된 움직임 정보 후보 리스트가 생성될 수 있다. 즉, 우선 순위가 높은 순으로 상기 나머지 후보들의 순서가 갱신되어 상기 수정된 움직임 정보 후보 리스트가 생성될 수 있다. 다시 말해, 상기 수정된 움직임 정보 후보 리스트는 상기 첫번째 후보 다음으로 가장 높은 우선 순위의 후보에서 가장 낮은 우선 순위의 후보 순서로 정렬되어 생성될 수 있다. 또는, 상기 제1 움직임 정보 후보 리스트의 후보들은 상기 첫번째 후보 다음으로 가장 높은 우선 순위의 후보에서 가장 낮은 우선 순위의 후보 순서로 정렬될 수 있고, 상기 정렬된 후보들 중 첫번째 후보 및 두번째 후보를 기반으로 상기 수정된 움직임 정보 후보 리스트가 생성될 수 있다. 즉, 상기 갱신된 순서에서 첫번째 후보 및 두번째 후보를 기반으로 상기 수정된 움직임 정보 후보 리스트가 생성될 수 있다. The order of the candidates of the first motion information candidate list may be updated based on the priority of each candidate of the remaining candidates. That is, the order of the remaining candidates may be updated in the order of the highest-priority candidate to the lowest-priority candidate, and the modified motion information candidate list may be generated. That is, the order of the remaining candidates may be updated in descending order of priority, and the modified motion information candidate list may be generated. In other words, the modified motion information candidate list may be generated in the order of the highest priority candidate to the lowest priority candidate next to the first candidate. Alternatively, the candidates of the first motion information candidate list may be sorted in order of the highest priority candidate to the lowest priority candidate next to the first candidate, and based on the first candidate and the second candidate of the aligned candidates The modified motion information candidate list can be generated. That is, the modified motion information candidate list may be generated based on the first candidate and the second candidate in the updated order.
인코딩 장치는 상기 현재 블록의 인터 예측에 대한 정보를 인코딩하여 출력한다(S1030). 상기 현재 블록에 머지 모드가 적용된 경우, 인코딩 장치는 상기 현재 블록의 움직임 정보를 도출하기 위하여 선택된 머지 후보를 가리키는 머지 인덱스를 생성할 수 있다. 인코딩 장치는 상기 머지 인덱스를 인코딩하여 출력할 수 있다. 상기 머지 인덱스는 상기 인터 예측에 대한 정보에 포함될 수 있다. The encoding apparatus encodes information on the inter prediction of the current block and outputs the encoded information (S1030). When a merge mode is applied to the current block, the encoding apparatus can generate a merge index indicating a merge candidate selected to derive the motion information of the current block. The encoding apparatus can encode and output the merge index. The merge index may be included in the information on the inter prediction.
상기 현재 블록에 AMVP 모드가 적용되는 경우, 상기 인터 예측에 대한 정보는 상기 현재 블록의 움직임 정보에 관련한 정보를 포함할 수 있다. 구체적으로, 상기 인터 예측에 대한 정보는 상기 현재 블록의 L0 참조 픽처 인덱스 및 L1 참조 픽처 인덱스가 포함될 수 있고, MVPL0(motion vector predictor L0, MVPL0) 및 MVPL1(motion vector predictor L1, MVPL1)이 포함될 수 있다. 또한, 상기 인터 예측에 대한 정보는 MVDL0(motion vector difference L0, MVDL0) 및 MVDL1(motion vector difference L1, MVDL1)이 포함될 수 있다.When the AMVP mode is applied to the current block, the information on the inter prediction may include information on motion information of the current block. More specifically, the inter prediction information may include the L0 reference picture index and the L1 reference picture index of the current block, and MVPL0 (motion vector predictor L0, MVPL0) and MVPL1 (motion vector predictor L1, MVPL1) have. In addition, the information on the inter prediction may include MVDL0 (motion vector difference L0, MVDL0) and MVDL1 (motion vector difference L1, MVDL1).
또한, 상기 현재 블록에 AMVP 모드가 적용되는 경우, 상기 인터 예측에 대한 정보는 상기 현재 블록의 움직임 정보에 관련한 정보를 포함할 수 있다. 구체적으로, 상기 인터 예측에 대한 정보는 상기 움직임 정보 후보 리스트(또는 수정된 움직임 정보 후보 리스트)에 포함된 후보들 중 하나를 가리키는 MVP 플래그 및 상기 MVP 플래그가 가리키는 후보의 움직임 벡터(MVP 후보)와 상기 현재 블록의 움직임 벡터 차분(motion vector difference, MVD)을 포함할 수 있다. In addition, when the AMVP mode is applied to the current block, the information on the inter prediction may include information on motion information of the current block. More specifically, the information on the inter prediction includes an MVP flag indicating one of the candidates included in the motion information candidate list (or the modified motion information candidate list), a motion vector of a candidate pointed to by the MVP flag (MVP candidate) And a motion vector difference (MVD) of the current block.
한편, 비록 도면에서 도시되지는 않았으나 상기 움직임 정보가 생성되는 경우, 상기 움직임 정보를 기반으로 상기 현재 블록의 예측이 수행될 수 있고, 상기 움직임 정보가 저장될 수 있다. 상기 움직임 정보는 상기 현재 블록의 디코딩 과정 이후에 디코딩되는 주변 블록 또는 다른 픽처에 포함되는 블록의 움직임 정보를 위하여 사용될 수 있다. 예를 들어, 상기 현재 블록의 디코딩 과정 이후에 디코딩되는 주변 블록에 머지 모드가 적용되는 경우, 상기 주변 블록의 머지 후보 리스트는 상기 움직임 정보를 나타내는 상기 현재 블록을 포함할 수 있다. 또한, 상기 주변 블록에 AMVP 모드가 적용되는 경우, 상기 움직임 정보는 MVP 후보로 상기 주변 블록의 MVP 후보 리스트에 포함될 수 있다. Although not shown in the figure, when the motion information is generated, the current block may be predicted based on the motion information, and the motion information may be stored. The motion information may be used for motion information of a block included in a neighboring block or another picture to be decoded after the decoding of the current block. For example, when a merge mode is applied to a neighboring block to be decoded after the decoding process of the current block, the merge candidate list of the neighboring blocks may include the current block indicating the motion information. Also, when the AMVP mode is applied to the neighboring blocks, the motion information may be included in the MVP candidate list of the neighboring blocks as MVP candidates.
또한, 인코딩 장치는 상기 움직임 정보를 기반으로 예측 샘플을 생성할 수 있다. 인코딩 장치는 원본 샘플과 상기 생성된 예측 샘플을 기반으로 레지듀얼(residual) 샘플을 생성할 수 있다. 인코딩 장치는 상기 레지듀얼 샘플을 기반으로 상기 레지듀얼에 관한 정보를 생성할 수 있다. 상기 레지듀얼에 관한 정보는 상기 레지듀얼 샘플에 관한 변환 계수들을 포함할 수 있다. 인코딩 장치는 상기 예측 샘플과 상기 레지듀얼 샘플을 기반으로 상기 복원 샘플을 도출할 수 있다. 즉, 인코딩 장치는 상기 예측 샘플과 상기 레지듀얼 샘플을 더하여 상기 복원 샘플을 도출할 수 있다. 또한, 인코딩 장치는 상기 레지듀얼에 관한 정보를 인코딩하여 비트스트림 형태로 출력할 수 있다. 상기 비트스트림은 네트워크 또는 저장매체를 통하여 디코딩 장치로 전송될 수 있다.In addition, the encoding apparatus can generate a prediction sample based on the motion information. The encoding apparatus may generate a residual sample based on the original sample and the generated prediction sample. The encoding apparatus may generate information on the residual based on the residual samples. The information on the residual may include transform coefficients relating to the residual sample. The encoding apparatus may derive the reconstructed sample based on the prediction sample and the residual sample. That is, the encoding apparatus may add the prediction sample and the residual sample to derive the reconstructed sample. Also, the encoding apparatus can encode the information on the residual and output it in the form of a bit stream. The bitstream may be transmitted to a decoding device via a network or a storage medium.
도 11은 본 발명에 따른 디코딩 장치에 의한 비디오 디코딩 방법을 개략적으로 나타낸다. 도 11에서 개시된 방법은 도 2에서 개시된 디코딩 장치에 의하여 수행될 수 있다. 구체적으로 예를 들어, 도 11의 S1100은 상기 디코딩 장치의 엔트로피 디코딩부에 의하여 수행될 수 있고, S1110 내지 S1140은 상기 디코딩 장치의 예측부에 의하여 수행될 수 있다.11 schematically shows a video decoding method by a decoding apparatus according to the present invention. The method disclosed in Fig. 11 can be performed by the decoding apparatus disclosed in Fig. Specifically, for example, S1100 of FIG. 11 may be performed by the entropy decoding unit of the decoding apparatus, and S1110 to S1140 may be performed by the predicting unit of the decoding apparatus.
디코딩 장치는 비트스트림을 통하여 현재 블록의 인터 예측에 대한 정보를 획득한다(S1100). 상기 현재 블록은 인터 예측 또는 인트라 예측이 적용될 수 있다. 상기 현재 블록에 인터 예측이 적용되는 경우, 디코딩 장치는 상기 비트스트림을 통하여 상기 현재 블록의 인터 예측에 대한 정보를 획득할 수 있다. The decoding apparatus obtains information on inter prediction of a current block through a bit stream (S1100). The current block may be inter-predicted or intra-predicted. When inter prediction is applied to the current block, the decoding apparatus can acquire information on the inter prediction of the current block through the bit stream.
예를 들어, 상기 현재 블록에 머지 모드가 적용된 경우, 디코딩 장치는 상기 현재 블록의 주변 블록을 기반으로 머지 후보 리스트를 생성할 수 있고, 비트스트림을 통하여 머지 인덱스를 획득할 수 있다. 상기 머지 인덱스는 상기 머지 후보 리스트에 포함된 머지 후보를 가리킬 수 있고, 상기 인터 예측에 대한 정보는 상기 머지 인덱스를 포함할 수 있다. For example, when the merge mode is applied to the current block, the decoding apparatus can generate the merge candidate list based on the neighboring blocks of the current block, and obtain the merge index through the bit stream. The merge index may indicate a merge candidate included in the merge candidate list, and the information on the inter prediction may include the merge index.
또한, 상기 현재 블록에 AMVP 모드가 적용되는 경우, 상기 인터 예측에 대한 정보는 상기 현재 블록의 움직임 정보에 관련한 정보를 포함할 수 있다. 구체적으로, 상기 인터 예측에 대한 정보는 상기 움직임 정보 후보 리스트(또는 수정된 움직임 정보 후보 리스트)에 포함된 후보들 중 하나를 가리키는 MVP 플래그 및 상기 MVP 플래그가 가리키는 후보의 움직임 벡터(MVP 후보)와 상기 현재 블록의 움직임 벡터 차분(motion vector difference, MVD)을 포함할 수 있다. 디코딩 장치는 상기 MVP 플래그가 가리키는 후보가 나타내는 움직임 벡터(MVP 후보) 및 상기 MVD를 기반으로 상기 현재 블록의 상기 움직임 정보를 도출할 수 있다.In addition, when the AMVP mode is applied to the current block, the information on the inter prediction may include information on motion information of the current block. More specifically, the information on the inter prediction includes an MVP flag indicating one of the candidates included in the motion information candidate list (or the modified motion information candidate list), a motion vector of a candidate pointed to by the MVP flag (MVP candidate) And a motion vector difference (MVD) of the current block. The decoding apparatus may derive the motion information of the current block based on the MVP candidate indicated by the candidate indicated by the MVP flag and the MVD.
또한, 상기 인터 예측에 대한 정보는 상기 현재 블록의 L0 참조 픽처 인덱스 및/또는 L1 참조 픽처 인덱스가 포함될 수 있고, MVDL0(motion vector difference L0, MVDL0) 및/또는 MVDL1(motion vector difference L1, MVDL1)이 포함될 수 있다.The inter-prediction information may include the L0 reference picture index and / or the L1 reference picture index of the current block, and MVDL0 (motion vector difference L0, MVDL0) and / or MVDL1 (motion vector difference L1, MVDL1) May be included.
디코딩 장치는 상기 현재 블록의 주변 블록들을 기반으로 움직임 정보 후보 리스트를 생성한다(S1110). 디코딩 장치는 상기 현재 블록의 주변 블록들을 기반으로 움직임 정보 후보 리스트를 생성할 수 있다. 상기 현재 블록에 스킵 또는 머지 모드가 적용된 경우, 상기 움직임 정보 후보 리스트는 머지 후보 리스트를 나타낼 수 있고, 상기 현재 블록에 AMVP 모드가 적용된 경우, 상기 움직임 정보 후보 리스트는 MVP(motion vector predictor) 후보 리스트를 나타낼 수 있다. 상기 현재 블록에 스킵 모드 또는 머지 모드가 적용되는 경우, 디코딩 장치는 상기 현재 블록의 주변 블록들을 포함하는 움직임 정보 후보 리스트를 생성할 수 있고, 상기 현재 블록에 AMVP 모드가 적용되는 경우, 디코딩 장치는 상기 현재 블록의 주변 블록들의 움직임 벡터들을 기반으로 상기 움직임 정보 후보 리스트를 생성할 수 있다. 여기서, 상기 움직임 벡터들은 상기 움직임 정보 후보 리스트에 포함된 (MVP) 후보들로 도출될 수 있다.The decoding apparatus generates a motion information candidate list based on the neighboring blocks of the current block (S1110). The decoding apparatus can generate a motion information candidate list based on the neighboring blocks of the current block. When a skip or merge mode is applied to the current block, the motion information candidate list may indicate a merge candidate list. When the AMVP mode is applied to the current block, the motion information candidate list may include a motion vector predictor (MVP) candidate list Lt; / RTI > When a skip mode or a merge mode is applied to the current block, the decoding apparatus can generate a motion information candidate list including neighboring blocks of the current block, and when the AMVP mode is applied to the current block, The motion information candidate list may be generated based on motion vectors of neighboring blocks of the current block. Here, the motion vectors may be derived as (MVP) candidates included in the motion information candidate list.
한편, 상기 현재 블록에 AMVP 모드가 적용되는 경우, 디코딩 장치는 상기 현재 블록의 주변 블록들의 움직임 벡터들을 기반으로 상기 움직임 정보 후보 리스트를 생성할 수 있는바, 상기 움직임 정보 후보 리스트는 2개의 후보들을 포함할 수 있다. 또는, 상기 움직임 정보 후보 리스트는 N개의 후보들을 포함할 수도 있다. Meanwhile, when the AMVP mode is applied to the current block, the decoding apparatus can generate the motion information candidate list based on motion vectors of neighboring blocks of the current block, and the motion information candidate list includes two candidates . Alternatively, the motion information candidate list may include N candidates.
한편, 상기 움직임 정보 후보 리스트는 상기 현재 블록의 수정된 후보를 포함할 수 있다. 디코딩 장치는 상기 현재 블록의 템플릿(template)을 기반으로 상기 수정된 후보를 도출할 수 있다. 상기 현재 블록의 템플릿은 상기 현재 블록의 주변 샘플들을 포함하는 특정 영역으로 나타낼 수 있다. 상기 템플릿은 상기 현재 블록의 좌측 주변 샘플들, 좌상측 주변 샘플 및 상측 주변 샘플들을 포함하는 특정 영역일 수 있다. 또는, 상기 템플릿은 상기 현재 블록의 상기 좌측 주변 샘플들 및 상기 상측 주변 샘플들을 포함하는 특정 영역일 수 있다. 또는, 상기 템플릿은 상기 현재 블록의 상기 상측 주변 샘플들을 포함하는 특정 영역일 수 있다. 또는, 상기 템플릿은 상기 현재 블록의 상기 좌측 주변 샘플들을 포함하는 특정 영역일 수 있다. 상기 현재 블록의 주변 샘플들을 기반으로 현재 블록의 템플릿(template)이 도출될 수 있고, 상기 현재 블록의 참조 픽처 내 참조 블록들 중 상기 현재 블록의 템플릿과의 코스트가 최소인 템플릿을 갖는 참조 블록이 특정 참조 블록으로 도출될 수 있고, 상기 특정 참조 블록을 가리키는 움직임 정보를 기반으로 상기 수정된 후보가 도출될 수 있다. 즉, 상기 수정된 후보는 상기 특정 참조 블록을 가리키는 움직임 벡터(또는 움직임 정보)를 나타낼 수 있다. 여기서, 상기 코스트는 상술한 수학식 1을 기반으로 결정될 수 있다. Meanwhile, the motion information candidate list may include modified candidates of the current block. The decoding apparatus may derive the modified candidate based on a template of the current block. The template of the current block may be represented as a specific region including surrounding samples of the current block. The template may be a specific region including left neighboring samples, upper left neighboring samples, and upper neighboring samples of the current block. Alternatively, the template may be a specific region including the left neighboring samples of the current block and the upper neighboring samples. Alternatively, the template may be a specific region including the upper neighbor samples of the current block. Alternatively, the template may be a specific region including the left neighboring samples of the current block. A template of a current block can be derived based on neighboring samples of the current block and a reference block having a template having a minimum cost from a template of the current block among the reference blocks in the reference block of the current block And the modified candidate may be derived based on the motion information indicating the specific reference block. That is, the modified candidate may represent a motion vector (or motion information) indicating the specific reference block. Here, the cost may be determined based on Equation (1).
디코딩 장치는 상기 움직임 정보 후보 리스트의 후보들을 갱신(update)하여 수정된(modified) 움직임 정보 후보 리스트를 생성한다(S1120). 디코딩 장치는 상기 움직임 정보 후보 리스트를 갱신하여 상기 수정된 움직임 정보 후보 리스트를 생성할 수 있다.The decoding apparatus updates the candidates of the motion information candidate list to generate a modified motion information candidate list (S1120). The decoding apparatus may update the motion information candidate list to generate the modified motion information candidate list.
일 예로, 디코딩 장치는 상기 현재 블록의 템플릿을 기반으로 상기 수정된 움직임 정보 후보 리스트를 생성할 수 있다. 구체적으로, 상기 현재 블록의 주변 샘플들을 기반으로 현재 블록의 템플릿이 도출될 수 있고, 상기 움직임 정보 후보 리스트의 후보들이 가리키는 참조 블록들의 템플릿들이 도출될 수 있다. 상기 현재 블록의 템플릿은 상술한 내용과 같이 상기 현재 블록의 주변 샘플들을 포함하는 특정 영역으로 나타낼 수 있다. 상기 참조 블록들의 템플릿들은 상기 현재 블록의 템플릿과 대응하는 특정 영역들을 나타낼 수 있다. 즉, 참조 블록들의 템플릿들 각각은 상기 현재 블록의 상기 주변 샘플들과 대응하는 참조 블록들의 주변 샘플들을 기반으로 도출될 수 있다. 상기 참조 블록들의 템플릿들은 상기 현재 블록의 템플릿과 동일한 형태를 가질 수 있다. 상기 참조 블록들의 템플릿들 및 상기 현재 블록의 템플릿을 기반으로 상기 후보들의 코스트들이 도출될 수 있다. 상기 코스트는 상술한 수학식 1을 기반으로 결정될 수 있다. 상기 후보들의 코스트들을 기반으로 상기 움직임 정보 후보 리스트의 후보들의 순서가 갱신될 수 있다. 즉, 코스트가 작은 순으로 상기 움직임 정보 후보 리스트의 후보들의 순서가 갱신되어 상기 수정된 움직임 정보 후보 리스트가 생성될 수 있다. 다시 말해, 상기 수정된 움직임 정보 후보 리스트는 상기 후보들 중 가장 작은 코스트를 갖는 후보에서 가장 큰 코스트를 갖는 후보 순서로 정렬되어 생성될 수 있다. For example, the decoding apparatus may generate the modified motion information candidate list based on the template of the current block. Specifically, the template of the current block can be derived based on the surrounding samples of the current block, and the templates of the reference blocks indicated by the candidates of the motion information candidate list can be derived. The template of the current block may be represented as a specific region including surrounding samples of the current block as described above. The templates of the reference blocks may represent specific regions corresponding to the template of the current block. That is, each of the templates of the reference blocks may be derived based on the surrounding samples of the neighboring samples and the corresponding reference blocks of the current block. The templates of the reference blocks may have the same shape as the template of the current block. The costs of the candidates may be derived based on the templates of the reference blocks and the template of the current block. The cost may be determined based on Equation (1). The order of the candidates of the motion information candidate list may be updated based on the costs of the candidates. That is, the order of the candidates of the motion information candidate list is updated in the order of smaller cost, and the modified motion information candidate list can be generated. In other words, the modified motion information candidate list can be generated by arranging in the candidate order having the largest cost in the candidate having the smallest cost among the candidates.
또는, 상기 움직임 정보 후보 리스트가 N개의 후보들을 포함하는 경우, 상기 후보들은 가장 작은 코스트를 갖는 후보에서 가장 큰 코스트를 갖는 후보 순서로 정렬될 수 있고, 상기 정렬된 후보들 중 첫번째 후보 및 두번째 후보를 기반으로 상기 수정된 움직임 정보 후보 리스트가 생성될 수 있다. 즉, 상기 갱신된 순서에서 첫번째 후보 및 두번째 후보를 기반으로 상기 수정된 움직임 정보 후보 리스트가 생성될 수 있다. Alternatively, when the motion information candidate list includes N candidates, the candidates may be sorted in the candidate order having the largest cost in the candidate having the smallest cost, and the first candidate and the second candidate in the sorted candidate The modified motion information candidate list can be generated. That is, the modified motion information candidate list may be generated based on the first candidate and the second candidate in the updated order.
다른 일 예로, 디코딩 장치는 상기 움직임 정보 후보 리스트의 후보들이 나타내는 움직임 벡터들의 방향을 기반으로 상기 수정된 움직임 정보 후보 리스트를 생성할 수 있다. 구체적으로, 상기 움직임 정보 후보 리스트의 첫번째 후보가 나타내는 움직임 벡터 및 나머지 후보들이 나타내는 움직임 벡터들의 방향을 기반으로 상기 나머지 후보들 각각의 우선 순위가 도출될 수 있고, 상기 나머지 후보들의 상기 각 후보의 우선 순위를 기반으로 상기 움직임 정보 후보 리스트가 갱신되어 상기 수정된 움직임 정보 후보 리스트가 생성될 수 있다. 여기서, 상기 나머지 후보들은 상기 움직임 정보 후보 리스트의 후보들 중 상기 첫번째 후보 이외의 후보들을 나타낼 수 있다. In another example, the decoding apparatus may generate the modified motion information candidate list based on the directions of the motion vectors indicated by the candidates of the motion information candidate list. Specifically, the priority of each of the remaining candidates may be derived based on a motion vector represented by the first candidate of the motion information candidate list and the motion vectors represented by the remaining candidates, and the priority of each candidate of the remaining candidates The motion information candidate list is updated based on the motion information candidate list, and the modified motion information candidate list is generated. Here, the remaining candidates may represent candidates other than the first candidate among the candidates of the motion information candidate list.
상기 나머지 후보들의 각 후보의 우선 순위는 다음과 같이 도출될 수 있다. 상기 첫번째 후보가 나타내는 움직임 벡터와 상기 각 후보가 나타내는 움직임 벡터의 x성분 방향 및 y성분 방향이 모두 다른 경우, 상기 각 후보의 우선 순위는 가장 높은 우선 순위로 도출될 수 있다. 또한, 상기 첫번째 후보가 나타내는 움직임 벡터와 상기 각 후보가 나타내는 움직임 벡터의 x성분 방향 및 y성분 방향 중 하나의 방향이 다른 경우, 상기 각 후보의 우선 순위는 중간 우선 순위로 도출될 수 있다. 또한, 상기 첫번째 후보가 나타내는 움직임 벡터와 상기 각 후보가 나타내는 움직임 벡터의 x성분 방향 및 y성분 방향이 모두 같은 경우, 상기 각 후보의 우선 순위는 가장 낮은 우선 순위로 도출될 수 있다. 여기서, 상기 첫번째 후보가 나타내는 움직임 벡터의 x성분과 상기 각 후보가 나타내는 움직임 벡터의 x성분을 곱한 값이 0보다 작은 경우, 상기 첫번째 후보가 나타내는 움직임 벡터와 상기 각 후보가 나타내는 움직임 벡터의 x성분 방향은 다를 수 있고, 상기 첫번째 후보가 나타내는 움직임 벡터의 x성분과 상기 각 후보가 나타내는 움직임 벡터의 x성분을 곱한 값이 0보다 큰 경우, 상기 첫번째 후보가 나타내는 움직임 벡터와 상기 각 후보가 나타내는 움직임 벡터의 x성분 방향은 같을 수 있다. 또한, 상기 첫번째 후보가 나타내는 움직임 벡터의 y성분과 상기 각 후보가 나타내는 움직임 벡터의 y성분을 곱한 값이 0보다 작은 경우, 상기 첫번째 후보가 나타내는 움직임 벡터와 상기 각 후보가 나타내는 움직임 벡터의 y성분 방향은 다를 수 있고, 상기 첫번째 후보가 나타내는 움직임 벡터의 y성분과 상기 각 후보가 나타내는 움직임 벡터의 y성분을 곱한 값이 0보다 큰 경우, 상기 첫번째 후보가 나타내는 움직임 벡터와 상기 각 후보가 나타내는 움직임 벡터의 y성분 방향은 같을 수 있다. 따라서, 상기 첫번째 후보가 나타내는 움직임 벡터의 x성분과 상기 각 후보가 나타내는 움직임 벡터의 x성분을 곱한 값이 0보다 작고, 상기 첫번째 후보가 나타내는 움직임 벡터의 y성분과 상기 각 후보가 나타내는 움직임 벡터의 y성분을 곱한 값이 0보다 작은 경우, 상기 각 후보의 우선 순위는 가장 높은 우선 순위로 도출될 수 있다. 또한, 상기 첫번째 후보가 나타내는 움직임 벡터의 x성분과 상기 각 후보가 나타내는 움직임 벡터의 x성분을 곱한 값이 0보다 작고, 상기 첫번째 후보가 나타내는 움직임 벡터의 y성분과 상기 각 후보가 나타내는 움직임 벡터의 y성분을 곱한 값이 0보다 큰 경우, 상기 각 후보의 우선 순위는 중간 우선 순위로 도출될 수 있다. 또한, 상기 첫번째 후보가 나타내는 움직임 벡터의 x성분과 상기 각 후보가 나타내는 움직임 벡터의 x성분을 곱한 값이 0보다 크고, 상기 첫번째 후보가 나타내는 움직임 벡터의 y성분과 상기 각 후보가 나타내는 움직임 벡터의 y성분을 곱한 값이 0보다 작은 경우, 상기 각 후보의 우선 순위는 중간 우선 순위로 도출될 수 있다. 또한, 상기 첫번째 후보가 나타내는 움직임 벡터의 x성분과 상기 각 후보가 나타내는 움직임 벡터의 x성분을 곱한 값이 0보다 크고, 상기 첫번째 후보가 나타내는 움직임 벡터의 y성분과 상기 각 후보가 나타내는 움직임 벡터의 y성분을 곱한 값이 0보다 큰 경우, 상기 각 후보의 우선 순위는 가장 낮은 우선 순위로 도출될 수 있다.The priority of each candidate of the remaining candidates can be derived as follows. If the x-component direction and the y-component direction of the motion vector represented by the first candidate and the motion vector represented by the candidate are all different, the priority of each candidate can be derived with the highest priority. When the direction of one of the x component direction and the y component direction of the motion vector indicated by the first candidate and the motion vector indicated by the candidate is different, the priority of each candidate may be derived as a medium priority. In addition, when the x-component direction and the y-component direction of the motion vector represented by the first candidate and the motion vector represented by the candidate are all the same, the priority of each candidate can be derived with the lowest priority. Here, when the value obtained by multiplying the x component of the motion vector represented by the first candidate by the x component of the motion vector represented by the candidate is less than 0, the motion vector represented by the first candidate and the x component And when the value obtained by multiplying the x component of the motion vector represented by the first candidate by the x component of the motion vector represented by the candidate is greater than 0, the motion vector represented by the first candidate and the motion represented by each candidate The x component direction of the vector may be the same. When a value obtained by multiplying the y component of the motion vector represented by the first candidate by the y component of the motion vector represented by the candidate is less than 0, the motion vector represented by the first candidate and the y component And a motion vector represented by the first candidate is multiplied by a y component of a motion vector represented by each candidate is greater than 0, a motion vector represented by the first candidate and a motion represented by each candidate The y component direction of the vector may be the same. Therefore, when the value obtained by multiplying the x component of the motion vector represented by the first candidate by the x component of the motion vector represented by the candidate is smaller than 0, and the y component of the motion vector represented by the first candidate and the motion vector represented by each candidate If the value obtained by multiplying the y component is smaller than 0, the priority of each candidate can be derived with the highest priority. A value obtained by multiplying the x component of the motion vector represented by the first candidate by the x component of the motion vector represented by the candidate is smaller than 0 and the y component of the motion vector represented by the first candidate and the motion vector represented by each candidate If the value obtained by multiplying the y component is greater than 0, the priority of each candidate can be derived as a medium priority. The value of the x component of the motion vector represented by the first candidate multiplied by the x component of the motion vector represented by the candidate is greater than 0 and the y component of the motion vector represented by the first candidate and the motion vector represented by each candidate If the value obtained by multiplying the y component is smaller than 0, the priority of each candidate can be derived as a medium priority. The value of the x component of the motion vector represented by the first candidate multiplied by the x component of the motion vector represented by the candidate is greater than 0 and the y component of the motion vector represented by the first candidate and the motion vector represented by each candidate If the value obtained by multiplying the y component is greater than 0, the priority of each candidate can be derived with the lowest priority.
상기 나머지 후보들의 각 후보의 우선 순위를 기반으로 상기 움직임 정보 후보 리스트의 후보들의 순서가 갱신될 수 있다. 즉, 가장 높은 우선 순위의 후보에서 가장 낮은 우선 순위의 후보 순으로 상기 나머지 후보들의 순서가 갱신되어 상기 수정된 움직임 정보 후보 리스트가 생성될 수 있다. 즉, 우선 순위가 높은 순으로 상기 나머지 후보들의 순서가 갱신되어 상기 수정된 움직임 정보 후보 리스트가 생성될 수 있다. 다시 말해, 상기 수정된 움직임 정보 후보 리스트는 상기 첫번째 후보 다음으로 가장 높은 우선 순위의 후보에서 가장 낮은 우선 순위의 후보 순서로 정렬되어 생성될 수 있다. The order of the candidates of the motion information candidate list may be updated based on the priority of each candidate of the remaining candidates. That is, the order of the remaining candidates may be updated in the order of the highest-priority candidate to the lowest-priority candidate, and the modified motion information candidate list may be generated. That is, the order of the remaining candidates may be updated in descending order of priority, and the modified motion information candidate list may be generated. In other words, the modified motion information candidate list may be generated in the order of the highest priority candidate to the lowest priority candidate next to the first candidate.
또는, 상기 움직임 정보 후보 리스트가 N개의 후보들을 포함하는 경우, 상기 후보들은 가장 높은 우선 순위의 후보에서 가장 낮은 우선 순위의 후보 순서로 정렬될 수 있고, 상기 정렬된 후보들 중 첫번째 후보 및 두번째 후보를 기반으로 상기 수정된 움직임 정보 후보 리스트가 생성될 수 있다. 즉, 상기 갱신된 순서에서 첫번째 후보 및 두번째 후보를 기반으로 상기 수정된 움직임 정보 후보 리스트가 생성될 수 있다. Alternatively, when the motion information candidate list includes N candidates, the candidates may be sorted in order of the highest priority candidate to the lowest priority candidate, and the first candidate and the second candidate of the aligned candidates The modified motion information candidate list can be generated. That is, the modified motion information candidate list may be generated based on the first candidate and the second candidate in the updated order.
다른 일 예로, 디코딩 장치는 상기 현재 블록의 템플릿 및 상기 움직임 정보 후보 리스트의 후보들이 나타내는 움직임 벡터들의 방향을 기반으로 상기 수정된 움직임 정보 후보 리스트를 생성할 수 있다. 구체적으로, 상기 현재 블록의 주변 샘플들을 기반으로 상기 현재 블록의 템플릿이 도출될 수 있고, 상기 움직임 정보 후보 리스트의 후보들이 가리키는 참조 블록들의 템플릿들이 도출될 수 있고, 상기 참조 블록들의 템플릿들 및 상기 현재 블록의 템플릿을 기반으로 상기 후보들의 코스트들이 도출될 수 있다. 상기 코스트는 상술한 수학식 1을 기반으로 결정될 수 있다. 상기 후보들의 코스트들을 기반으로 상기 움직임 정보 후보 리스트의 후보들의 순서가 갱신되어 제1 움직임 정보 후보 리스트가 생성될 수 있다. 즉, 코스트가 작은 순으로 상기 움직임 정보 후보 리스트의 후보들의 순서가 갱신되어 상기 제1 움직임 정보 후보 리스트가 생성될 수 있다. 다시 말해, 상기 제1 움직임 정보 후보 리스트는 상기 후보들 중 가장 작은 코스트를 갖는 후보에서 가장 큰 코스트를 갖는 후보 순서로 정렬되어 생성될 수 있다. In another example, the decoding apparatus may generate the modified motion information candidate list based on the template of the current block and the directions of the motion vectors indicated by the candidates of the motion information candidate list. Specifically, the template of the current block can be derived based on the neighboring samples of the current block, the templates of the reference blocks indicated by the candidates of the motion information candidate list can be derived, The costs of the candidates can be derived based on the template of the current block. The cost may be determined based on Equation (1). The order of the candidates of the motion information candidate list is updated based on the costs of the candidates so that the first motion information candidate list can be generated. That is, the order of the candidates of the motion information candidate list is updated in the order of smaller cost so that the first motion information candidate list can be generated. In other words, the first motion information candidate list may be generated by arranging in the candidate order having the largest cost in the candidate having the smallest cost among the candidates.
상기 제1 움직임 정보 후보 리스트가 생성된 경우, 상기 제1 움직임 정보 후보 리스트의 첫번째 후보 및 나머지 후보들이 나타내는 움직임 벡터들의 방향을 기반으로 상기 나머지 후보들의 각 후보의 우선 순위가 도출될 수 있고, 상기 나머지 후보들의 상기 각 후보의 우선 순위를 기반으로 상기 제1 움직임 정보 후보 리스트가 갱신되어 상기 수정된 움직임 정보 후보 리스트가 생성될 수 있다. 여기서, 상기 나머지 후보들은 상기 제1 움직임 정보 후보 리스트의 후보들 중 상기 첫번째 후보 이외의 후보들을 나타낼 수 있다. When the first motion information candidate list is generated, the priority of each candidate of the remaining candidates can be derived based on the directions of the motion vectors indicated by the first candidate and the remaining candidates of the first motion information candidate list, The first motion information candidate list is updated based on the priorities of the candidates of the remaining candidates so that the modified motion information candidate list can be generated. Here, the remaining candidates may represent candidates other than the first candidate among the candidates of the first motion information candidate list.
상기 나머지 후보들의 각 후보의 우선 순위는 다음과 같이 도출될 수 있다. 상기 첫번째 후보가 나타내는 움직임 벡터와 상기 각 후보가 나타내는 움직임 벡터의 x성분 방향 및 y성분 방향이 모두 다른 경우, 상기 각 후보의 우선 순위는 가장 높은 우선 순위로 도출될 수 있다. 또한, 상기 첫번째 후보가 나타내는 움직임 벡터와 상기 각 후보가 나타내는 움직임 벡터의 x성분 방향 및 y성분 방향 중 하나의 방향이 다른 경우, 상기 각 후보의 우선 순위는 중간 우선 순위로 도출될 수 있다. 또한, 상기 첫번째 후보가 나타내는 움직임 벡터와 상기 각 후보가 나타내는 움직임 벡터의 x성분 방향 및 y성분 방향이 모두 같은 경우, 상기 각 후보의 우선 순위는 가장 낮은 우선 순위로 도출될 수 있다. 여기서, 상기 첫번째 후보가 나타내는 움직임 벡터의 x성분과 상기 각 후보가 나타내는 움직임 벡터의 x성분을 곱한 값이 0보다 작은 경우, 상기 첫번째 후보가 나타내는 움직임 벡터와 상기 각 후보가 나타내는 움직임 벡터의 x성분 방향은 다를 수 있고, 상기 첫번째 후보가 나타내는 움직임 벡터의 x성분과 상기 각 후보가 나타내는 움직임 벡터의 x성분을 곱한 값이 0보다 큰 경우, 상기 첫번째 후보가 나타내는 움직임 벡터와 상기 각 후보가 나타내는 움직임 벡터의 x성분 방향은 같을 수 있다. 또한, 상기 첫번째 후보가 나타내는 움직임 벡터의 y성분과 상기 각 후보가 나타내는 움직임 벡터의 y성분을 곱한 값이 0보다 작은 경우, 상기 첫번째 후보가 나타내는 움직임 벡터와 상기 각 후보가 나타내는 움직임 벡터의 y성분 방향은 다를 수 있고, 상기 첫번째 후보가 나타내는 움직임 벡터의 y성분과 상기 각 후보가 나타내는 움직임 벡터의 y성분을 곱한 값이 0보다 큰 경우, 상기 첫번째 후보가 나타내는 움직임 벡터와 상기 각 후보가 나타내는 움직임 벡터의 y성분 방향은 같을 수 있다. 따라서, 상기 첫번째 후보가 나타내는 움직임 벡터의 x성분과 상기 각 후보가 나타내는 움직임 벡터의 x성분을 곱한 값이 0보다 작고, 상기 첫번째 후보가 나타내는 움직임 벡터의 y성분과 상기 각 후보가 나타내는 움직임 벡터의 y성분을 곱한 값이 0보다 작은 경우, 상기 각 후보의 우선 순위는 가장 높은 우선 순위로 도출될 수 있다. 또한, 상기 첫번째 후보가 나타내는 움직임 벡터의 x성분과 상기 각 후보가 나타내는 움직임 벡터의 x성분을 곱한 값이 0보다 작고, 상기 첫번째 후보가 나타내는 움직임 벡터의 y성분과 상기 각 후보가 나타내는 움직임 벡터의 y성분을 곱한 값이 0보다 큰 경우, 상기 각 후보의 우선 순위는 중간 우선 순위로 도출될 수 있다. 또한, 상기 첫번째 후보가 나타내는 움직임 벡터의 x성분과 상기 각 후보가 나타내는 움직임 벡터의 x성분을 곱한 값이 0보다 크고, 상기 첫번째 후보가 나타내는 움직임 벡터의 y성분과 상기 각 후보가 나타내는 움직임 벡터의 y성분을 곱한 값이 0보다 작은 경우, 상기 각 후보의 우선 순위는 중간 우선 순위로 도출될 수 있다. 또한, 상기 첫번째 후보가 나타내는 움직임 벡터의 x성분과 상기 각 후보가 나타내는 움직임 벡터의 x성분을 곱한 값이 0보다 크고, 상기 첫번째 후보가 나타내는 움직임 벡터의 y성분과 상기 각 후보가 나타내는 움직임 벡터의 y성분을 곱한 값이 0보다 큰 경우, 상기 각 후보의 우선 순위는 가장 낮은 우선 순위로 도출될 수 있다.The priority of each candidate of the remaining candidates can be derived as follows. If the x-component direction and the y-component direction of the motion vector represented by the first candidate and the motion vector represented by the candidate are all different, the priority of each candidate can be derived with the highest priority. When the direction of one of the x component direction and the y component direction of the motion vector indicated by the first candidate and the motion vector indicated by the candidate is different, the priority of each candidate may be derived as a medium priority. In addition, when the x-component direction and the y-component direction of the motion vector represented by the first candidate and the motion vector represented by the candidate are all the same, the priority of each candidate can be derived with the lowest priority. Here, when the value obtained by multiplying the x component of the motion vector represented by the first candidate by the x component of the motion vector represented by the candidate is less than 0, the motion vector represented by the first candidate and the x component And when the value obtained by multiplying the x component of the motion vector represented by the first candidate by the x component of the motion vector represented by the candidate is greater than 0, the motion vector represented by the first candidate and the motion represented by each candidate The x component direction of the vector may be the same. When a value obtained by multiplying the y component of the motion vector represented by the first candidate by the y component of the motion vector represented by the candidate is less than 0, the motion vector represented by the first candidate and the y component And a motion vector represented by the first candidate is multiplied by a y component of a motion vector represented by each candidate is greater than 0, a motion vector represented by the first candidate and a motion represented by each candidate The y component direction of the vector may be the same. Therefore, when the value obtained by multiplying the x component of the motion vector represented by the first candidate by the x component of the motion vector represented by the candidate is smaller than 0, and the y component of the motion vector represented by the first candidate and the motion vector represented by each candidate If the value obtained by multiplying the y component is smaller than 0, the priority of each candidate can be derived with the highest priority. A value obtained by multiplying the x component of the motion vector represented by the first candidate by the x component of the motion vector represented by the candidate is smaller than 0 and the y component of the motion vector represented by the first candidate and the motion vector represented by each candidate If the value obtained by multiplying the y component is greater than 0, the priority of each candidate can be derived as a medium priority. The value of the x component of the motion vector represented by the first candidate multiplied by the x component of the motion vector represented by the candidate is greater than 0 and the y component of the motion vector represented by the first candidate and the motion vector represented by each candidate If the value obtained by multiplying the y component is smaller than 0, the priority of each candidate can be derived as a medium priority. The value of the x component of the motion vector represented by the first candidate multiplied by the x component of the motion vector represented by the candidate is greater than 0 and the y component of the motion vector represented by the first candidate and the motion vector represented by each candidate If the value obtained by multiplying the y component is greater than 0, the priority of each candidate can be derived with the lowest priority.
상기 나머지 후보들의 각 후보의 우선 순위를 기반으로 상기 제1 움직임 정보 후보 리스트의 후보들의 순서가 갱신될 수 있다. 즉, 가장 높은 우선 순위의 후보에서 가장 낮은 우선 순위의 후보 순으로 상기 나머지 후보들의 순서가 갱신되어 상기 수정된 움직임 정보 후보 리스트가 생성될 수 있다. 즉, 우선 순위가 높은 순으로 상기 나머지 후보들의 순서가 갱신되어 상기 수정된 움직임 정보 후보 리스트가 생성될 수 있다. 다시 말해, 상기 수정된 움직임 정보 후보 리스트는 상기 제1 움직임 정보 후보 리스트의 상기 첫번째 후보 다음으로 가장 높은 우선 순위의 후보에서 가장 낮은 우선 순위의 후보 순서로 정렬되어 생성될 수 있다. 또는, 상기 제1 움직임 정보 후보 리스트의 후보들은 상기 첫번째 후보 다음으로 가장 높은 우선 순위의 후보에서 가장 낮은 우선 순위의 후보 순서로 정렬될 수 있고, 상기 정렬된 후보들 중 첫번째 후보 및 두번째 후보를 기반으로 상기 수정된 움직임 정보 후보 리스트가 생성될 수 있다. 즉, 상기 갱신된 순서에서 첫번째 후보 및 두번째 후보를 기반으로 상기 수정된 움직임 정보 후보 리스트가 생성될 수 있다. The order of the candidates of the first motion information candidate list may be updated based on the priority of each candidate of the remaining candidates. That is, the order of the remaining candidates may be updated in the order of the highest-priority candidate to the lowest-priority candidate, and the modified motion information candidate list may be generated. That is, the order of the remaining candidates may be updated in descending order of priority, and the modified motion information candidate list may be generated. In other words, the modified motion information candidate list may be generated in the order of the highest priority candidate to the lowest priority candidate next to the first candidate of the first motion information candidate list. Alternatively, the candidates of the first motion information candidate list may be sorted in order of the highest priority candidate to the lowest priority candidate next to the first candidate, and based on the first candidate and the second candidate of the aligned candidates The modified motion information candidate list can be generated. That is, the modified motion information candidate list may be generated based on the first candidate and the second candidate in the updated order.
디코딩 장치는 상기 인터 예측에 대한 정보 및 상기 수정된 움직임 정보 후보 리스트를 기반으로 상기 현재 블록의 움직임 정보를 도출한다(S1130). 상기 인터 예측에 대한 정보는 상기 현재 블록에 스킵(skip) 모드, 머지(merge) 모드, 및 AMVP(adaptive motion vector prediction) 모드 중 어느 하나의 모드가 적용되는지 나타낼 수 있다. 상기 현재 블록에 스킵 모드 또는 머지 모드가 적용되는 경우, 디코딩 장치는 상기 움직임 정보 후보 리스트에 포함된 후보들 중 하나의 후보를 가리키는 머지 인덱스(merge index)를 획득할 수 있다. 상기 머지 인덱스는 상기 인터 예측에 대한 정보에 포함될 수 있다. 디코딩 장치는 상기 수정된 움직임 정보 후보 리스트의 후보들 중 상기 머지 인덱스가 가리키는 후보의 움직임 정보를 상기 현재 블록의 움직임 정보로 도출할 수 있다. The decoding apparatus derives motion information of the current block based on the inter prediction information and the modified motion information candidate list (S1130). The information on the inter prediction may indicate whether a skip mode, a merge mode, or an adaptive motion vector prediction (AMVP) mode is applied to the current block. When a skip mode or a merge mode is applied to the current block, the decoding apparatus can obtain a merge index indicating a candidate of the candidates included in the motion information candidate list. The merge index may be included in the information on the inter prediction. The decoding apparatus may derive the motion information of the candidate pointed by the merge index among the candidates of the corrected motion information candidate list as the motion information of the current block.
상기 현재 블록에 AMVP 모드가 적용되는 경우, 디코딩 장치는 상기 수정된 움직임 정보 후보 리스트에 포함된 후보들 중 하나를 가리키는 MVP 플래그 및 상기 MVP 플래그가 가리키는 후보의 움직임 벡터(MVP 후보)와 상기 현재 블록의 움직임 벡터 차분(motion vector difference, MVD)을 획득할 수 있다. 상기 MVP 플래그 및 상기 MVD는 상기 인터 예측에 대한 정보에 포함될 수 있다. 디코딩 장치는 상기 MVP 플래그가 가리키는 후보가 나타내는 움직임 벡터(MVP 후보) 및 상기 MVD를 기반으로 상기 현재 블록의 상기 움직임 정보를 도출할 수 있다.When the AMVP mode is applied to the current block, the decoding apparatus includes an MVP flag indicating one of the candidates included in the modified motion information candidate list, a candidate motion vector (MVP candidate) indicated by the MVP flag, A motion vector difference (MVD) can be obtained. The MVP flag and the MVD may be included in the information on the inter prediction. The decoding apparatus may derive the motion information of the current block based on the MVP candidate indicated by the candidate indicated by the MVP flag and the MVD.
상기 움직임 정보는 움직임 벡터와 참조 픽처 인덱스를 포함할 수 있다. 상기 움직임 정보는 쌍예측(bi-prediction) 움직임 정보일 수 있고, 또는 단예측(uni-prediction) 움직임 정보일 수 있다. 상기 쌍예측 움직임 정보는 L0 참조 픽처 인덱스 및 L0 움직임 벡터, L1 참조 픽처 인덱스 및 L1 움직임 벡터를 포함할 수 있고, 상기 단예측 움직임 정보는 L0 참조 픽처 인덱스 및 L0 움직임 벡터를 포함할 수 있고, 또는 L1 참조 픽처 인덱스 및 L1 움직임 벡터를 포함할 수 있다. 상기 L0은 참조 픽처 리스트 L0(List 0)를 나타내고, 상기 L1은 참조 픽처 리스트 L1(List 1)를 나타낸다. The motion information may include a motion vector and a reference picture index. The motion information may be bi-prediction motion information, or may be uni-prediction motion information. The bi-predictive motion information may include an L0 reference picture index, an L0 motion vector, an L1 reference picture index, and an L1 motion vector, the short motion prediction information may include an L0 reference picture index and a L0 motion vector, An L1 reference picture index and an L1 motion vector. L0 denotes a reference picture list L0 (List 0), and L1 denotes a reference picture list L1 (List 1).
디코딩 장치는 상기 움직임 정보를 기반으로 상기 현재 블록의 인터 예측을 수행한다(S1140). 상기 움직임 정보를 기반으로 상기 현재 블록의 예측 블록이 도출될 수 있고, 상기 예측 블록을 기반으로 복원 블록이 도출될 수 있다. 구체적으로, 디코딩 장치는 상기 움직임 정보를 기반으로 참조 픽처 내 참조 블록을 도출할 수 있다. 상기 움직임 정보는 움직임 벡터 및 참조 픽처 인덱스를 포함할 수 있다. 디코딩 장치는 참조 픽처 리스트의 참조 픽처들 중 상기 참조 픽처 인덱스가 가리키는 참조 픽처를 상기 현재 블록의 참조 픽처로 도출할 수 있고, 상기 참조 픽처 내 상기 움직임 벡터가 가리키는 블록을 상기 현재 블록의 참조 블록으로 도출할 수 있다. 디코딩 장치는 상기 참조 블록을 기반으로 예측 샘플을 생성할 수 있고, 예측 모드에 따라 상기 예측 샘플을 바로 복원 샘플로 이용할 수도 있고, 또는 상기 예측 샘플에 레지듀얼 샘플을 더하여 복원 샘플을 생성할 수도 있다. 디코딩 장치는 상기 현재 블록에 대한 레지듀얼 샘플이 존재하는 경우, 상기 비트스트림으로부터 상기 현재 블록에 대한 레지듀얼에 관한 정보를 수신할 수 있다. 상기 레지듀얼에 관한 정보는 상기 레지듀얼 샘플에 관한 변환 계수를 포함할 수 있다. 디코딩 장치는 상기 레지듀얼 정보를 기반으로 상기 현재 블록에 대한 상기 레지듀얼 샘플(또는 레지듀얼 샘플 어레이)을 도출할 수 있다. 디코딩 장치는 상기 예측 샘플과 상기 레지듀얼 샘플을 기반으로 복원 샘플을 생성할 수 있고, 상기 복원 샘플을 기반으로 복원 블록 또는 복원 픽처를 도출할 수 있다. 이후 디코딩 장치는 필요에 따라 주관적/객관적 화질을 향상시키기 위하여 디블록킹 필터링 및/또는 SAO 절차와 같은 인루프 필터링 절차를 상기 복원 픽처에 적용할 수 있음은 상술한 바와 같다.The decoding apparatus performs inter-prediction of the current block based on the motion information (S1140). A prediction block of the current block can be derived based on the motion information, and a reconstruction block can be derived based on the prediction block. Specifically, the decoding apparatus may derive a reference block intra-reference block based on the motion information. The motion information may include a motion vector and a reference picture index. The decoding apparatus can derive a reference picture indicated by the reference picture index of the reference pictures in the reference picture list as a reference picture of the current block, and a block indicated by the motion vector in the reference picture as a reference block of the current block . The decoding apparatus may generate a prediction sample based on the reference block and may use the prediction sample directly as a reconstruction sample according to a prediction mode or may add a residual sample to the prediction sample to generate a reconstruction sample . The decoding apparatus may receive information on a residual from the bitstream, if there is a residual sample for the current block, for the current block. The information on the residual may include a transform coefficient relating to the residual sample. The decoding apparatus may derive the residual sample (or residual sample array) for the current block based on the residual information. The decoding apparatus may generate a reconstructed sample based on the prediction sample and the residual sample, and may derive a reconstructed block or a reconstructed picture based on the reconstructed sample. Hereinafter, it is described that the decoding apparatus can apply an in-loop filtering procedure such as deblocking filtering and / or SAO procedure to the restored picture in order to improve subjective / objective picture quality as necessary.
상술한 본 발명에 따르면 상기 현재 블록의 수정된 후보를 포함한 움직임 정보 후보 리스트를 생성하여 더욱 정확한 움직임 정보를 도출할 수 있고, 이를 통하여 현재 블록의 인터 예측에 대한 정보의 비트량을 줄이고, 전반적인 코딩 효율을 향상시킬 수 있다.According to the present invention, more precise motion information can be derived by generating a motion information candidate list including the modified candidate of the current block, thereby reducing the bit amount of information for inter prediction of the current block, The efficiency can be improved.
또한, 본 발명에 따르면 별도의 부가 정보의 수신 없이 상기 움직임 정보 후보 리스트의 후보들을 갱신하여 수정된(modified) 움직임 정보 후보 리스트를 생성할 수 있고, 이를 통하여 더욱 정확한 움직임 정보를 도출할 수 있고, 이를 통하여 현재 블록의 인터 예측에 대한 정보의 비트량을 줄이고, 전반적인 코딩 효율을 향상시킬 수 있다.According to the present invention, it is possible to generate a modified motion information candidate list by updating the candidates of the motion information candidate list without receiving additional additional information, thereby obtaining more accurate motion information, Accordingly, the bit amount of the information for the inter prediction of the current block can be reduced and the overall coding efficiency can be improved.
상술한 실시예에서, 방법들은 일련의 단계 또는 블록으로써 순서도를 기초로 설명되고 있지만, 본 발명은 단계들의 순서에 한정되는 것은 아니며, 어떤 단계는 상술한 바와 다른 단계와 다른 순서로 또는 동시에 발생할 수 있다. 또한, 당업자라면 순서도에 나타내어진 단계들이 배타적이지 않고, 다른 단계가 포함되거나 순서도의 하나 또는 그 이상의 단계가 본 발명의 범위에 영향을 미치지 않고 삭제될 수 있음을 이해할 수 있을 것이다.In the above-described embodiments, while the methods are described on the basis of a flowchart as a series of steps or blocks, the present invention is not limited to the order of steps, and some steps may occur in different orders or in a different order than the steps described above have. It will also be appreciated by those skilled in the art that the steps depicted in the flowchart are not exclusive and that other steps may be included or that one or more steps in the flowchart may be deleted without affecting the scope of the invention.
상술한 본 발명에 따른 방법은 소프트웨어 형태로 구현될 수 있으며, 본 발명에 따른 인코딩 장치 및/또는 디코딩 장치는 예를 들어 TV, 컴퓨터, 스마트폰, 셋톱박스, 디스플레이 장치 등의 영상 처리를 수행하는 장치에 포함될 수 있다.The above-described method according to the present invention can be implemented in software, and the encoding apparatus and / or decoding apparatus according to the present invention can perform image processing of, for example, a TV, a computer, a smart phone, a set- Device.
본 발명에서 실시예들이 소프트웨어로 구현될 때, 상술한 방법은 상술한 기능을 수행하는 모듈(과정, 기능 등)로 구현될 수 있다. 모듈은 메모리에 저장되고, 프로세서에 의해 실행될 수 있다. 메모리는 프로세서 내부 또는 외부에 있을 수 있고, 잘 알려진 다양한 수단으로 프로세서와 연결될 수 있다. 프로세서는 ASIC(application-specific integrated circuit), 다른 칩셋, 논리 회로 및/또는 데이터 처리 장치를 포함할 수 있다. 메모리는 ROM(read-only memory), RAM(random access memory), 플래쉬 메모리, 메모리 카드, 저장 매체 및/또는 다른 저장 장치를 포함할 수 있다.When the embodiments of the present invention are implemented in software, the above-described method may be implemented by a module (a process, a function, and the like) that performs the above-described functions. The module is stored in memory and can be executed by the processor. The memory may be internal or external to the processor and may be coupled to the processor by any of a variety of well known means. The processor may comprise an application-specific integrated circuit (ASIC), other chipset, logic circuitry and / or a data processing device. The memory may include read-only memory (ROM), random access memory (RAM), flash memory, memory cards, storage media, and / or other storage devices.

Claims (15)

  1. 디코딩 장치에 의하여 수행되는 영상 디코딩 방법에 있어서,An image decoding method performed by a decoding apparatus,
    비트스트림을 통하여 현재 블록의 인터 예측에 대한 정보를 획득하는 단계;Obtaining information on inter prediction of a current block through a bit stream;
    상기 현재 블록의 주변 블록들을 기반으로 상기 현재 블록의 움직임 정보 후보 리스트를 생성하는 단계;Generating a motion information candidate list of the current block based on neighboring blocks of the current block;
    상기 움직임 정보 후보 리스트의 후보들을 갱신하여 수정된(modified) 움직임 정보 후보 리스트를 생성하는 단계;Generating a modified motion information candidate list by updating the candidates of the motion information candidate list;
    상기 인터 예측에 대한 정보 및 상기 수정된 움직임 정보 리스트를 기반으로 상기 현재 블록의 움직임 정보를 도출하는 단계; 및Deriving motion information of the current block based on the inter prediction information and the modified motion information list; And
    상기 움직임 정보를 기반으로 상기 현재 블록의 인터 예측을 수행하는 단계를 포함하는 것을 특징으로 하는 영상 디코딩 방법.And performing inter-prediction of the current block based on the motion information.
  2. 제1항에 있어서,The method according to claim 1,
    상기 움직임 정보 후보 리스트는 수정된(modified) 후보를 포함하되,Wherein the motion information candidate list includes a modified candidate,
    인터 예측에 대한 정보를 기반으로 도출된 참조 픽처 내 참조 블록들 중 상기 현재 블록의 템플릿(template)과의 코스트가 최소인 템플릿을 갖는 참조 블록이 특정 참조 블록으로 도출되고,A reference block having a template with a minimum cost with respect to a template of the current block among the reference blocks in reference pictures derived based on information on inter prediction is derived as a specific reference block,
    상기 수정된 후보는 상기 특정 참조 블록을 가리키는 움직임 정보를 나타내는 후보이고,The modified candidate is a candidate indicating motion information indicating the specific reference block,
    상기 현재 블록의 템플릿은 상기 현재 블록의 주변 샘플들을 포함하는 특정 영역을 나타내는 것을 특징으로 하는 영상 디코딩 방법.Wherein the template of the current block represents a specific region including neighboring samples of the current block.
  3. 제2항에 있어서,3. The method of claim 2,
    상기 코스트는 다음의 수학식을 기반으로 결정되고,The cost is determined based on the following equation,
    Figure PCTKR2017014073-appb-I000001
    Figure PCTKR2017014073-appb-I000001
    여기서, Costdistortion 은 상기 코스트, Tempcur(i, j)는 상기 현재 블록의 상기 템플릿 내 (i, j) 좌표의 복원 샘플, Tempref(i, j)는 상기 참조 블록의 상기 템플릿 내 (i, j) 좌표의 복원 샘플을 나타내는 것을 특징으로 하는 영상 디코딩 방법.Here, distortion Cost Is the cost, Temp cur (i, j) is the template within the (i, j) coordinates of the reconstructed samples of the current block, Temp ref (i, j) is the template of the reference block within the (i, j) coordinates And a reconstructed sample of the reconstructed image.
  4. 제1항에 있어서,The method according to claim 1,
    상기 현재 블록의 주변 샘플들을 기반으로 현재 블록의 템플릿이 도출되고, 상기 움직임 정보 후보 리스트의 후보들이 가리키는 참조 블록들의 템플릿들이 도출되고,A template of a current block is derived based on surrounding samples of the current block, templates of reference blocks indicated by candidates of the motion information candidate list are derived,
    상기 참조 블록들의 템플릿들 및 상기 현재 블록의 템플릿을 기반으로 상기 후보들의 코스트들이 도출되고, The costs of the candidates are derived based on the templates of the reference blocks and the template of the current block,
    코스트가 작은 순으로 상기 움직임 정보 후보 리스트의 상기 후보들의 순서가 갱신되어 상기 수정된 움직임 정보 후보 리스트가 생성되되, The order of the candidates in the motion information candidate list is updated in order of decreasing cost to generate the modified motion information candidate list,
    상기 현재 블록의 템플릿은 상기 현재 블록의 주변 샘플들을 포함하는 특정 영역을 나타내고,Wherein the template of the current block represents a specific region including neighboring samples of the current block,
    상기 참조 블록들의 템플릿들은 상기 현재 블록의 템플릿과 대응하는 특정 영역들을 나타내는 것을 특징으로 하는 영상 디코딩 방법.Wherein the templates of the reference blocks represent specific regions corresponding to the template of the current block.
  5. 제1항에 있어서,The method according to claim 1,
    상기 움직임 정보 후보 리스트의 첫번째 후보가 나타내는 움직임 벡터 및 나머지 후보들이 나타내는 움직임 벡터들의 방향을 기반으로 상기 나머지 후보들 각각의 우선 순위가 도출되고, The priority of each of the remaining candidates is derived based on the motion vector represented by the first candidate of the motion information candidate list and the direction of the motion vectors represented by the remaining candidates,
    상기 나머지 후보들 각각의 우선 순위를 기반으로 상기 움직임 정보 후보 리스트가 갱신되어 상기 수정된 움직임 정보 후보 리스트가 생성되는 것을 특징으로 하는 영상 디코딩 방법.Wherein the motion information candidate list is updated based on the priority of each of the remaining candidates, and the modified motion information candidate list is generated.
  6. 제5항에 있어서,6. The method of claim 5,
    상기 수정된 움직임 정보 후보 리스트는 상기 첫번째 후보 다음으로 가장 높은 우선 순위의 후보에서 가장 낮은 우선 순위의 후보 순서로 정렬되어 생성되는 것을 특징으로 하는 영상 디코딩 방법.Wherein the modified motion information candidate list is generated by arranging the candidates of the highest priority candidate to the lowest priority candidate next to the first candidate.
  7. 제5항에 있어서,6. The method of claim 5,
    상기 움직임 정보 후보 리스트의 후보들은 상기 첫번째 후보 다음으로 가장 높은 우선 순위의 후보에서 가장 낮은 우선 순위의 후보 순서로 정렬되고, The candidates of the motion information candidate list are arranged in the order of the highest priority candidate to the lowest priority candidate next to the first candidate,
    상기 정렬된 후보들 중 첫번째 후보 및 두번째 후보만을 포함하도록 상기 수정된 움직임 정보 후보 리스트가 생성되는 것을 특징으로 하는 영상 디코딩 방법.Wherein the modified motion information candidate list is generated to include only the first candidate and the second candidate among the aligned candidates.
  8. 제5항에 있어서,6. The method of claim 5,
    상기 첫번째 후보가 나타내는 움직임 벡터와 상기 각 후보가 나타내는 움직임 벡터의 x성분 방향 및 y성분 방향이 모두 다른 경우, 상기 각 후보의 우선 순위는 가장 높은 우선 순위로 도출되고,When the x-component direction and the y-component direction of the motion vector represented by the first candidate and the motion vector represented by the candidate are all different, the priority of each candidate is derived with the highest priority,
    상기 첫번째 후보가 나타내는 움직임 벡터와 상기 각 후보가 나타내는 움직임 벡터의 x성분 방향 및 y성분 방향 중 하나의 방향이 다른 경우, 상기 각 후보의 우선 순위는 중간 우선 순위로 도출되고, When the direction of one of the x component direction and the y component direction of the motion vector represented by the first candidate and the motion vector represented by the candidate is different, the priority of each candidate is derived as a medium priority,
    상기 첫번째 후보가 나타내는 움직임 벡터와 상기 각 후보가 나타내는 움직임 벡터의 x성분 방향 및 y성분 방향이 모두 같은 경우, 상기 각 후보의 우선 순위는 가장 낮은 우선 순위로 도출되는 것을 특징으로 하는 영상 디코딩 방법.Wherein when the x component direction and the y component direction of the motion vector represented by the first candidate and the motion vector represented by the candidate are all the same, the priority of each candidate is derived with the lowest priority.
  9. 제1항에 있어서,The method according to claim 1,
    상기 현재 블록의 주변 샘플들을 기반으로 현재 블록의 템플릿이 도출되고, 상기 움직임 정보 후보 리스트의 후보들이 가리키는 참조 블록들의 템플릿들이 도출되고,A template of a current block is derived based on surrounding samples of the current block, templates of reference blocks indicated by candidates of the motion information candidate list are derived,
    상기 참조 블록들의 템플릿들 및 상기 현재 블록의 템플릿을 기반으로 상기 후보들의 코스트들이 도출되고, The costs of the candidates are derived based on the templates of the reference blocks and the template of the current block,
    코스트가 작은 순으로 상기 움직임 정보 후보 리스트의 상기 후보들의 순서가 갱신되어 제1 움직임 정보 후보 리스트가 생성되고,The order of the candidates in the motion information candidate list is updated in order of increasing cost to generate a first motion information candidate list,
    상기 제1 움직임 정보 후보 리스트의 첫번째 후보가 나타내는 움직임 벡터 및 나머지 후보들이 나타내는 움직임 벡터들의 방향을 기반으로 상기 나머지 후보들 각각의 우선 순위가 도출되고, The priority of each of the remaining candidates is derived based on the motion vector represented by the first candidate of the first motion information candidate list and the direction of the motion vectors represented by the remaining candidates,
    상기 나머지 후보들 각각의 우선 순위를 기반으로 상기 제1 움직임 정보 후보 리스트가 갱신되어 상기 수정된 움직임 정보 후보 리스트가 생성되는 것을 특징으로 하는 영상 디코딩 방법.Wherein the first motion information candidate list is updated based on a priority of each of the remaining candidates, and the modified motion information candidate list is generated.
  10. 제9항에 있어서,10. The method of claim 9,
    상기 수정된 움직임 정보 후보 리스트는 상기 제1 움직임 정보 후보 리스트의 상기 첫번째 후보 다음으로 가장 높은 우선 순위의 후보에서 가장 낮은 우선 순위의 후보 순서로 정렬되어 생성되는 것을 특징으로 하는 영상 디코딩 방법. Wherein the modified motion information candidate list is generated by arranging in order of highest priority candidate to lowest priority candidate next to the first candidate of the first motion information candidate list.
  11. 제9항에 있어서,10. The method of claim 9,
    상기 제1 움직임 정보 후보 리스트의 후보들은 상기 제1 움직임 정보 후보 리스트의 상기 첫번째 후보 다음으로 가장 높은 우선 순위의 후보에서 가장 낮은 우선 순위의 후보 순서로 정렬되고, The candidates of the first motion information candidate list are arranged in the order of the highest priority candidate to the lowest priority candidate next to the first candidate of the first motion information candidate list,
    상기 정렬된 후보들 중 첫번째 후보 및 두번째 후보를 기반으로 상기 수정된 움직임 정보 후보 리스트가 생성되는 것을 특징으로 하는 영상 디코딩 방법.Wherein the modified motion information candidate list is generated based on the first candidates and the second candidates of the aligned candidates.
  12. 영상 디코딩을 수행하는 디코딩 장치에 있어서,A decoding apparatus for performing image decoding,
    비트스트림을 통하여 현재 블록의 인터 예측에 대한 정보를 획득하는 엔트로피 디코딩부; 및An entropy decoding unit for obtaining information on inter prediction of a current block through a bitstream; And
    상기 현재 블록의 주변 블록들을 기반으로 상기 현재 블록의 움직임 정보 후보 리스트를 생성하고, 상기 움직임 정보 후보 리스트의 후보들을 갱신하여 수정된(modified) 움직임 정보 후보 리스트를 생성하고, 상기 인터 예측에 대한 정보 및 상기 수정된 움직임 정보 리스트를 기반으로 상기 현재 블록의 움직임 정보를 도출하고, 상기 움직임 정보를 기반으로 상기 현재 블록의 인터 예측을 수행하는 예측부를 포함하는 것을 특징으로 하는 디코딩 장치.Generating a motion information candidate list of the current block based on neighboring blocks of the current block, generating a modified motion information candidate list by updating the candidates of the motion information candidate list, And a predictor for deriving motion information of the current block based on the modified motion information list and performing inter prediction of the current block based on the motion information.
  13. 제12항에 있어서,13. The method of claim 12,
    상기 움직임 정보 후보 리스트는 수정된(modified) 후보를 포함하되,Wherein the motion information candidate list includes a modified candidate,
    상기 현재 블록의 템플릿은 상기 현재 블록의 주변 샘플들을 포함하는 특정 영역을 나타내고,Wherein the template of the current block represents a specific region including neighboring samples of the current block,
    인터 예측에 대한 정보를 기반으로 도출된 참조 픽처 내 참조 블록들 중 상기 현재 블록의 템플릿(template)과의 코스트가 최소인 템플릿을 갖는 참조 블록이 특정 참조 블록으로 도출되고,A reference block having a template with a minimum cost with respect to a template of the current block among the reference blocks in reference pictures derived based on information on inter prediction is derived as a specific reference block,
    상기 수정된 후보는 상기 특정 참조 블록을 가리키는 움직임 정보를 나타내는 후보인 것을 특징으로 하는 디코딩 장치.Wherein the modified candidate is a candidate indicating motion information indicating the specific reference block.
  14. 제12항에 있어서,13. The method of claim 12,
    상기 현재 블록의 주변 샘플들을 기반으로 현재 블록의 템플릿이 도출되고, 상기 움직임 정보 후보 리스트의 후보들이 가리키는 참조 블록들의 템플릿들이 도출되고,A template of a current block is derived based on surrounding samples of the current block, templates of reference blocks indicated by candidates of the motion information candidate list are derived,
    상기 참조 블록들의 템플릿들 및 상기 현재 블록의 템플릿을 기반으로 상기 후보들의 코스트들이 도출되고, The costs of the candidates are derived based on the templates of the reference blocks and the template of the current block,
    코스트가 작은 순으로 상기 움직임 정보 후보 리스트의 상기 후보들의 순서가 갱신되어 상기 수정된 움직임 정보 후보 리스트가 생성되되, The order of the candidates in the motion information candidate list is updated in order of decreasing cost to generate the modified motion information candidate list,
    상기 현재 블록의 템플릿은 상기 현재 블록의 주변 샘플들을 포함하는 특정 영역을 나타내는 것을 특징으로 하는 디코딩 장치.Wherein the template of the current block represents a specific region including neighboring samples of the current block.
  15. 제12항에 있어서,13. The method of claim 12,
    상기 움직임 정보 후보 리스트의 첫번째 후보가 나타내는 움직임 벡터 및 나머지 후보들이 나타내는 움직임 벡터들의 방향을 기반으로 상기 나머지 후보들 각각의 우선 순위가 도출되고, The priority of each of the remaining candidates is derived based on the motion vector represented by the first candidate of the motion information candidate list and the direction of the motion vectors represented by the remaining candidates,
    상기 나머지 후보들의 상기 각 후보의 우선 순위를 기반으로 상기 움직임 정보 후보 리스트가 갱신되어 상기 수정된 움직임 정보 후보 리스트가 생성되는 것을 특징으로 하는 디코딩 장치.Wherein the motion information candidate list is updated based on the priorities of the candidates of the remaining candidates, and the modified motion information candidate list is generated.
PCT/KR2017/014073 2017-12-04 2017-12-04 Image decoding method and device on basis of modified motion information candidate list in image coding system WO2019112072A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/KR2017/014073 WO2019112072A1 (en) 2017-12-04 2017-12-04 Image decoding method and device on basis of modified motion information candidate list in image coding system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/KR2017/014073 WO2019112072A1 (en) 2017-12-04 2017-12-04 Image decoding method and device on basis of modified motion information candidate list in image coding system

Publications (1)

Publication Number Publication Date
WO2019112072A1 true WO2019112072A1 (en) 2019-06-13

Family

ID=66751055

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/KR2017/014073 WO2019112072A1 (en) 2017-12-04 2017-12-04 Image decoding method and device on basis of modified motion information candidate list in image coding system

Country Status (1)

Country Link
WO (1) WO2019112072A1 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20140092874A (en) * 2011-11-04 2014-07-24 노키아 코포레이션 Method for video coding and an apparatus
KR20150042164A (en) * 2010-01-19 2015-04-20 삼성전자주식회사 Method and apparatus for encoding/decoding motion vector based on reduced motion vector predictor candidates
KR101700367B1 (en) * 2011-06-27 2017-01-26 삼성전자주식회사 Method and apparatus for decoding an image
WO2017048008A1 (en) * 2015-09-17 2017-03-23 엘지전자 주식회사 Inter-prediction method and apparatus in video coding system
US20170105000A1 (en) * 2011-06-30 2017-04-13 JVC Kenwood Corporation Picture coding device, picture coding method, picture coding program, picture decoding device, picture decoding method, and picture decoding program

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20150042164A (en) * 2010-01-19 2015-04-20 삼성전자주식회사 Method and apparatus for encoding/decoding motion vector based on reduced motion vector predictor candidates
KR101700367B1 (en) * 2011-06-27 2017-01-26 삼성전자주식회사 Method and apparatus for decoding an image
US20170105000A1 (en) * 2011-06-30 2017-04-13 JVC Kenwood Corporation Picture coding device, picture coding method, picture coding program, picture decoding device, picture decoding method, and picture decoding program
KR20140092874A (en) * 2011-11-04 2014-07-24 노키아 코포레이션 Method for video coding and an apparatus
WO2017048008A1 (en) * 2015-09-17 2017-03-23 엘지전자 주식회사 Inter-prediction method and apparatus in video coding system

Similar Documents

Publication Publication Date Title
WO2017188566A1 (en) Inter-prediction method and apparatus in image coding system
WO2018070632A1 (en) Video decoding method and device in video coding system
WO2017052081A1 (en) Inter prediction method and apparatus in image coding system
WO2017022973A1 (en) Inter prediction method and device in video coding system
WO2018117546A1 (en) Video signal processing method and device
WO2017043786A1 (en) Intra prediction method and device in video coding system
WO2017034331A1 (en) Method and device for chroma sample intra prediction in video coding system
WO2017069590A1 (en) Modeling-based image decoding method and device in image coding system
WO2018062702A1 (en) Intra prediction method and apparatus in image coding system
WO2017188565A1 (en) Image decoding method and device in image coding system
WO2017057877A1 (en) Method and apparatus of filtering image in image coding system
WO2018056709A1 (en) Inter-prediction method and device in image coding system
WO2017048008A1 (en) Inter-prediction method and apparatus in video coding system
WO2018021585A1 (en) Method and apparatus for intra-prediction in image coding system
WO2018066791A1 (en) Method and apparatus for decoding image in image coding system
WO2019194507A1 (en) Image coding method based on affine motion prediction, and device for same
WO2018128223A1 (en) Inter-prediction method and apparatus in image coding system
WO2018128222A1 (en) Method and apparatus for image decoding in image coding system
WO2017052272A1 (en) Method and apparatus for intra prediction in video coding system
WO2017195914A1 (en) Inter prediction method and apparatus in video coding system
WO2020141932A1 (en) Inter prediction method and apparatus using cpr-based mmvd
WO2019031703A1 (en) Method and apparatus for image decoding according to linear model in image coding system
WO2019066175A1 (en) Image decoding method and device in accordance with block split structure in image coding system
WO2019194436A1 (en) Image coding method based on motion vector and apparatus therefor
WO2019225932A1 (en) Method and apparatus for decoding image by using dmvr in image coding system

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17933931

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17933931

Country of ref document: EP

Kind code of ref document: A1