KR20210131299A - Method for inter prediction and apparatus thereof - Google Patents

Method for inter prediction and apparatus thereof Download PDF

Info

Publication number
KR20210131299A
KR20210131299A KR1020210144396A KR20210144396A KR20210131299A KR 20210131299 A KR20210131299 A KR 20210131299A KR 1020210144396 A KR1020210144396 A KR 1020210144396A KR 20210144396 A KR20210144396 A KR 20210144396A KR 20210131299 A KR20210131299 A KR 20210131299A
Authority
KR
South Korea
Prior art keywords
motion information
block
current block
reference picture
collocated
Prior art date
Application number
KR1020210144396A
Other languages
Korean (ko)
Other versions
KR102420426B1 (en
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 한국전자통신연구원
Publication of KR20210131299A publication Critical patent/KR20210131299A/en
Priority to KR1020220084353A priority Critical patent/KR102515824B1/en
Application granted granted Critical
Publication of KR102420426B1 publication Critical patent/KR102420426B1/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/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
    • H04N19/577Motion compensation with bidirectional frame interpolation, i.e. using B-pictures
    • 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
    • H04N19/513Processing of motion vectors
    • 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/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/109Selection of coding mode or of prediction mode among a plurality of temporal predictive coding modes
    • 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/124Quantisation
    • 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
    • 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/593Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving spatial prediction techniques
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/70Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by syntax aspects related to video coding, e.g. related to compression standards
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/90Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using coding techniques not provided for in groups H04N19/10-H04N19/85, e.g. fractals
    • H04N19/91Entropy coding, e.g. variable length coding [VLC] or arithmetic coding
    • 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/107Selection of coding mode or of prediction mode between spatial and temporal predictive coding, e.g. picture refresh
    • 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/119Adaptive subdivision aspects, e.g. subdivision of a picture into rectangular or non-rectangular coding blocks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/60Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
    • H04N19/61Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding in combination with predictive coding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/80Details of filtering operations specially adapted for video compression, e.g. for pixel interpolation
    • H04N19/82Details of filtering operations specially adapted for video compression, e.g. for pixel interpolation involving filtering within a prediction loop

Abstract

An image decoding apparatus according to the present invention comprises: a motion prediction part for deriving motion information of a current block as motion information including L0 motion information and L1 motion information; a motion compensation part that generates a prediction block corresponding to the current block by performing motion compensation on the current block based on at least one of the L0 motion information and the L1 motion information; and a reconstructed block generation part that generates a reconstructed block corresponding to the current block based on the prediction block. According to the present invention, image encoding efficiency can be improved.

Description

인터 예측 방법 및 그 장치 {METHOD FOR INTER PREDICTION AND APPARATUS THEREOF}Inter prediction method and device therefor

본 발명은 영상 처리에 관한 것으로서, 보다 상세하게는 인터 예측 방법 및 그 장치에 관한 것이다.The present invention relates to image processing, and more particularly, to an inter prediction method and an apparatus therefor.

최근 HD(High Definition) 해상도를 가지는 방송 서비스가 국내뿐만 아니라 세계적으로 확대되면서, 많은 사용자들이 고해상도, 고화질의 영상에 익숙해지고 있으며 이에 따라 많은 기관들이 차세대 영상기기의 개발에 박차를 가하고 있다. 또한 HDTV와 더불어 HDTV의 4배 이상의 해상도를 갖는 UHD(Ultra High Definition)에 대한 관심이 증대되면서 보다 높은 해상도, 고화질의 영상에 대한 압축기술이 요구되고 있다.Recently, as broadcasting services with high definition (HD) resolution are expanding not only domestically but also worldwide, many users are getting used to high-resolution and high-definition images, and accordingly, many institutions are spurring the development of next-generation imaging devices. In addition, as interest in UHD (Ultra High Definition) having a resolution four times higher than that of HDTV increases along with HDTV, compression technology for higher resolution and high-definition images is required.

영상 압축을 위해, 시간적으로 이전 및/또는 이후의 픽쳐로부터 현재 픽쳐에 포함된 픽셀값을 예측하는 인터(inter) 예측 기술, 현재 픽쳐 내의 픽셀 정보를 이용하여 현재 픽쳐에 포함된 픽셀값을 예측하는 인트라(intra) 예측 기술, 출현 빈도가 높은 심볼(symbol)에 짧은 부호를 할당하고 출현 빈도가 낮은 심볼에 긴 부호를 할당하는 엔트로피 부호화 기술 등이 사용될 수 있다.For image compression, inter prediction technology that predicts pixel values included in the current picture from temporally previous and/or later pictures, predicting pixel values included in the current picture using pixel information in the current picture An intra prediction technique, an entropy encoding technique in which a short code is assigned to a symbol having a high frequency of occurrence and a long code is assigned to a symbol having a low frequency of occurrence, may be used.

본 발명의 기술적 과제는 영상 부호화 효율을 향상시킬 수 있는 영상 부호화 방법 및 그 장치를 제공함에 있다.An object of the present invention is to provide an image encoding method and apparatus capable of improving image encoding efficiency.

본 발명의 다른 기술적 과제는 영상 부호화 효율을 향상시킬 수 있는 영상 복호화 방법 및 그 장치를 제공함에 있다.Another technical object of the present invention is to provide an image decoding method and apparatus capable of improving image encoding efficiency.

본 발명의 또 다른 기술적 과제는 영상 부호화 효율을 향상시킬 수 있는 인터 예측 방법 및 그 장치를 제공함에 있다.Another technical object of the present invention is to provide an inter prediction method and apparatus for improving image encoding efficiency.

본 발명의 또 다른 기술적 과제는 영상 부호화 효율을 향상시킬 수 있는 움직임 정보 도출 방법 및 그 장치를 제공함에 있다.Another technical object of the present invention is to provide a method and apparatus for deriving motion information capable of improving image encoding efficiency.

본 발명의 또 다른 기술적 과제는 영상 부호화 효율을 향상시킬 수 있는 시간적 움직임 정보 도출 방법 및 그 장치를 제공함에 있다.Another technical object of the present invention is to provide a method and apparatus for deriving temporal motion information capable of improving image encoding efficiency.

본 발명의 일 실시 형태는 영상 복호화 장치이다. 상기 장치는, L0 움직임 정보 및 L1 움직임 정보를 포함하는 움직임 정보로서 현재 블록의 움직임 정보를 도출하는 움직임 예측부, 상기 L0 움직임 정보 및 상기 L1 움직임 정보 중에서 적어도 하나를 기반으로 상기 현재 블록에 대해 움직임 보상을 수행함으로써, 상기 현재 블록에 대응하는 예측 블록을 생성하는 움직임 보상부 및 상기 예측 블록을 기반으로 상기 현재 블록에 대응하는 복원 블록을 생성하는 복원 블록 생성부를 포함하되, 상기 움직임 보상부는, 상기 L0 움직임 정보 및 상기 L1 움직임 정보의 동일성 여부를 기반으로 상기 움직임 보상을 수행한다.One embodiment of the present invention is an image decoding apparatus. The apparatus includes a motion predictor for deriving motion information of a current block as motion information including L0 motion information and L1 motion information, and a motion with respect to the current block based on at least one of the L0 motion information and the L1 motion information. A motion compensation unit generating a prediction block corresponding to the current block by performing compensation and a reconstructed block generation unit generating a reconstructed block corresponding to the current block based on the prediction block, wherein the motion compensator comprises: The motion compensation is performed based on whether the L0 motion information and the L1 motion information are identical.

상기 L0 움직임 정보는 L0 움직임 벡터 및 L0 참조 픽쳐 번호를 포함하고, 상기 L0 참조 픽쳐 번호는 L0 참조 픽쳐에 할당된 POC(Picture Order Count)를 지시하고, 상기 L1 움직임 정보는 L1 움직임 벡터 및 L1 참조 픽쳐 번호를 포함하고, 상기 L1 참조 픽쳐 번호는 L1 참조 픽쳐에 할당된 POC(Picture Order Count)를 지시할 수 있다.The L0 motion information includes an L0 motion vector and an L0 reference picture number, the L0 reference picture number indicates a picture order count (POC) assigned to an L0 reference picture, and the L1 motion information refers to an L1 motion vector and L1 It includes a picture number, and the L1 reference picture number may indicate a picture order count (POC) allocated to the L1 reference picture.

상기 L0 움직임 벡터 및 상기 L1 움직임 벡터가 동일하고 상기 L0 참조 픽쳐 번호 및 상기 L1 참조 픽쳐 번호가 동일한 경우, 상기 움직임 보상부는, 상기 L0 움직임 정보 및 상기 L1 움직임 정보 중에서 상기 L0 움직임 정보를 기반으로 하여 단예측(uni prediction)을 수행할 수 있다.When the L0 motion vector and the L1 motion vector are the same and the L0 reference picture number and the L1 reference picture number are the same, the motion compensator is configured to: Based on the L0 motion information among the L0 motion information and the L1 motion information, Uni prediction can be performed.

상기 L0 움직임 벡터 및 상기 L1 움직임 벡터가 서로 동일하지 않거나 상기 L0 참조 픽쳐 번호 및 상기 L1 참조 픽쳐 번호가 서로 동일하지 않은 경우, 상기 움직임 보상부는, 상기 L0 움직임 정보 및 상기 L1 움직임 정보를 기반으로 하여 쌍예측(bi prediction)을 수행할 수 있다.When the L0 motion vector and the L1 motion vector are not identical to each other or the L0 reference picture number and the L1 reference picture number are not identical to each other, the motion compensator is configured to: Bi prediction can be performed.

본 발명의 다른 실시 형태는 영상 복호화 장치이다. 상기 장치는, L0 움직임 정보 및 L1 움직임 정보를 포함하는 움직임 정보로서 현재 블록의 움직임 정보를 도출하는 움직임 예측부, 상기 L0 움직임 정보 및 상기 L1 움직임 정보 중에서 적어도 하나를 기반으로 상기 현재 블록에 대해 움직임 보상을 수행함으로써, 상기 현재 블록에 대응하는 예측 블록을 생성하는 움직임 보상부 및 상기 예측 블록을 기반으로 상기 현재 블록에 대응하는 복원 블록을 생성하는 복원 블록 생성부를 포함하되, 상기 움직임 보상부는, 상기 현재 블록의 크기를 기반으로 상기 움직임 보상을 수행한다.Another embodiment of the present invention is an image decoding apparatus. The apparatus includes a motion predictor for deriving motion information of a current block as motion information including L0 motion information and L1 motion information, and a motion with respect to the current block based on at least one of the L0 motion information and the L1 motion information. A motion compensation unit generating a prediction block corresponding to the current block by performing compensation and a reconstructed block generation unit generating a reconstructed block corresponding to the current block based on the prediction block, wherein the motion compensator comprises: The motion compensation is performed based on the size of the current block.

상기 현재 블록의 크기가 소정의 크기보다 작은 경우, 상기 움직임 보상부는, 상기 L0 움직임 정보 및 상기 L1 움직임 정보 중에서 상기 L0 움직임 정보를 기반으로 하여 단예측(uni prediction)을 수행할 수 있다.When the size of the current block is smaller than a predetermined size, the motion compensator may perform uni prediction based on the L0 motion information among the L0 motion information and the L1 motion information.

상기 소정의 크기는 8x8일 수 있다.The predetermined size may be 8x8.

본 발명의 또 다른 실시 형태는 영상 복호화 장치이다. 상기 장치는, 이미 복원된 픽쳐로부터 움직임 정보를 도출하는 움직임 예측부, 상기 도출된 움직임 정보를 기반으로 현재 블록에 대응하는 예측 블록을 생성하는 움직임 보상부 및 상기 예측 블록을 기반으로 상기 현재 블록에 대응하는 복원 블록을 생성하는 복원 블록 생성부를 포함하되, 상기 움직임 정보는 움직임 벡터 및 참조 픽쳐 인덱스(reference picture index)를 포함하고, 상기 움직임 예측부는, 상기 참조 픽쳐 인덱스를 0으로 설정하고, 상기 이미 복원된 픽쳐 내에서 상기 현재 블록에 대응하는 콜 블록(col block)을 기반으로 상기 움직임 벡터를 도출한다.Another embodiment of the present invention is an image decoding apparatus. The apparatus includes a motion prediction unit for deriving motion information from an already reconstructed picture, a motion compensation unit for generating a prediction block corresponding to the current block based on the derived motion information, and a prediction block for the current block based on the prediction block. a reconstructed block generating unit generating a corresponding reconstructed block, wherein the motion information includes a motion vector and a reference picture index, and the motion prediction unit sets the reference picture index to 0, and The motion vector is derived based on a col block corresponding to the current block in the reconstructed picture.

상기 현재 블록의 부호화 모드는 머지(merge) 모드이고, 상기 움직임 보상부는, 상기 시간적 움직임 정보를 상기 현재 블록의 움직임 정보로 선택하고, 상기 선택된 움직임 정보를 기반으로 움직임 보상을 수행함으로써, 상기 현재 블록에 대응하는 예측 블록을 생성할 수 있다.The encoding mode of the current block is a merge mode, and the motion compensator selects the temporal motion information as the motion information of the current block and performs motion compensation based on the selected motion information, so that the current block It is possible to generate a prediction block corresponding to .

본 발명에 따른 영상 부호화 방법에 의하면, 영상 부호화 효율이 향상될 수 있다.According to the image encoding method according to the present invention, image encoding efficiency can be improved.

본 발명에 따른 영상 복호화 방법에 의하면, 영상 부호화 효율이 향상될 수 있다.According to the image decoding method according to the present invention, image encoding efficiency can be improved.

본 발명에 따른 인터 예측 방법에 의하면, 영상 부호화 효율이 향상될 수 있다.According to the inter prediction method according to the present invention, image encoding efficiency can be improved.

본 발명에 따른 움직임 정보 도출 방법에 의하면, 영상 부호화 효율이 향상될 수 있다.According to the method for deriving motion information according to the present invention, image encoding efficiency can be improved.

본 발명에 따른 시간적 움직임 정보 도출 방법에 의하면, 영상 부호화 효율이 향상될 수 있다.According to the method for deriving temporal motion information according to the present invention, image encoding efficiency can be improved.

도 1은 본 발명이 적용되는 영상 부호화 장치의 일 실시예에 따른 구성을 나타내는 블록도이다.
도 2는 본 발명이 적용되는 영상 복호화 장치의 일 실시예에 따른 구성을 나타내는 블록도이다.
도 3은 인터 예측 방법의 일 실시예를 개략적으로 나타내는 흐름도이다.
도 4는 양방향 예측이 적용되는 경우, 인터 예측 방법의 실시예를 개략적으로 나타내는 도면이다.
도 5는 부호화된 영상의 움직임 정보의 일 실시예를 개략적으로 나타내는 도면이다.
도 6은 본 발명에 따른 현재 블록의 시간적 움직임 정보 도출 방법의 일 실시예를 개략적으로 나타내는 흐름도이다.
도 7은 L1 시간적 움직임 정보의 재설정을 위해 사용되는 복원된 주변 블록의 실시예를 개략적으로 나타내는 도면이다.
도 8은 도 6의 실시예에 따른 시간적 움직임 정보 도출 과정을 수행할 수 있는 인터 예측 장치의 일 실시예를 개략적으로 나타내는 블록도이다.
도 9는 본 발명에 따른 현재 블록의 시간적 움직임 정보 도출 방법의 다른 실시예를 개략적으로 나타내는 흐름도이다.
도 10은 L1 시간적 움직임 정보의 재설정을 위해 사용되는 제2 콜 블록의 실시예를 개략적으로 나타내는 도면이다.
도 11은 도 9의 실시예에 따른 시간적 움직임 정보 도출 과정을 수행할 수 있는 인터 예측 장치의 일 실시예를 개략적으로 나타내는 블록도이다.
도 12는 본 발명에 따른 현재 블록의 움직임 정보 도출 방법의 실시예를 개략적으로 나타내는 도면이다.
도 13은 도 12의 실시예에 따른 움직임 정보 도출 과정을 수행할 수 있는 인터 예측 장치의 일 실시예를 개략적으로 나타내는 블록도이다.
도 14는 본 발명에 따른 현재 블록의 시간적 움직임 정보 도출 방법의 또 다른 실시예를 개략적으로 나타내는 흐름도이다.
도 15는 도 14의 실시예에 따른 시간적 움직임 정보 도출 과정을 수행할 수 있는 인터 예측 장치의 일 실시예를 개략적으로 나타내는 블록도이다.
1 is a block diagram illustrating a configuration of an image encoding apparatus to which the present invention is applied according to an embodiment.
2 is a block diagram illustrating a configuration of an image decoding apparatus to which the present invention is applied according to an embodiment.
3 is a flowchart schematically illustrating an embodiment of an inter prediction method.
4 is a diagram schematically illustrating an embodiment of an inter prediction method when bidirectional prediction is applied.
5 is a diagram schematically illustrating an embodiment of motion information of an encoded image.
6 is a flowchart schematically illustrating an embodiment of a method for deriving temporal motion information of a current block according to the present invention.
7 is a diagram schematically illustrating an embodiment of a reconstructed neighboring block used for resetting L1 temporal motion information.
8 is a block diagram schematically illustrating an embodiment of an inter prediction apparatus capable of performing a process of deriving temporal motion information according to the embodiment of FIG. 6 .
9 is a flowchart schematically illustrating another embodiment of a method for deriving temporal motion information of a current block according to the present invention.
10 is a diagram schematically illustrating an embodiment of a second collocated block used for resetting L1 temporal motion information.
11 is a block diagram schematically illustrating an embodiment of an inter prediction apparatus capable of performing a process of deriving temporal motion information according to the embodiment of FIG. 9 .
12 is a diagram schematically illustrating an embodiment of a method for deriving motion information of a current block according to the present invention.
13 is a block diagram schematically illustrating an embodiment of an inter prediction apparatus capable of performing a process of deriving motion information according to the embodiment of FIG. 12 .
14 is a flowchart schematically illustrating another embodiment of a method for deriving temporal motion information of a current block according to the present invention.
15 is a block diagram schematically illustrating an embodiment of an inter prediction apparatus capable of performing a process of deriving temporal motion information according to the embodiment of FIG. 14 .

이하, 도면을 참조하여 본 발명의 실시 형태에 대하여 구체적으로 설명한다. 본 명세서의 실시예를 설명함에 있어, 관련된 공지 구성 또는 기능에 대한 구체적인 설명이 본 명세서의 요지를 흐릴 수 있다고 판단되는 경우에는 그 상세한 설명은 생략한다.EMBODIMENT OF THE INVENTION Hereinafter, embodiment of this invention is concretely described with reference to drawings. In describing the embodiments of the present specification, if it is determined that a detailed description of a related known configuration or function may obscure the gist of the present specification, the detailed description thereof will be omitted.

어떤 구성 요소가 다른 구성 요소에 “연결되어” 있다거나 “접속되어” 있다고 언급된 때에는, 그 다른 구성 요소에 직접적으로 연결되어 있거나 또는 접속되어 있을 수도 있으나, 중간에 다른 구성 요소가 존재할 수도 있다고 이해되어야 할 것이다. 아울러, 본 발명에서 특정 구성을 “포함”한다고 기술하는 내용은 해당 구성 이외의 구성을 배제하는 것이 아니며, 추가적인 구성이 본 발명의 실시 또는 본 발명의 기술적 사상의 범위에 포함될 수 있음을 의미한다. When it is said that a component is “connected” or “connected” to another component, it may be directly connected or connected to the other component, but it is understood that other components may exist in between. it should be In addition, the content described as “including” a specific configuration in the present invention does not exclude configurations other than the corresponding configuration, and means that additional configurations may be included in the practice of the present invention or the scope of the technical spirit of the present invention.

제1, 제2 등의 용어는 다양한 구성요소들을 설명하는데 사용될 수 있지만, 상기 구성요소들은 상기 용어들에 의해 한정되어서는 안 된다. 상기 용어들은 하나의 구성요소를 다른 구성요소로부터 구별하는 목적으로만 사용된다. 예를 들어, 본 발명의 권리 범위를 벗어나지 않으면서 제1 구성요소는 제2 구성요소로 명명될 수 있고, 유사하게 제2 구성요소도 제1 구성요소로 명명될 수 있다.Terms such as first, second, etc. may be used to describe various elements, but the elements should not be limited by the terms. The above terms are used only for the purpose of distinguishing one component from another. For example, without departing from the scope of the present invention, a first component may be referred to as a second component, and similarly, a second component may also be referred to as a first component.

또한 본 발명의 실시예에 나타나는 구성부들은 서로 다른 특징적인 기능들을 나타내기 위해 독립적으로 도시되는 것으로, 각 구성부들이 분리된 하드웨어나 하나의 소프트웨어 구성단위로 이루어짐을 의미하지 않는다. 즉, 각 구성부는 설명의 편의상 각각의 구성부로 나열하여 포함한 것으로 각 구성부 중 적어도 두 개의 구성부가 합쳐져 하나의 구성부로 이루어지거나, 하나의 구성부가 복수 개의 구성부로 나뉘어져 기능을 수행할 수 있고 이러한 각 구성부의 통합된 실시예 및 분리된 실시예도 본 발명의 본질에서 벗어나지 않는 한 본 발명의 권리범위에 포함된다.In addition, the components shown in the embodiment of the present invention are shown independently to represent different characteristic functions, and it does not mean that each component is composed of separate hardware or a single software component. That is, each component is listed as each component for convenience of description, and at least two components of each component are combined to form one component, or one component can be divided into a plurality of components to perform a function, and each Integrated embodiments and separate embodiments of components are also included in the scope of the present invention without departing from the essence of the present invention.

또한, 일부의 구성 요소는 본 발명에서 본질적인 기능을 수행하는 필수적인 구성 요소는 아니고 단지 성능을 향상시키기 위한 선택적 구성 요소일 수 있다. 본 발명은 단지 성능 향상을 위해 사용되는 구성 요소를 제외한 본 발명의 본질을 구현하는데 필수적인 구성부만을 포함하여 구현될 수 있고, 단지 성능 향상을 위해 사용되는 선택적 구성 요소를 제외한 필수 구성 요소만을 포함한 구조도 본 발명의 권리범위에 포함된다.In addition, some of the components are not essential components for performing essential functions in the present invention, but may be optional components for merely improving performance. The present invention can be implemented by including only essential components to implement the essence of the present invention, except for components used for performance improvement, and a structure including only essential components excluding optional components used for performance improvement Also included in the scope of the present invention.

도 1은 본 발명이 적용되는 영상 부호화 장치의 일 실시예에 따른 구성을 나타내는 블록도이다.1 is a block diagram illustrating a configuration of an image encoding apparatus to which the present invention is applied according to an embodiment.

도 1을 참조하면, 상기 영상 부호화 장치(100)는 움직임 예측부(111), 움직임 보상부(112), 인트라 예측부(120), 스위치(115), 감산기(125), 변환부(130), 양자화부(140), 엔트로피 부호화부(150), 역양자화부(160), 역변환부(170), 가산기(175), 필터부(180) 및 참조 픽쳐 버퍼(190)를 포함한다. Referring to FIG. 1 , the image encoding apparatus 100 includes a motion prediction unit 111 , a motion compensation unit 112 , an intra prediction unit 120 , a switch 115 , a subtractor 125 , and a transform unit 130 . , a quantizer 140 , an entropy encoder 150 , an inverse quantizer 160 , an inverse transform unit 170 , an adder 175 , a filter unit 180 , and a reference picture buffer 190 .

영상 부호화 장치(100)는 입력 영상에 대해 인트라(intra) 모드 또는 인터(inter) 모드로 부호화를 수행하고 비트스트림을 출력할 수 있다. 인트라 예측은 화면 내 예측, 인터 예측은 화면 간 예측을 의미한다. 인트라 모드인 경우 스위치(115)가 인트라로 전환되고, 인터 모드인 경우 스위치(115)가 인터로 전환될 수 있다. 영상 부호화 장치(100)는 입력 영상의 입력 블록에 대한 예측 블록을 생성한 후, 입력 블록과 예측 블록의 차분(residual)을 부호화할 수 있다.The image encoding apparatus 100 may encode an input image in an intra mode or an inter mode and output a bitstream. Intra prediction refers to intra prediction, and inter prediction refers to inter prediction. In the intra mode, the switch 115 may be switched to the intra mode, and in the inter mode, the switch 115 may be switched to the inter mode. The image encoding apparatus 100 may generate a prediction block for an input block of an input image, and then encode a residual between the input block and the prediction block.

인트라 모드인 경우, 인트라 예측부(120)는 현재 블록 주변의 이미 부호화된 블록의 픽셀값을 이용하여 공간적 예측을 수행하여 예측 블록을 생성할 수 있다.In the intra mode, the intra prediction unit 120 may generate a prediction block by performing spatial prediction using pixel values of an already encoded block around the current block.

인터 모드인 경우, 움직임 예측부(motion estimator)(111)는, 움직임 예측 과정에서 참조 픽쳐 버퍼(190)에 저장되어 있는 참조 영상에서 입력 블록과 가장 매치가 잘 되는 영역을 찾아 움직임 벡터를 구할 수 있다. 움직임 보상부(112)는 움직임 벡터를 이용하여 움직임 보상을 수행함으로써 예측 블록을 생성할 수 있다. In the inter mode, the motion estimator 111 may obtain a motion vector by finding a region that best matches the input block in the reference image stored in the reference picture buffer 190 during the motion prediction process. have. The motion compensator 112 may generate a prediction block by performing motion compensation using a motion vector.

감산기(125)는 입력 블록과 생성된 예측 블록의 차분에 의해 잔차 블록(residual block)을 생성할 수 있다. 변환부(130)는 잔차 블록에 대해 변환(transform)을 수행하여 변환 계수(transform coefficient)를 출력할 수 있다. 그리고 양자화부(140)는 입력된 변환 계수를 양자화 파라미터에 따라 양자화하여 양자화된 계수(quantized coefficient)를 출력할 수 있다. The subtractor 125 may generate a residual block by the difference between the input block and the generated prediction block. The transform unit 130 may perform transform on the residual block to output a transform coefficient. In addition, the quantization unit 140 may quantize the input transform coefficient according to the quantization parameter to output a quantized coefficient.

엔트로피 부호화부(150)는, 양자화부(140)에서 산출된 값(예를 들어, 양자화된 계수)들 및/또는 부호화 과정에서 산출된 부호화 파라미터 값 등을 기초로 엔트로피 부호화를 수행하여 비트스트림(bit stream)을 출력할 수 있다. The entropy encoding unit 150 performs entropy encoding on the basis of values (eg, quantized coefficients) calculated by the quantization unit 140 and/or encoding parameter values calculated in the encoding process to perform entropy encoding on the bitstream ( bit stream) can be output.

엔트로피 부호화가 적용되는 경우, 높은 발생 확률을 갖는 심볼(symbol)에 적은 수의 비트가 할당되고 낮은 발생 확률을 갖는 심볼에 많은 수의 비트가 할당되어 심볼이 표현됨으로써, 부호화 대상 심볼들에 대한 비트열의 크기가 감소될 수 있다. 따라서 엔트로피 부호화를 통해서 영상 부호화의 압축 성능이 높아질 수 있다. 엔트로피 부호화부(150)는 엔트로피 부호화를 위해 지수 골룸(exponential golomb), CAVLC(Context-Adaptive Variable Length Coding), CABAC(Context-Adaptive Binary Arithmetic Coding)과 같은 부호화 방법을 사용할 수 있다. When entropy encoding is applied, a small number of bits are allocated to a symbol having a high probability of occurrence and a large number of bits are allocated to a symbol having a low probability of occurrence to express the symbol, so that bits for symbols to be encoded The size of the column may be reduced. Accordingly, compression performance of image encoding may be improved through entropy encoding. The entropy encoder 150 may use an encoding method such as exponential golomb, Context-Adaptive Variable Length Coding (CAVLC), or Context-Adaptive Binary Arithmetic Coding (CABAC) for entropy encoding.

도 1의 실시예에 따른 영상 부호화 장치는 인터 예측 부호화, 즉 화면 간(inter-frame) 예측 부호화를 수행하므로, 현재 부호화된 영상은 참조 영상으로 사용되기 위해 복호화되어 저장될 필요가 있다. 따라서 양자화된 계수는 역양자화부(160)에서 역양자화되고 역변환부(170)에서 역변환된다. 역양자화, 역변환된 계수는 가산기(175)를 통해 예측 블록과 더해지고 복원 블록이 생성된다. Since the image encoding apparatus according to the embodiment of FIG. 1 performs inter prediction encoding, that is, inter-frame prediction encoding, the currently encoded image needs to be decoded and stored to be used as a reference image. Accordingly, the quantized coefficients are inverse quantized by the inverse quantization unit 160 and inversely transformed by the inverse transform unit 170 . The inverse-quantized and inverse-transformed coefficients are added to the prediction block through the adder 175, and a reconstructed block is generated.

복원 블록은 필터부(180)를 거치고, 필터부(180)는 디블록킹 필터(deblocking filter), SAO(Sample Adaptive Offset), ALF(Adaptive Loop Filter) 중 적어도 하나 이상을 복원 블록 또는 복원 픽쳐에 적용할 수 있다. 필터부(180)는 적응적 인루프(in-loop) 필터로 불릴 수도 있다. 디블록킹 필터는 블록 간의 경계에 생긴 블록 왜곡 및/또는 블록킹 아티팩트(blocking artifact)를 제거할 수 있다. SAO는 코딩 에러를 보상하기 위해 픽셀값에 적정 오프셋(offset) 값을 더해줄 수 있다. ALF는 복원된 영상과 원래의 영상을 비교한 값을 기초로 필터링을 수행할 수 있으며, 고효율이 적용되는 경우에만 수행될 수도 있다. 필터부(180)를 거친 복원 블록은 참조 픽쳐 버퍼(190)에 저장될 수 있다.The reconstructed block passes through the filter unit 180, and the filter unit 180 applies at least one of a deblocking filter, a sample adaptive offset (SAO), and an adaptive loop filter (ALF) to the reconstructed block or the reconstructed picture. can do. The filter unit 180 may be referred to as an adaptive in-loop filter. The deblocking filter may remove block distortion and/or blocking artifacts generated at the boundary between blocks. The SAO may add an appropriate offset value to the pixel value to compensate for the coding error. ALF may perform filtering based on a comparison value between the reconstructed image and the original image, and may be performed only when high efficiency is applied. The reconstructed block passing through the filter unit 180 may be stored in the reference picture buffer 190 .

도 2는 본 발명이 적용되는 영상 복호화 장치의 일 실시예에 따른 구성을 나타내는 블록도이다.2 is a block diagram illustrating a configuration of an image decoding apparatus to which the present invention is applied according to an embodiment.

*도 2를 참조하면, 상기 영상 복호화 장치(200)는 엔트로피 복호화부(210), 역양자화부(220), 역변환부(230), 인트라 예측부(240), 움직임 보상부(250), 가산기(255), 필터부(260) 및 참조 픽쳐 버퍼(270)를 포함한다.* Referring to FIG. 2 , the image decoding apparatus 200 includes an entropy decoding unit 210 , an inverse quantization unit 220 , an inverse transform unit 230 , an intra prediction unit 240 , a motion compensation unit 250 , and an adder. 255 , a filter unit 260 and a reference picture buffer 270 .

영상 복호화 장치(200)는 부호화기에서 출력된 비트스트림을 입력 받아 인트라 모드 또는 인터 모드로 복호화를 수행하고 재구성된 영상, 즉 복원 영상을 출력할 수 있다. 인트라 모드인 경우 스위치가 인트라로 전환되고, 인터 모드인 경우 스위치가 인터로 전환될 수 있다. 영상 복호화 장치(200)는 입력 받은 비트스트림으로부터 잔차 블록(residual block)을 얻고 예측 블록을 생성한 후 잔차 블록과 예측 블록을 더하여 재구성된 블록, 즉 복원 블록을 생성할 수 있다.The image decoding apparatus 200 may receive a bitstream output from the encoder, perform decoding in an intra mode or an inter mode, and output a reconstructed image, that is, a reconstructed image. In the case of the intra mode, the switch may be switched to the intra mode, and in the case of the inter mode, the switch may be switched to the inter mode. The image decoding apparatus 200 may generate a reconstructed block, that is, a reconstructed block, by obtaining a residual block from the received bitstream, generating a prediction block, and adding the residual block and the prediction block.

엔트로피 복호화부(210)는, 입력된 비트스트림을 확률 분포에 따라 엔트로피 복호화하여, 양자화된 계수(quantized coefficient) 형태의 심볼을 포함한 심볼들을 생성할 수 있다. 엔트로피 복호화 방법은 상술한 엔트로피 부호화 방법과 유사하다.The entropy decoding unit 210 may entropy-decode the input bitstream according to a probability distribution to generate symbols including symbols in the form of quantized coefficients. The entropy decoding method is similar to the entropy encoding method described above.

엔트로피 복호화 방법이 적용되는 경우, 높은 발생 확률을 갖는 심볼에 적은 수의 비트가 할당되고 낮은 발생 확률을 갖는 심볼에 많은 수의 비트가 할당되어 심볼이 표현됨으로써, 각 심볼들에 대한 비트열의 크기가 감소될 수 있다. 따라서 엔트로피 복호화 방법을 통해서 영상 복호화의 압축 성능이 높아질 수 있다. When the entropy decoding method is applied, a small number of bits are allocated to a symbol having a high occurrence probability and a large number of bits are allocated to a symbol having a low occurrence probability to represent the symbol, so that the size of the bit stream for each symbol is can be reduced. Accordingly, compression performance of image decoding may be improved through the entropy decoding method.

양자화된 계수는 역양자화부(220)에서 역양자화되고 역변환부(230)에서 역변환되며, 양자화된 계수가 역양자화/역변환 된 결과, 잔차 블록(residual block)이 생성될 수 있다. The quantized coefficient is inverse quantized by the inverse quantizer 220 and inverse transformed by the inverse transform unit 230 , and as a result of inverse quantization/inverse transformation of the quantized coefficient, a residual block may be generated.

인트라 모드인 경우, 인트라 예측부(240)는 현재 블록 주변의 이미 복호화된 블록의 픽셀값을 이용하여 공간적 예측을 수행하여 예측 블록을 생성할 수 있다. 인터 모드인 경우, 움직임 보상부(250)는 움직임 벡터 및 참조 픽쳐 버퍼(270)에 저장되어 있는 참조 영상을 이용하여 움직임 보상을 수행함으로써 예측 블록을 생성할 수 있다. In the intra mode, the intra prediction unit 240 may generate a prediction block by performing spatial prediction using pixel values of an already decoded block around the current block. In the inter mode, the motion compensator 250 may generate a prediction block by performing motion compensation using a motion vector and a reference image stored in the reference picture buffer 270 .

잔차 블록과 예측 블록은 가산기(255)를 통해 더해지고, 더해진 블록은 필터부(260)를 거칠 수 있다. 필터부(260)는 디블록킹 필터, SAO, ALF 중 적어도 하나 이상을 복원 블록 또는 복원 픽쳐에 적용할 수 있다. 필터부(260)는 재구성된 영상, 즉 복원 영상을 출력할 수 있다. 복원 영상은 참조 픽쳐 버퍼(270)에 저장되어 인터 예측에 사용될 수 있다.The residual block and the prediction block may be added through the adder 255 , and the added block may pass through the filter unit 260 . The filter unit 260 may apply at least one of a deblocking filter, SAO, and ALF to a reconstructed block or a reconstructed picture. The filter unit 260 may output a reconstructed image, that is, a reconstructed image. The reconstructed image may be stored in the reference picture buffer 270 and used for inter prediction.

이하, 블록은 영상 부호화 및 복호화의 단위를 의미한다. 영상 부호화 및 복호화 시 부호화 혹은 복호화 단위는, 영상을 분할하여 부호화 혹은 복호화 할 때 그 분할된 단위를 의미하므로, 부호화 유닛 (CU: Coding Unit), 예측 유닛 (PU: Prediction Unit), 변환 유닛(TU: Transform Unit), 변환 블록(transform block) 등으로 불릴 수 있다. 하나의 블록은 크기가 더 작은 하위 블록으로 더 분할될 수 있다. 또한, 본 명세서에서 “픽쳐”는 문맥에 따라 “프레임”, “필드” 및/또는 “슬라이스”로 대체되어 사용될 수 있으며, 이러한 구분은 해당 기술 분야에서 통상의 지식을 가진 자라면 용이하게 할 수 있을 것이다. 예를 들어, 후술되는 P 픽쳐, B 픽쳐, 순방향 B 픽쳐는 문맥에 따라 각각 P 슬라이스, B 슬라이스, 순방향 B 슬라이스로 대체되어 사용될 수 있다.Hereinafter, a block means a unit of image encoding and decoding. When encoding and decoding an image, an encoding or decoding unit means a divided unit when encoding or decoding an image by dividing an image. Therefore, a coding unit (CU), a prediction unit (PU: prediction unit), and a transformation unit (TU) : Transform Unit), may be called a transform block (transform block), etc. One block may be further divided into smaller sub-blocks. In addition, in the present specification, “picture” may be used instead of “frame”, “field” and/or “slice” depending on the context, and such a distinction can be easily made by those of ordinary skill in the art. There will be. For example, a P picture, a B picture, and a forward B picture to be described later may be replaced with a P slice, a B slice, and a forward B slice, respectively, depending on context.

도 3은 인터 예측 방법의 일 실시예를 개략적으로 나타내는 흐름도이다.3 is a flowchart schematically illustrating an embodiment of an inter prediction method.

도 3을 참조하면, 부호화기 및 복호화기는 현재 블록에 대한 움직임 정보를 도출할 수 있다(S310). Referring to FIG. 3 , the encoder and the decoder may derive motion information for the current block ( S310 ).

인터 모드에서 부호화기 및 복호화기는 현재 블록의 움직임 정보를 도출한 후, 상기 도출된 움직임 정보에 기반하여 인터 예측 및/또는 움직임 보상을 수행할 수 있다. 이 때, 부호화기 및 복호화기는 복원된 주변 블록(neighboring block) 및/또는 이미 복원된 콜(col) 픽쳐(collocated picture) 내에서 현재 블록에 대응되는 콜(col) 블록(collocated block)의 움직임 정보를 이용함으로써, 부호화/복호화 효율을 향상시킬 수 있다. 여기서, 복원된 주변 블록은 이미 부호화 및/또는 복호화되어 복원된 현재 픽쳐 내의 블록으로서, 현재 블록에 인접한 블록 및/또는 현재 블록의 외부 코너에 위치한 블록을 포함할 수 있다. 또한 부호화기 및 복호화기는, 콜 픽쳐 내에서 현재 블록과 공간적으로 동일한 위치에 존재하는 블록을 기준으로 소정의 상대적인 위치를 결정할 수 있고, 상기 결정된 소정의 상대적인 위치(상기 현재 블록과 공간적으로 동일한 위치에 존재하는 블록의 내부 및/또는 외부의 위치)를 기반으로 상기 콜 블록을 도출할 수 있다. 여기서, 일례로 콜 픽쳐는 참조 픽쳐 리스트에 포함된 참조 픽쳐 중에서 하나의 픽쳐에 해당될 수 있다.In the inter mode, the encoder and the decoder may derive motion information of the current block and then perform inter prediction and/or motion compensation based on the derived motion information. At this time, the encoder and the decoder obtain the motion information of the collocated block corresponding to the current block in the reconstructed neighboring block and/or the collocated picture that has already been reconstructed. By using it, encoding/decoding efficiency can be improved. Here, the reconstructed neighboring block is a block in the reconstructed current picture that has already been encoded and/or decoded, and may include a block adjacent to the current block and/or a block located at an outer corner of the current block. In addition, the encoder and the decoder may determine a predetermined relative position based on a block existing at the same spatial position as the current block in the collocated picture, and the determined relative position (existing at the same spatial position as the current block) The collocated block can be derived based on the position inside and/or outside the block). Here, as an example, the collocated picture may correspond to one of the reference pictures included in the reference picture list.

한편, 움직임 정보 도출 방식은 현재 블록의 예측 모드에 따라 달라질 수 있다. 인터 예측을 위해 적용되는 예측 모드에는 AMVP(Advanced Motion Vector Predictor), 머지(merge) 등이 있을 수 있다.Meanwhile, the method of deriving motion information may vary depending on the prediction mode of the current block. Prediction modes applied for inter prediction may include Advanced Motion Vector Predictor (AMVP), merge, and the like.

일례로, AMVP(Advanced Motion Vector Predictor)가 적용되는 경우, 부호화기 및 복호화기는 복원된 주변 블록의 움직임 벡터 및/또는 콜 블록의 움직임 벡터를 이용하여, 예측 움직임 벡터 후보 리스트를 생성할 수 있다. 즉, 복원된 주변 블록의 움직임 벡터 및/또는 콜 블록의 움직임 벡터는 예측 움직임 벡터 후보로 사용될 수 있다. 부호화기는 상기 리스트에 포함된 예측 움직임 벡터 후보 중에서 선택된 최적의 예측 움직임 벡터를 지시하는 예측 움직임 벡터 인덱스를 복호화기로 전송할 수 있다. 이 때, 복호화기는 상기 예측 움직임 벡터 인덱스를 이용하여, 예측 움직임 벡터 후보 리스트에 포함된 예측 움직임 벡터 후보 중에서, 현재 블록의 예측 움직임 벡터를 선택할 수 있다.For example, when Advanced Motion Vector Predictor (AMVP) is applied, the encoder and decoder may generate a predictive motion vector candidate list by using a motion vector of a reconstructed neighboring block and/or a motion vector of a collocated block. That is, the motion vector of the reconstructed neighboring block and/or the motion vector of the collocated block may be used as a prediction motion vector candidate. The encoder may transmit a predicted motion vector index indicating an optimal predicted motion vector selected from among the predicted motion vector candidates included in the list to the decoder. In this case, the decoder may select the predicted motion vector of the current block from among the predicted motion vector candidates included in the predicted motion vector candidate list by using the predicted motion vector index.

부호화기는 현재 블록의 움직임 벡터와 예측 움직임 벡터 간의 움직임 벡터 차분(MVD: Motion Vector Difference)을 구할 수 있고, 이를 부호화하여 복호화기로 전송할 수 있다. 이 때, 복호화기는 수신된 움직임 벡터 차분을 복호화할 수 있고, 복호화된 움직임 벡터 차분과 예측 움직임 벡터의 합을 통해 현재 블록의 움직임 벡터를 도출할 수 있다.The encoder may obtain a motion vector difference (MVD) between the motion vector of the current block and the predicted motion vector, encode it, and transmit it to the decoder. In this case, the decoder may decode the received motion vector difference, and may derive the motion vector of the current block through the sum of the decoded motion vector difference and the predicted motion vector.

다른 예로, 머지(merge)가 적용되는 경우, 부호화기 및 복호화기는 복원된 주변 블록의 움직임 정보 및/또는 콜 블록의 움직임 정보를 이용하여, 머지 후보 리스트를 생성할 수 있다. 즉, 부호화기 및 복호화기는 복원된 주변 블록 및/또는 콜 블록의 움직임 정보가 존재하는 경우, 이를 현재 블록에 대한 머지 후보로 사용할 수 있다. As another example, when merge is applied, the encoder and the decoder may generate a merge candidate list by using motion information of a reconstructed neighboring block and/or motion information of a collocated block. That is, when motion information of the reconstructed neighboring block and/or collocated block exists, the encoder and the decoder may use it as a merge candidate for the current block.

부호화기는 머지 후보 리스트에 포함된 머지 후보 중에서 최적의 부호화 효율을 제공할 수 있는 머지 후보를 현재 블록에 대한 움직임 정보로 선택할 수 있다. 이 때, 상기 선택된 머지 후보를 지시하는 머지 인덱스가 비트스트림에 포함되어 복호화기로 전송될 수 있다. 복호화기는 상기 전송된 머지 인덱스를 이용하여, 머지 후보 리스트에 포함된 머지 후보 중에서 하나를 선택할 수 있으며, 상기 선택된 머지 후보를 현재 블록의 움직임 정보로 결정할 수 있다. 따라서, 머지 모드가 적용되는 경우, 복원된 주변 블록 및/또는 콜 블록의 움직임 정보가 현재 블록의 움직임 정보로 그대로 사용될 수 있다.The encoder may select a merge candidate capable of providing optimal encoding efficiency from among merge candidates included in the merge candidate list as motion information for the current block. In this case, the merge index indicating the selected merge candidate may be included in the bitstream and transmitted to the decoder. The decoder may select one of the merge candidates included in the merge candidate list by using the transmitted merge index, and may determine the selected merge candidate as motion information of the current block. Accordingly, when the merge mode is applied, the motion information of the reconstructed neighboring block and/or the collocated block may be used as the motion information of the current block as it is.

상술한 AMVP 및 머지 모드에서는, 현재 블록의 움직임 정보를 도출하기 위해, 복원된 주변 블록의 움직임 정보 및/또는 콜 블록의 움직임 정보가 사용될 수 있다. 이하, 후술되는 실시예들에서, 복원된 주변 블록으로부터 도출되는 움직임 정보는 공간적 움직임 정보라 하고, 콜 블록을 기반으로 도출되는 움직임 정보는 시간적 움직임 정보라 한다. 예를 들어, 복원된 주변 블록으로부터 도출되는 움직임 벡터는 공간적 움직임 벡터, 콜 블록을 기반으로 도출되는 움직임 벡터는 시간적 움직임 벡터로 불릴 수 있다.In the aforementioned AMVP and merge modes, in order to derive the motion information of the current block, motion information of a reconstructed neighboring block and/or motion information of a collocated block may be used. Hereinafter, in embodiments to be described below, motion information derived from a reconstructed neighboring block is referred to as spatial motion information, and motion information derived based on a collocated block is referred to as temporal motion information. For example, a motion vector derived from a reconstructed neighboring block may be called a spatial motion vector, and a motion vector derived based on a collocated block may be called a temporal motion vector.

다시 도 3을 참조하면, 부호화기 및 복호화기는 상기 도출된 움직임 정보에 기반하여 현재 블록에 대한 움직임 보상을 수행함으로써, 현재 블록의 예측 블록을 생성할 수 있다(S320). 여기서, 예측 블록은 현재 블록에 대한 움직임 보상 수행 결과 생성된, 움직임 보상된 블록을 의미할 수 있다. 또한, 복수의 움직임 보상된 블록은 하나의 움직임 보상된 영상을 구성할 수 있다. 따라서, 후술되는 실시예들에서 예측 블록은 문맥에 따라 ‘움직임 보상된 블록’ 및/또는 ‘움직임 보상된 영상’으로 지칭될 수 있으며, 이러한 구분은 해당 기술 분야에서 통상의 지식을 가진 자라면 용이하게 할 수 있을 것이다.Referring back to FIG. 3 , the encoder and the decoder may generate a prediction block of the current block by performing motion compensation on the current block based on the derived motion information ( S320 ). Here, the prediction block may mean a motion-compensated block generated as a result of performing motion compensation on the current block. Also, a plurality of motion-compensated blocks may constitute one motion-compensated image. Accordingly, in the embodiments to be described below, the prediction block may be referred to as a 'motion compensated block' and/or a 'motion compensated image' depending on context, and this classification is easy for those of ordinary skill in the art. will be able to do

한편, 인터 예측이 수행되는 픽쳐에는 P 픽쳐 및 B 픽쳐가 있을 수 있다. P 픽쳐는 하나의 참조 픽쳐를 이용한 단방향 예측이 수행되는 픽쳐를 의미할 수 있고, B 픽쳐는 하나 이상, 예를 들어 두 개의 참조 픽쳐를 이용한 순방향, 역방향 또는 양방향 예측이 수행될 수 있는 픽쳐를 의미할 수 있다. 예를 들어, B 픽쳐에서는 1개의 순방향 참조 픽쳐(과거 픽쳐) 및 1개의 역방향 참조 픽쳐(미래 픽쳐)를 이용하여 인터 예측이 수행될 수 있다. 또한, B 픽쳐에서는 2개의 순방향 참조 픽쳐를 이용하여 예측이 수행되거나, 2개의 역방향 참조 픽쳐를 이용하여 예측이 수행될 수도 있다.Meanwhile, a picture on which inter prediction is performed may include a P picture and a B picture. A P picture may mean a picture on which unidirectional prediction using one reference picture is performed, and a B picture may mean a picture on which forward, backward or bidirectional prediction using one or more, for example, two reference pictures can be performed. can do. For example, in the B picture, inter prediction may be performed using one forward reference picture (past picture) and one backward reference picture (future picture). Also, in the B picture, prediction may be performed using two forward reference pictures or prediction may be performed using two backward reference pictures.

여기서, 참조 픽쳐들은 참조 픽쳐 리스트(reference picture list)에 의해 관리될 수 있다. P 픽쳐에서는 1개의 참조 픽쳐가 사용되고, 상기 참조 픽쳐는 참조 픽쳐 리스트0(L0 또는 List0)에 할당될 수 있다. B 픽쳐에서는 2개의 참조 픽쳐가 사용되고, 상기 2개의 참조 픽쳐는 각각 참조 픽쳐 리스트0 및 참조 픽쳐 리스트1(L1 또는 List1)에 할당될 수 있다. 이하, L0 참조 픽쳐 리스트는 참조 픽쳐 리스트0과 동일한 의미를 가질 수 있으며, L1 참조 픽쳐 리스트는 참조 픽쳐 리스트1과 동일한 의미를 가질 수 있다.Here, the reference pictures may be managed by a reference picture list. In the P picture, one reference picture is used, and the reference picture may be assigned to a reference picture list 0 (L0 or List0). In the B picture, two reference pictures are used, and the two reference pictures may be allocated to a reference picture list 0 and a reference picture list 1 (L1 or List1), respectively. Hereinafter, the L0 reference picture list may have the same meaning as the reference picture list 0, and the L1 reference picture list may have the same meaning as the reference picture list 1.

일반적으로 순방향 참조 픽쳐는 참조 픽쳐 리스트0에 할당되고 역방향 참조 픽쳐는 참조 픽쳐 리스트1에 할당될 수 있다. 그러나, 참조 픽쳐의 할당 방법은 이에 한정되는 것이 아니며, 순방향 참조 픽쳐가 참조 픽쳐 리스트1에 할당될 수도 있고, 역방향 참조 픽쳐가 참조 픽쳐 리스트0에 할당될 수도 있다. 이하, 참조 픽쳐 리스트0에 할당된 참조 픽쳐는 L0 참조 픽쳐, 참조 픽쳐 리스트1에 할당된 참조 픽쳐는 L1 참조 픽쳐라 한다.In general, the forward reference picture may be allocated to the reference picture list 0 and the backward reference picture may be allocated to the reference picture list 1 . However, the method of allocating the reference picture is not limited thereto, and the forward reference picture may be allocated to the reference picture list 1 and the backward reference picture may be allocated to the reference picture list 0. Hereinafter, the reference picture allocated to the reference picture list 0 is referred to as an L0 reference picture, and the reference picture allocated to the reference picture list 1 is referred to as an L1 reference picture.

참조 픽쳐들은 일반적으로 참조 픽쳐 번호에 따라, 내림차순으로 참조 픽쳐 리스트에 할당될 수 있다. 여기서, 참조 픽쳐 번호는 각 참조 픽쳐에 POC(Picture Order Count) 순서로 할당된 번호를 의미할 수 있으며, 상기 POC 순서는 픽쳐의 표시 순서 및/또는 시간 순서를 의미할 수 있다. 예를 들어, 참조 픽쳐 번호가 동일한 2개의 참조 픽쳐는 서로 동일한 참조 픽쳐에 해당될 수 있다. 참조 픽쳐 리스트에 할당된 참조 픽쳐들은 참조 픽쳐 리스트 재배열(RPLR: Reference Picture List Reordering) 또는 메모리 관리 컨트롤(MMCO: Memory Management Control Operation) 명령에 의해 재배열될 수 있다. In general, reference pictures may be allocated to the reference picture list in descending order according to the reference picture number. Here, the reference picture number may mean a number allocated to each reference picture in a picture order count (POC) order, and the POC order may mean a display order and/or a temporal order of pictures. For example, two reference pictures having the same reference picture number may correspond to the same reference picture. The reference pictures allocated to the reference picture list may be rearranged by a reference picture list reordering (RPLR) or a memory management control operation (MMCO) command.

상술한 바와 같이, P 픽쳐에서는 1개의 L0 참조 픽쳐를 이용한 단방향 예측이 수행될 수 있고, B 픽쳐에서는 1개의 L0 참조 픽쳐 및 1개의 L1 참조 픽쳐, 즉 2개의 참조 픽쳐를 이용한 순방향, 역방향 또는 양방향 예측이 수행될 수 있다. 1개의 참조 픽쳐를 이용한 예측은 단예측(uni-prediction)으로 불릴 수 있고, L0 참조 픽쳐 및 L1 참조 픽쳐를 포함한 2개의 참조 픽쳐를 이용한 예측은 쌍예측(bi-prediction)으로 불릴 수 있다. As described above, unidirectional prediction using one L0 reference picture may be performed in the P picture, and one L0 reference picture and one L1 reference picture in the B picture, that is, forward, backward, or bidirectional using two reference pictures. Prediction may be performed. Prediction using one reference picture may be called uni-prediction, and prediction using two reference pictures including the L0 reference picture and the L1 reference picture may be called bi-prediction.

쌍예측은 순방향 예측, 역방향 예측 및 양방향 예측을 모두 포함하는 개념으로 사용될 수 있으나, 후술되는 실시예들에서는 편의상 2개의 참조 픽쳐(L0 참조 픽쳐 및 L1 참조 픽쳐)를 이용한 예측은 양방향 예측이라 한다. 즉, 후술되는 실시예들에서 양방향 예측은 쌍예측을 의미할 수 있고, 2개의 참조 픽쳐(L0 참조 픽쳐 및 L1 참조 픽쳐)를 이용한 순방향, 역방향, 양방향 예측을 모두 포함하는 개념으로 이해될 수 있다. 또한 쌍예측이 수행되는 경우에도 순방향 예측 또는 역방향 예측이 수행될 수 있으나, 후술되는 실시예들에서는 편의상 1개의 참조 픽쳐만을 이용한 예측을 단방향 예측이라 한다. 즉, 후술되는 실시예들에서 단방향 예측은 단예측을 의미할 수 있고, 1개의 참조 픽쳐를 이용한 예측만을 포함하는 개념으로 이해되어야 할 것이다. 또한, 이하 예측이 수행되는 블록에 대해 단방향 예측(단예측)이 적용되는지 또는 양방향 예측(쌍예측)이 적용되는지 여부를 지시하는 정보는 예측 방향 정보라 한다.Bi-prediction can be used as a concept including all forward prediction, backward prediction, and bi-prediction, but in embodiments to be described below, for convenience, prediction using two reference pictures (L0 reference picture and L1 reference picture) is called bi-directional prediction. That is, in the embodiments to be described later, bi-prediction may mean bi-prediction, and it may be understood as a concept including forward, backward, and bi-prediction using two reference pictures (L0 reference picture and L1 reference picture). . In addition, forward prediction or backward prediction may be performed even when bi-prediction is performed, but in embodiments to be described below, prediction using only one reference picture is referred to as uni-directional prediction for convenience. That is, in embodiments to be described later, uni-prediction may mean uni-prediction, and should be understood as a concept including only prediction using one reference picture. Also, hereinafter, information indicating whether uni-prediction (uni-prediction) or bi-prediction (bi-prediction) is applied to a block on which prediction is performed is referred to as prediction direction information.

도 4는 양방향 예측이 적용되는 경우, 인터 예측 방법의 실시예를 개략적으로 나타내는 도면이다.4 is a diagram schematically illustrating an embodiment of an inter prediction method when bidirectional prediction is applied.

상술한 바와 같이, 부호화기 및 복호화기는 인터 예측시 단방향 예측뿐만 아니라 양방향 예측을 수행할 수 있다. 양방향 예측이 적용되는 경우, 예측이 수행되는 각각의 블록은 두 개의 참조 픽쳐(L0 참조 픽쳐 및 L1 참조 픽쳐)를 가질 수 있다. 또한 이 때, 양방향 예측이 수행되는 각각의 블록은 두 개의 움직임 정보를 가질 수 있다. 여기서, 움직임 정보는 참조 픽쳐 번호 및 움직임 벡터 등을 포함할 수 있다.As described above, the encoder and the decoder may perform bidirectional prediction as well as unidirectional prediction during inter prediction. When bidirectional prediction is applied, each block on which prediction is performed may have two reference pictures (L0 reference picture and L1 reference picture). Also, at this time, each block on which bidirectional prediction is performed may have two pieces of motion information. Here, the motion information may include a reference picture number and a motion vector.

양방향 예측이 수행되는 경우, 부호화기 및 복호화기는 참조 픽쳐 리스트0 및 참조 픽쳐 리스트1에서 각각 하나의 참조 픽쳐를 선택하여 예측에 사용할 수 있다. 즉, L0 참조 픽쳐 및 L1 참조 픽쳐를 포함하는 2 개의 참조 픽쳐가 양방향 예측에 사용될 수 있다. 이하, L0 참조 픽쳐에 대응되는 움직임 정보는 L0 움직임 정보라 하고, L1 참조 픽쳐에 대응되는 움직임 정보는 L1 움직임 정보라 한다. 또한, L0 움직임 정보를 이용한 움직임 보상은 L0 움직임 보상이라 하고, L1 움직임 정보를 이용한 움직임 보상은 L1 움직임 보상이라 한다. When bidirectional prediction is performed, the encoder and the decoder may select one reference picture from the reference picture list 0 and the reference picture list 1, respectively, and use it for prediction. That is, two reference pictures including the L0 reference picture and the L1 reference picture may be used for bi-directional prediction. Hereinafter, motion information corresponding to the L0 reference picture will be referred to as L0 motion information, and motion information corresponding to the L1 reference picture will be referred to as L1 motion information. Also, motion compensation using L0 motion information is called L0 motion compensation, and motion compensation using L1 motion information is called L1 motion compensation.

도 4를 참조하면, 부호화기 및 복호화기는 L0 움직임 정보 및 L0 참조 픽쳐 리스트를 이용하여 현재 블록에 대한 L0 움직임 보상(410)을 수행함으로써, L0 움직임 보상된 블록을 생성할 수 있다. 또한, 부호화기 및 복호화기는 L1 움직임 정보 및 L1 참조 픽쳐 리스트를 이용하여 L1 움직임 보상(420)을 수행함으로써, L1 움직임 보상된 블록을 생성할 수 있다. 이 때, L0 움직임 보상(410) 및 L1 움직임 보상(420) 과정은 서로 독립적으로 수행될 수 있다.Referring to FIG. 4 , the encoder and the decoder may generate the L0 motion-compensated block by performing the L0 motion compensation 410 on the current block using the L0 motion information and the L0 reference picture list. Also, the encoder and the decoder may generate the L1 motion-compensated block by performing the L1 motion compensation 420 using the L1 motion information and the L1 reference picture list. In this case, the L0 motion compensation 410 and L1 motion compensation 420 processes may be performed independently of each other.

부호화기 및 복호화기는 L0 움직임 보상된 블록 및 L1 움직임 보상된 블록에 대해 가중치 평균(430)을 수행하여, 최종적으로 하나의 움직임 보상된 블록을 생성할 수 있다. 일례로, 상기 가중치 평균(430)은 L0 움직임 보상된 블록 및 L1 움직임 보상된 블록 내의 픽셀 단위로 수행될 수 있다. 이 때, 최종적으로 생성된 하나의 움직임 보상된 블록은 현재 블록의 예측 블록에 해당될 수 있다.The encoder and the decoder may perform a weighted average 430 on the L0 motion-compensated block and the L1 motion-compensated block to finally generate one motion-compensated block. For example, the weighted average 430 may be performed in units of pixels in the L0 motion-compensated block and the L1 motion-compensated block. In this case, one finally generated motion-compensated block may correspond to a prediction block of the current block.

이하, 양방향 예측시에 적용되는 움직임 보상은 양방향 움직임 보상이라 한다. 이에 대응하여, 단방향 예측시에 적용되는 움직임 보상은 단방향 움직임 보상으로 불릴 수 있다.Hereinafter, motion compensation applied during bidirectional prediction is referred to as bidirectional motion compensation. Correspondingly, motion compensation applied in unidirectional prediction may be referred to as unidirectional motion compensation.

도 5는 부호화된 영상의 움직임 정보의 일 실시예를 개략적으로 나타내는 도면이다. 도 5는 부호화된 영상을 구성하는 복수의 블록 및 상기 복수의 블록 각각의 움직임 정보를 도시한다.5 is a diagram schematically illustrating an embodiment of motion information of an encoded image. 5 illustrates a plurality of blocks constituting an encoded image and motion information of each of the plurality of blocks.

도 5에서 부호화된 영상은 BasketballDrill에 해당된다. 여기서, BasketballDrill은 영상 부호화/복호화 실험에 사용되는 테스트 시퀀스(test sequence)의 명칭을 나타낸다. 부호화된 영상의 크기는 832x480이고, POC(Picture Order Count)는 2이다. 또한, 도 5의 영상에 적용된 양자화 파라미터(QP: Quantization Parameter) 값은 32이다. The encoded image in FIG. 5 corresponds to BasketballDrill. Here, BasketballDrill represents the name of a test sequence used in an image encoding/decoding experiment. The size of the encoded image is 832x480, and the picture order count (POC) is 2. In addition, a quantization parameter (QP) value applied to the image of FIG. 5 is 32.

부호화기 및 복호화기는 저지연 응용 환경에서의 인터 예측 효율을 높이기 위해, 순방향 B 픽쳐를 이용할 수 있다. 여기서, 순방향 B 픽쳐는 순방향 예측만이 수행되는 B 픽쳐를 의미할 수 있다. 순방향 B 픽쳐가 사용되는 경우, 예측이 수행되는 각각의 블록은 두 개의 움직임 정보(L0 움직임 정보, L1 움직임 정보)를 가질 수 있다. 순방향 B 픽쳐에서는 일반적으로 L0 참조 픽쳐 리스트 및 L1 참조 픽쳐 리스트가 동일하게 설정될 수 있다. 이하 본 명세서에서, 순방향 B 픽쳐가 사용되는 경우에는 L0 참조 픽쳐 리스트 및 L1 참조 픽쳐 리스트가 동일하다고 가정한다. The encoder and the decoder may use the forward B picture in order to increase inter prediction efficiency in a low-latency application environment. Here, the forward B picture may mean a B picture on which only forward prediction is performed. When the forward B picture is used, each block on which prediction is performed may have two pieces of motion information (L0 motion information and L1 motion information). In a forward B picture, in general, the L0 reference picture list and the L1 reference picture list may be set identically. Hereinafter, in the present specification, when the forward B picture is used, it is assumed that the L0 reference picture list and the L1 reference picture list are the same.

*복호화기는 L0 참조 픽쳐 리스트 및 L1 참조 픽쳐 리스트를 기반으로, 현재 픽쳐가 순방향 B 픽쳐인지 여부를 직접 판단할 수도 있으나, 부호화기로부터 전송된 정보를 기반으로 현재 픽쳐가 순방향 B 픽쳐인지 여부를 판단할 수도 있다. 예를 들어, 부호화기는 L0 참조 픽쳐 리스트 및 L1 참조 픽쳐 리스트가 동일한지 여부를 지시하는 플래그를 부호화하여 복호화기로 전송할 수 있다. 이 때, 복호화기는 상기 플래그를 수신하여 복호화한 후, 복호화된 플래그를 기반으로, 현재 픽쳐가 순방향 B 픽쳐인지 여부를 판단할 수 있다. 또 다른 예로, 부호화기는 순방향 B 픽쳐에 해당하는 NAL 유닛 타입 값 또는 슬라이스 타입 값을 복호화기로 전송할 수 있고, 복호화기는 상기 값을 수신하여 이를 기반으로 순방향 B 픽쳐 여부를 판단할 수도 있다.* The decoder may directly determine whether the current picture is a forward B picture based on the L0 reference picture list and the L1 reference picture list, but based on the information transmitted from the encoder, it is possible to determine whether the current picture is a forward B picture. may be For example, the encoder may encode a flag indicating whether the L0 reference picture list and the L1 reference picture list are the same and transmit it to the decoder. In this case, after receiving and decoding the flag, the decoder may determine whether the current picture is a forward B picture based on the decoded flag. As another example, the encoder may transmit the NAL unit type value or the slice type value corresponding to the forward B picture to the decoder, and the decoder may receive the value and determine whether it is a forward B picture based on the received value.

도 5에 도시된 영상은 순방향 B 픽쳐를 사용하여 부호화된 영상이다. 따라서, 부호화된 영상 내의 각각의 블록은 최대 두 개의 움직임 정보를 가질 수 있다. 여기서, 움직임 정보는 참조 픽쳐 번호, 움직임 벡터 등을 포함할 수 있다. 도 5을 참조하면, 두 개의 움직임 정보를 갖는 블록들 중에서 L0 움직임 정보(예를 들어, 참조 픽쳐 번호, 움직임 벡터)와 L1 움직임 정보(예를 들어, 참조 픽쳐 번호, 움직임 벡터)가 동일한 블록이 다수 존재할 수 있다. The image shown in FIG. 5 is an image encoded using a forward B picture. Accordingly, each block in the coded image may have up to two pieces of motion information. Here, the motion information may include a reference picture number, a motion vector, and the like. Referring to FIG. 5 , a block having the same L0 motion information (eg, reference picture number, motion vector) and L1 motion information (eg, reference picture number, motion vector) among blocks having two motion information is the same. There may be many.

순방향 B 픽쳐에서 L0 움직임 정보(예를 들어, 참조 픽쳐 번호, 움직임 벡터)와 L1 움직임 정보(예를 들어, 참조 픽쳐 번호, 움직임 벡터)가 동일한 블록은, 시간적 움직임 정보 도출 방법에 기인하여 발생할 수 있다. 상술한 바와 같이, 시간적 움직임 정보는 이미 복원된 콜 픽쳐 내에서 현재 블록에 대응하는 콜 블록의 움직임 정보로부터 도출될 수 있다. 예를 들어, 현재 블록의 L0 시간적 움직임 정보를 도출할 때, 부호화기 및 복호화기는 콜 픽쳐 내에서 현재 블록에 대응하는 콜 블록의 L0 움직임 정보를 사용할 수 있다. 그러나, 상기 콜 블록에 L0 움직임 정보가 존재하지 않는 경우, 부호화기 및 복호화기는 상기 콜 블록의 L1 움직임 정보를 현재 블록의 L0 시간적 움직임 정보로 사용할 수 있다. 반대로, 현재 블록의 L1 시간적 움직임 정보를 도출할 때, 부호화기 및 복호화기는 콜 픽쳐 내에서 현재 블록에 대응하는 콜 블록의 L1 움직임 정보를 사용할 수 있다. 그러나, 상기 콜 블록에 L1 움직임 정보가 존재하지 않는 경우, 부호화기 및 복호화기는 상기 콜 블록의 L0 움직임 정보를 현재 블록의 L1 시간적 움직임 정보로 사용할 수 있다. 상술한 프로세스 수행 결과, 현재 블록의 L0 움직임 정보와 L1 움직임 정보가 동일해지는 현상이 발생할 수 있다. 따라서, 본 명세서에서 L0 움직임 정보(예를 들어, 참조 픽쳐 번호 및 움직임 벡터)와 L1 움직임 정보(예를 들어, 참조 픽쳐 번호 및 움직임 벡터)가 동일한 경우, 및/또는 L0 시간적 움직임 정보(예를 들어, 참조 픽쳐 번호 및 움직임 벡터)와 L1 시간적 움직임 정보(예를 들어, 참조 픽쳐 번호 및 움직임 벡터)가 동일한 경우는, 이미 복원된 콜 픽쳐 내에서 현재 블록에 대응하는 콜 블록의 움직임 정보가 L0 움직임 정보 및 L1 움직임 정보 중에서 하나만을 갖는 경우를 포함할 수 있다.A block having the same L0 motion information (eg, reference picture number, motion vector) and L1 motion information (eg, reference picture number, motion vector) in the forward B picture may occur due to the temporal motion information derivation method. have. As described above, the temporal motion information may be derived from motion information of the collocated block corresponding to the current block in the already reconstructed collocated picture. For example, when deriving the L0 temporal motion information of the current block, the encoder and the decoder may use the L0 motion information of the collocated block corresponding to the current block in the collocated picture. However, when the L0 motion information does not exist in the collocated block, the encoder and the decoder may use the L1 motion information of the collocated block as the L0 temporal motion information of the current block. Conversely, when deriving the L1 temporal motion information of the current block, the encoder and the decoder may use the L1 motion information of the collocated block corresponding to the current block in the collocated picture. However, when the L1 motion information does not exist in the collocated block, the encoder and the decoder may use the L0 motion information of the collocated block as the L1 temporal motion information of the current block. As a result of performing the above-described process, a phenomenon may occur in which the L0 motion information and the L1 motion information of the current block become the same. Accordingly, in the present specification, when L0 motion information (eg, reference picture number and motion vector) and L1 motion information (eg, reference picture number and motion vector) are the same, and/or L0 temporal motion information (eg, For example, when the reference picture number and the motion vector) and the L1 temporal motion information (eg, the reference picture number and the motion vector) are the same, the motion information of the collocated block corresponding to the current block in the already reconstructed collocated picture is L0. It may include a case of having only one of the motion information and the L1 motion information.

또한, L0 움직임 정보와 L1 움직임 정보가 동일한 블록이 발생된 경우, 상기 블록은 이후에 부호화되는 블록에 영향을 미칠 수 있다. 예를 들어, 머지(merge)가 적용되는 경우, 복원된 주변 블록 및/또는 콜 블록의 움직임 정보(L0 움직임 정보 및 L1 움직임 정보)가 현재 블록의 움직임 정보로 그대로 사용될 수 있다. 따라서, L0 움직임 정보와 L1 움직임 정보가 동일한 블록이 발생된 경우, L0 움직임 정보와 L1 움직임 정보가 동일한 다른 블록이 더 많이 발생될 수 있다. Also, when a block having the same L0 motion information and L1 motion information is generated, the block may affect a block to be encoded later. For example, when merge is applied, motion information (L0 motion information and L1 motion information) of the reconstructed neighboring block and/or collocated block may be used as the motion information of the current block as it is. Accordingly, when blocks having the same L0 motion information and L1 motion information are generated, more blocks having the same L0 motion information and L1 motion information may be generated.

L0 움직임 정보와 L1 움직임 정보가 동일한 블록에 대해 움직임 보상이 수행되는 경우에는, 하나의 블록에서 동일한 프로세스가 두 번 반복하여 수행될 수 있다. 이는 부호화 관점에서 매우 비효율적이므로, 상술한 문제점을 해결하여 계산 복잡도를 감소시키고 부호화 효율을 향상시킬 수 있는 인터 예측 방법 및/또는 움직임 보상 방법이 제공될 수 있다. 일례로, L0 움직임 정보(예를 들어, 참조 픽쳐 번호 및 움직임 벡터)와 L1 움직임 정보(예를 들어, 참조 픽쳐 번호 및 움직임 벡터)가 동일한 경우, 부호화기 및 복호화기는 움직임 보상 과정을 한 번만 수행함으로써 계산 복잡도를 감소시킬 수 있다. 다른 예로, L0 움직임 정보(예를 들어, 참조 픽쳐 번호 및 움직임 벡터)와 L1 움직임 정보(예를 들어, 참조 픽쳐 번호 및 움직임 벡터)가 동일한 경우, 부호화기 및 복호화기는 L0 움직임 정보 및/또는 L1 움직임 정보를 다시 설정함으로써 부호화 효율을 증가시킬 수도 있다.When motion compensation is performed on a block having the same L0 motion information and L1 motion information, the same process may be repeatedly performed twice in one block. Since this is very inefficient in terms of encoding, an inter prediction method and/or motion compensation method capable of reducing computational complexity and improving encoding efficiency by solving the above-described problems may be provided. For example, when L0 motion information (eg, reference picture number and motion vector) and L1 motion information (eg, reference picture number and motion vector) are the same, the encoder and the decoder perform the motion compensation process only once. The computational complexity can be reduced. As another example, when the L0 motion information (eg, reference picture number and motion vector) and L1 motion information (eg, reference picture number and motion vector) are the same, the encoder and the decoder perform the L0 motion information and/or L1 motion information. It is also possible to increase the encoding efficiency by resetting the information.

도 6은 본 발명에 따른 현재 블록의 시간적 움직임 정보 도출 방법의 일 실시예를 개략적으로 나타내는 흐름도이다. 6 is a flowchart schematically illustrating an embodiment of a method for deriving temporal motion information of a current block according to the present invention.

후술되는 실시예들은 시간적 움직임 정보를 중심으로 서술되지만 본 발명은 이에 한정되는 것은 아니다. 예를 들어, 도 6의 실시예에 따른 방법들은 머지 모드 및/또는 AMVP 모드에서의 시간적 움직임 정보뿐만 아니라, 머지 모드에서 머지 후보 리스트를 기반으로 도출된 현재 블록의 움직임 정보 및/또는 AMVP 모드에서 예측 움직임 벡터 후보 리스트를 기반으로 도출된 현재 블록의 움직임 정보에도 동일하거나 유사한 방식으로 적용될 수 있다.Embodiments to be described below will be described based on temporal motion information, but the present invention is not limited thereto. For example, the methods according to the embodiment of FIG. 6 include not only temporal motion information in the merge mode and/or AMVP mode, but also motion information of a current block derived based on the merge candidate list in the merge mode and/or in the AMVP mode. The same or similar method may be applied to motion information of the current block derived based on the prediction motion vector candidate list.

상술한 바와 같이, 시간적 움직임 정보는 이미 복원된 콜 픽쳐 내에서 현재 블록에 대응하는 콜 블록의 움직임 정보를 기반으로 도출될 수 있다. 여기서, 상기 콜 픽쳐는 일례로 참조 픽쳐 리스트에 포함된 참조 픽쳐 중에서 하나의 픽쳐에 해당될 수 있다. 부호화기 및 복호화기는, 콜 픽쳐 내에서 현재 블록과 공간적으로 동일한 위치에 존재하는 블록을 기준으로 소정의 상대적인 위치를 결정할 수 있고, 상기 결정된 소정의 상대적인 위치(예를 들어, 상기 현재 블록과 공간적으로 동일한 위치에 존재하는 블록의 내부 및/또는 외부의 위치)를 기반으로 상기 콜 블록을 도출할 수 있다. 콜 블록을 기반으로 도출되는 시간적 움직임 정보는 예측 방향 정보, L0 참조 픽쳐 번호, L1 참조 픽쳐 번호, L0 움직임 벡터 및 L1 움직임 벡터 등을 포함할 수 있다.As described above, the temporal motion information may be derived based on the motion information of the collocated block corresponding to the current block in the already reconstructed collocated picture. Here, the collocated picture may correspond to, for example, one picture among reference pictures included in the reference picture list. The encoder and the decoder may determine a predetermined relative position based on a block existing at the same spatial position as the current block in the collocated picture, and the determined relative position (eg, spatially identical to the current block). The collocated block may be derived based on the position inside and/or outside the block existing in the position). The temporal motion information derived based on the collocated block may include prediction direction information, L0 reference picture number, L1 reference picture number, L0 motion vector, L1 motion vector, and the like.

도 6을 참조하면, 부호화기 및 복호화기는 콜 블록을 기반으로 도출된 시간적 움직임 정보에서 L0 시간적 움직임 정보와 L1 시간적 움직임 정보가 동일한지 여부, 즉 L0 참조 픽쳐 번호와 L1 참조 픽쳐 번호가 동일하고 L0 움직임 벡터와 L1 움직임 벡터가 동일한지 여부를 판단할 수 있다(S610).Referring to FIG. 6 , the encoder and the decoder determine whether L0 temporal motion information and L1 temporal motion information are the same in the temporal motion information derived based on the collocated block, that is, the L0 reference picture number and the L1 reference picture number are the same and the L0 motion information is the same. It may be determined whether the vector and the L1 motion vector are the same (S610).

L0 시간적 움직임 정보와 L1 시간적 움직임 정보가 동일하지 않은 경우, 즉 L0 참조 픽쳐 번호와 L1 참조 픽쳐 번호가 동일하지 않거나 및/또는 L0 움직임 벡터와 L1 움직임 벡터가 동일하지 않은 경우, 부호화기 및 복호화기는 콜 블록을 기반으로 도출된 시간적 움직임 정보를 그대로 현재 블록에 대한 시간적 움직임 정보로 사용할 수 있다. AMVP가 적용되는 경우, 상기 현재 블록의 시간적 움직임 정보는 현재 블록에 대한 예측 움직임 벡터 후보로 결정되거나 등록될 수 있다. 또한, 머지가 적용되는 경우, 상기 현재 블록의 시간적 움직임 정보는 현재 블록에 대한 머지 후보로 결정되거나 등록될 수 있다. When the L0 temporal motion information and the L1 temporal motion information are not the same, that is, the L0 reference picture number and the L1 reference picture number are not the same and/or the L0 motion vector and the L1 motion vector are not the same, the encoder and the decoder The temporal motion information derived based on the block may be used as the temporal motion information for the current block as it is. When AMVP is applied, the temporal motion information of the current block may be determined or registered as a prediction motion vector candidate for the current block. Also, when the merge is applied, the temporal motion information of the current block may be determined or registered as a merge candidate for the current block.

L0 시간적 움직임 정보와 L1 시간적 움직임 정보가 동일한 경우, 부호화기 및 복호화기는 복원된 주변 블록의 움직임 정보가 존재하는지 여부를 판단할 수 있다(S620). 예를 들어, 이 때 부호화기 및 복호화기는 소정의 위치 및/또는 소정의 방법으로 선택된 위치의 복원된 주변 블록 중에서 움직임 정보를 갖는 블록이 존재하는지 여부를 판단할 수 있다. 여기서, 복원된 주변 블록은 이미 부호화 및/또는 복호화되어 복원된 현재 픽쳐 내의 블록으로서, 현재 블록에 인접한 블록 및/또는 현재 블록의 외부 코너에 위치한 블록을 포함할 수 있다.When the L0 temporal motion information and the L1 temporal motion information are the same, the encoder and the decoder may determine whether motion information of a reconstructed neighboring block exists (S620). For example, at this time, the encoder and the decoder may determine whether a block having motion information exists among reconstructed neighboring blocks at a predetermined position and/or a position selected by a predetermined method. Here, the reconstructed neighboring block is a block in the reconstructed current picture that has already been encoded and/or decoded, and may include a block adjacent to the current block and/or a block located at an outer corner of the current block.

복원된 주변 블록의 움직임 정보가 존재하지 않는 경우(예를 들어, 소정의 위치 및/또는 소정의 방법으로 선택된 위치의 복원된 주변 블록 중에서 움직임 정보를 갖는 블록이 존재하지 않는 경우), 부호화기 및 복호화기는 현재 블록의 예측 방향 정보를 단방향 예측으로 다시 설정할 수 있다(S630). 또한 이 때, 부호화기 및 복호화기는 L0 시간적 움직임 정보만을 현재 블록의 시간적 움직임 정보로 사용할 수 있다. When motion information of a reconstructed neighboring block does not exist (eg, when a block having motion information does not exist among reconstructed neighboring blocks at a predetermined position and/or a position selected by a predetermined method), the encoder and the decoder The group may reset the prediction direction information of the current block to unidirectional prediction (S630). Also, at this time, the encoder and the decoder may use only the L0 temporal motion information as the temporal motion information of the current block.

복원된 주변 블록의 움직임 정보가 존재하는 경우(예를 들어, 소정의 위치 및/또는 소정의 방법으로 선택된 위치의 복원된 주변 블록 중에서 움직임 정보를 갖는 블록이 존재하는 경우), 부호화기 및 복호화기는 상기 복원된 주변 블록의 움직임 정보를 현재 블록의 L1 시간적 움직임 정보로 사용할 수 있다(S640). 즉, 이 때 부호화기 및 복호화기는 현재 블록의 L1 시간적 움직임 정보를 상기 복원된 주변 블록의 움직임 정보로 재설정할 수 있다. L1 시간적 움직임 정보의 설정을 위해 사용되는 복원된 주변 블록의 구체적인 실시예는 후술하기로 한다.When motion information of a reconstructed neighboring block exists (for example, when a block having motion information exists among reconstructed neighboring blocks at a predetermined position and/or a position selected by a predetermined method), the encoder and the decoder The motion information of the reconstructed neighboring block may be used as the L1 temporal motion information of the current block (S640). That is, at this time, the encoder and the decoder may reset the L1 temporal motion information of the current block to the motion information of the reconstructed neighboring block. A specific embodiment of the reconstructed neighboring block used for setting the L1 temporal motion information will be described later.

상술한 실시예에서 현재 블록의 시간적 움직임 정보 도출 방법은 일련의 단계로서 순서도를 기초로 설명되고 있으나, 순서도의 하나 또는 그 이상의 단계는 삭제될 수도 있다. 예를 들어, 상술한 실시예에서 S620 및 S640의 단계는 생략될 수도 있다. 이 때, L0 시간적 움직임 정보와 L1 시간적 움직임 정보가 동일한 경우, 부호화기 및 복호화기는 현재 블록의 예측 방향 정보를 단방향 예측으로 다시 설정할 수 있다(S630). 또한 이 때, 부호화기 및 복호화기는 L0 시간적 움직임 정보만을 현재 블록의 시간적 움직임 정보로 사용할 수 있다. In the above-described embodiment, the method for deriving temporal motion information of the current block is described based on a flowchart as a series of steps, but one or more steps in the flowchart may be deleted. For example, in the above-described embodiment, steps S620 and S640 may be omitted. In this case, when the L0 temporal motion information and the L1 temporal motion information are the same, the encoder and the decoder may reset the prediction direction information of the current block to unidirectional prediction ( S630 ). Also, at this time, the encoder and the decoder may use only the L0 temporal motion information as the temporal motion information of the current block.

한편, 상술한 실시예에서는 L0 시간적 움직임 정보와 L1 시간적 움직임 정보의 동일성을 기반으로 S620 내지 S640 과정의 수행 여부가 결정되지만, 부호화기 및 복호화기는 다른 조건을 기반으로 S620 내지 S640 과정의 수행 여부를 결정할 수도 있다. Meanwhile, in the above-described embodiment, it is determined whether to perform the processes S620 to S640 based on the sameness of the L0 temporal motion information and the L1 temporal motion information, but the encoder and the decoder determine whether to perform the processes S620 to S640 based on other conditions. may be

일 실시예로, 부호화기 및 복호화기는 콜 블록을 기반으로 도출된 시간적 움직임 정보에서, L0 참조 픽쳐 번호 및 L1 참조 픽쳐 번호의 동일성을 기반으로 S620 내지 S640 과정의 수행 여부를 결정할 수 있다. 일례로, 부호화기 및 복호화기는 L0 참조 픽쳐 번호와 L1 참조 픽쳐 번호가 동일한 경우에 S620 내지 S640 과정을 수행할 수 있다. As an embodiment, the encoder and the decoder may determine whether to perform steps S620 to S640 based on the sameness of the L0 reference picture number and the L1 reference picture number in the temporal motion information derived based on the collocated block. For example, when the L0 reference picture number and the L1 reference picture number are the same, the encoder and the decoder may perform processes S620 to S640.

다른 실시예로, 부호화기 및 복호화기는 콜 블록의 예측 방향을 기반으로 S620 내지 S640 과정의 수행 여부를 결정할 수 있다. 상술한 바와 같이, 예측 방향 정보는 예측이 수행되는 블록에 대해 단방향 예측이 적용되는지 또는 양방향 예측이 적용되는지 여부를 지시하는 정보를 의미할 수 있다. 따라서, 상기 예측 방향은 단방향 예측 또는 양방향 예측에 해당될 수 있다. 일례로, 부호화기 및 복호화기는 콜 블록의 움직임 정보(예측 방향)가 양방향 예측이 아닌 단방향 예측인 경우에 S620 내지 S640 과정을 수행할 수 있다. 이는 콜 블록의 예측 방향이 단방향 예측인 경우, 결과적으로 콜 블록을 기반으로 도출되는 시간적 움직임 정보에서, L0 시간적 움직임 정보와 L1 시간적 움직임 정보가 동일할 수 있기 때문이다. As another embodiment, the encoder and the decoder may determine whether to perform steps S620 to S640 based on the prediction direction of the collocated block. As described above, the prediction direction information may refer to information indicating whether unidirectional prediction or bidirectional prediction is applied to a block on which prediction is performed. Accordingly, the prediction direction may correspond to unidirectional prediction or bidirectional prediction. For example, when the motion information (prediction direction) of the collocated block is unidirectional prediction rather than bidirectional prediction, the encoder and the decoder may perform processes S620 to S640. This is because, in the case where the prediction direction of the collocated block is unidirectional prediction, as a result, in the temporal motion information derived based on the collocated block, the L0 temporal motion information and the L1 temporal motion information may be the same.

또 다른 실시예로, 부호화기 및 복호화기는 콜 블록에 움직임 정보가 존재하는지 여부에 관한 정보를 기반으로 S620 내지 S640 과정의 수행 여부를 결정할 수도 있다. 일례로, 부호화기 및 복호화기는 콜 블록에 움직임 정보가 존재하지 않는 경우에 S620 내지 S640 과정을 수행할 수 있다. 이 경우, 상술한 S640 단계에서는 L1 시간적 움직임 정보가 아닌 L0 시간적 움직임 정보가 재설정될 수 있다. 즉, 부호화기 및 복호화기는 L0 시간적 움직임 정보를 복원된 주변 블록의 움직임 정보로 설정할 수 있으며, 현재 블록에 대해 양방향 예측이 아닌 단방향 예측을 수행할 수 있다. 또한, 콜 블록에 움직임 정보가 존재하지 않는 경우, 상술한 S640 단계에서 부호화기 및 복호화기는 L0 시간적 움직임 정보와 L1 시간적 움직임 정보를 모두 재설정할 수도 있다. 즉, 부호화기 및 복호화기는 L0 시간적 움직임 정보 및 L1 시간적 움직임 정보를 복원된 주변 블록의 움직임 정보로 설정할 수 있으며, 현재 블록에 대해 양방향 예측을 수행할 수도 있다.As another embodiment, the encoder and the decoder may determine whether to perform steps S620 to S640 based on information on whether motion information exists in the collocated block. For example, the encoder and the decoder may perform steps S620 to S640 when motion information does not exist in the collocated block. In this case, in step S640 described above, the L0 temporal motion information, not the L1 temporal motion information, may be reset. That is, the encoder and the decoder may set the L0 temporal motion information as the motion information of the reconstructed neighboring block, and may perform unidirectional prediction instead of bidirectional prediction on the current block. Also, when motion information does not exist in the collocated block, the encoder and the decoder may reset both the L0 temporal motion information and the L1 temporal motion information in step S640 described above. That is, the encoder and the decoder may set the L0 temporal motion information and the L1 temporal motion information as motion information of the reconstructed neighboring block, and may perform bidirectional prediction on the current block.

또 다른 실시예로, 부호화기 및 복호화기는 현재 블록의 크기를 기반으로 S620 내지 S640 과정의 수행 여부를 결정할 수도 있다. 일례로, 부호화기 및 복호화기는 현재 블록의 크기가 소정의 크기보다 작은지 여부를 판단할 수 있다. 여기서, 상기 현재 블록은 CU, PU 및/또는 TU일 수 있으며, 상기 소정의 크기는 예를 들어 8x8, 16x16 또는 32x32 등 중에서 하나일 수 있다. 이 때, 부호화기 및 복호화기는 현재 블록의 크기가 소정의 크기보다 작은 경우에 S620 내지 S640 과정을 수행할 수 있다.As another embodiment, the encoder and the decoder may determine whether to perform steps S620 to S640 based on the size of the current block. For example, the encoder and the decoder may determine whether the size of the current block is smaller than a predetermined size. Here, the current block may be a CU, a PU, and/or a TU, and the predetermined size may be, for example, one of 8x8, 16x16, or 32x32. In this case, when the size of the current block is smaller than a predetermined size, the encoder and the decoder may perform processes S620 to S640.

또 다른 실시예로, 부호화기 및 복호화기는 콜 블록의 움직임 정보에서 L0 움직임 벡터 및/또는 L1 움직임 벡터가 영 벡터(0,0)에 해당되는 경우에 S620 내지 S640 과정을 수행할 수도 있다. 이 경우, 상술한 S640 단계에서 부호화기 및 복호화기는 영 벡터(0,0)에 해당되는 움직임 벡터(들)를 재설정할 수 있다. 일례로, 상기 영 벡터(0,0)에 해당되는 움직임 벡터(들)는 복원된 주변 블록의 움직임 벡터로 설정될 수 있으며, 다른 예로, 상기 영 벡터(0,0)에 해당되는 움직임 벡터(들)는 콜 블록의 주변에 위치한 블록의 움직임 벡터로 설정될 수도 있다. 또 다른 실시예로, 부호화기 및 복호화기는 콜 블록의 움직임 정보에서 L0 움직임 벡터 및/또는 L1 움직임 벡터가 영 벡터(0,0)에 해당되지 않는 경우에 S620 내지 S640 과정을 수행할 수도 있다. 이 경우, 상술한 S640 단계에서 부호화기 및 복호화기는 영 벡터(0,0)에 해당되지 않는 움직임 벡터(들)을 재설정할 수 있으며, 상기 영 벡터(0,0)에 해당되지 않는 움직임 벡터(들)은 복원된 주변 블록의 움직임 벡터로 재설정될 수 있다.As another embodiment, the encoder and the decoder may perform steps S620 to S640 when the L0 motion vector and/or the L1 motion vector in the motion information of the collocated block corresponds to a zero vector (0,0). In this case, in step S640 described above, the encoder and the decoder may reset the motion vector(s) corresponding to the zero vector (0,0). As an example, the motion vector(s) corresponding to the zero vector (0,0) may be set as a motion vector of a reconstructed neighboring block, and as another example, the motion vector(s) corresponding to the zero vector (0,0) ( ) may be set as a motion vector of a block located in the vicinity of the collocated block. As another embodiment, the encoder and the decoder may perform steps S620 to S640 when the L0 motion vector and/or the L1 motion vector in the motion information of the collocated block do not correspond to the zero vector (0,0). In this case, in step S640 described above, the encoder and the decoder may reset motion vector(s) that do not correspond to the zero vector (0,0), and the motion vector(s) that do not correspond to the zero vector (0,0) ) may be reset to the motion vector of the reconstructed neighboring block.

상기 S620 내지 S640 과정의 수행 여부가 결정되는 조건은 상술한 실시예에 한정되지 않으며, 조건 및/또는 필요에 따라 다양한 조건이 적용될 수 있다.The conditions for determining whether to perform the processes S620 to S640 are not limited to the above-described embodiments, and various conditions may be applied according to conditions and/or needs.

한편, AMVP가 적용되는 경우 부호화기 및/또는 복호화기는 예측 움직임 벡터 후보 리스트 내의 예측 움직임 벡터 후보 중에서 현재 블록의 움직임 벡터와 가장 차이가 적은 후보를 현재 블록의 예측 움직임 벡터로 사용할 수 있고, 머지가 적용되는 경우 부호화기 및/또는 복호화기는 머지 후보 리스트 내의 머지 후보 중에서 최적의 부호화 효율을 제공할 수 있는 머지 후보를 현재 블록에 대한 움직임 정보로 사용할 수 있다. 예측 움직임 벡터 후보 리스트 및 머지 후보 리스트는 각각 시간적 움직임 정보 및/또는 공간적 움직임 정보를 포함할 수 있으므로, 결과적으로 현재 블록의 움직임 정보(예를 들어, 참조 픽쳐 번호, 움직임 정보 등)는 복원된 주변 블록의 움직임 정보를 기반으로 도출될 수 있다. 따라서, 상술한 L1 시간적 움직임 정보 재설정 단계(S640)에서, 부호화기 및 복호화기는 현재 블록의 예측 움직임 벡터 후보 리스트 및/또는 현재 블록의 머지 후보 리스트를 기반으로 L1 시간적 움직임 정보를 재설정할 수 있다. 이 경우, 상술한 복원된 주변 블록의 존재 유무를 판단하는 단계(S630)는 생략될 수 있다. 이하, 후술되는 실시예에서 움직임 정보 후보 리스트는 예측 움직임 벡터 후보 리스트 및 머지 후보 리스트를 포함하는 개념으로 이해될 수 있다.On the other hand, when AMVP is applied, the encoder and/or decoder may use the candidate with the smallest difference from the motion vector of the current block among the motion vector candidates in the prediction motion vector candidate list as the predicted motion vector of the current block, and the merge is applied. In this case, the encoder and/or decoder may use a merge candidate capable of providing optimal encoding efficiency among merge candidates in the merge candidate list as motion information for the current block. Since the prediction motion vector candidate list and the merge candidate list may include temporal motion information and/or spatial motion information, respectively, as a result, motion information (eg, reference picture number, motion information, etc.) of the current block is restored around It can be derived based on the motion information of the block. Therefore, in the above-described L1 temporal motion information resetting step S640 , the encoder and the decoder may reset the L1 temporal motion information based on the predicted motion vector candidate list of the current block and/or the merge candidate list of the current block. In this case, the step ( S630 ) of determining whether the above-described reconstructed neighboring blocks exist may be omitted. Hereinafter, in an embodiment to be described later, the motion information candidate list may be understood as a concept including a predictive motion vector candidate list and a merge candidate list.

상술한 바와 같이, 부호화기 및 복호화기는 현재 블록의 움직임 정보 후보 리스트를 기반으로, 현재 블록의 L1 시간적 움직임 정보를 재설정할 수 있다. 즉, 부호화기 및 복호화기는 현재 블록의 움직임 정보 후보 리스트에 포함된 움직임 정보 후보 중에서 하나를 L1 시간적 움직임 정보로 사용할 수 있다. 현재 블록의 움직임 정보 후보 리스트에서 L1 시간적 움직임 정보로 사용되는 움직임 정보는 다양한 방법으로 결정될 수 있다. As described above, the encoder and the decoder may reset the L1 temporal motion information of the current block based on the motion information candidate list of the current block. That is, the encoder and the decoder may use one of the motion information candidates included in the motion information candidate list of the current block as the L1 temporal motion information. Motion information used as L1 temporal motion information in the motion information candidate list of the current block may be determined in various ways.

일 실시예로, 부호화기 및 복호화기는 움직임 정보 후보 리스트 내의 움직임 정보 후보들을 첫 번째 움직임 정보 후보에서 마지막 움직임 정보 후보까지 순서대로 검색할 수 있다. 이 때, 부호화기 및 복호화기는 콜 블록을 기반으로 도출된 L1 시간적 움직임 정보의 L1 참조 픽쳐 번호와 동일한 참조 픽쳐 번호를 갖는 첫 번째 움직임 정보 후보를 현재 블록의 L1 시간적 움직임 정보로 사용할 수 있다. 이 때, 부호화기 및 복호화기는 상기 L1 참조 픽쳐 번호와 동일한 참조 픽쳐 번호를 갖는 첫 번째 움직임 정보 후보의 L0 움직임 정보를 사용할 수도 있고, 상기 L1 참조 픽쳐 번호와 동일한 참조 픽쳐 번호를 갖는 첫 번째 움직임 정보 후보의 L1 움직임 정보를 사용할 수도 있다. 한편, 움직임 정보 후보 리스트에, 콜 블록을 기반으로 도출된 L1 시간적 움직임 정보의 L1 참조 픽쳐 번호와 동일한 참조 픽쳐 번호를 갖는 움직임 정보가 존재하지 않을 수도 있다. 이 경우, 부호화기 및 복호화기는 복원된 주변 블록의 움직임 정보 중에서 상기 L1 참조 픽쳐 번호와 동일한 참조 픽쳐 번호를 갖는 움직임 정보를 움직임 정보 후보 리스트에 추가할 수도 있다. 이 때, 부호화기 및 복호화기는 복원된 주변 블록의 움직임 정보가 추가된 움직임 정보 후보 리스트를 기반으로 현재 블록의 L1 시간적 움직임 정보를 재설정할 수 있다.As an embodiment, the encoder and the decoder may sequentially search for motion information candidates in the motion information candidate list from a first motion information candidate to a last motion information candidate. In this case, the encoder and the decoder may use the first motion information candidate having the same reference picture number as the L1 reference picture number of the L1 temporal motion information derived based on the collocated block as the L1 temporal motion information of the current block. In this case, the encoder and the decoder may use the L0 motion information of the first motion information candidate having the same reference picture number as the L1 reference picture number, and the first motion information candidate having the same reference picture number as the L1 reference picture number. It is also possible to use L1 motion information of . Meanwhile, motion information having the same reference picture number as the L1 reference picture number of the L1 temporal motion information derived based on the collocated block may not exist in the motion information candidate list. In this case, the encoder and the decoder may add motion information having the same reference picture number as the L1 reference picture number among the motion information of the reconstructed neighboring blocks to the motion information candidate list. In this case, the encoder and the decoder may reset the L1 temporal motion information of the current block based on the motion information candidate list to which the motion information of the reconstructed neighboring block is added.

다른 실시예로, 부호화기 및 복호화기는 움직임 정보 후보 리스트 내에서 가용한 움직임 벡터를 갖는 첫 번째 움직임 정보 후보의 움직임 벡터를 현재 블록의 L1 시간적 움직임 정보로 사용할 수 있다. 이 때, 부호화기 및 복호화기는 상기 첫 번째 움직임 정보 후보의 L0 움직임 정보를 사용할 수도 있고, 상기 첫 번째 움직임 정보 후보의 L1 움직임 정보를 사용할 수도 있다.As another embodiment, the encoder and the decoder may use the motion vector of the first motion information candidate having the available motion vector in the motion information candidate list as the L1 temporal motion information of the current block. In this case, the encoder and the decoder may use the L0 motion information of the first motion information candidate or the L1 motion information of the first motion information candidate.

또 다른 실시예로, 부호화기 및 복호화기는 움직임 정보 후보 리스트 내에서 가용한 첫 번째 움직임 정보 후보를 현재 블록의 L1 시간적 움직임 정보로 사용할 수 있다. 이 경우, L1 시간적 움직임 정보의 L1 참조 픽쳐 번호는 상기 첫 번째 움직임 정보 후보의 참조 픽쳐 번호로 변경되거나 설정되고, L1 시간적 움직임 정보의 L1 움직임 벡터는 상기 첫 번째 움직임 정보 후보의 움직임 벡터로 변경되거나 설정될 수 있다. 이 때, 부호화기 및 복호화기는 상기 첫 번째 움직임 정보 후보의 L0 움직임 정보를 사용할 수도 있고, 상기 첫 번째 움직임 정보 후보의 L1 움직임 정보를 사용할 수도 있다.As another embodiment, the encoder and the decoder may use the first motion information candidate available in the motion information candidate list as the L1 temporal motion information of the current block. In this case, the L1 reference picture number of the L1 temporal motion information is changed or set to the reference picture number of the first motion information candidate, and the L1 motion vector of the L1 temporal motion information is changed to the motion vector of the first motion information candidate, or can be set. In this case, the encoder and the decoder may use the L0 motion information of the first motion information candidate or the L1 motion information of the first motion information candidate.

현재 블록의 움직임 정보 후보 리스트에서 L1 시간적 움직임 정보로 사용되는 움직임 정보 후보를 결정하는 방법은 상술한 실시예에 한정되지 않으며, 조건 및/또는 필요에 따라 다양한 조건이 적용될 수 있다. A method of determining a motion information candidate used as L1 temporal motion information in the motion information candidate list of the current block is not limited to the above-described embodiment, and various conditions may be applied according to conditions and/or needs.

상술한 실시예들에서, 현재 블록의 움직임 정보 후보 리스트에 가용한 움직임 정보가 없을 수도 있다. 이 경우, 일례로 부호화기 및 복호화기는 상술한 S640 단계에서와 같이, 복원된 주변 블록의 움직임 정보를 현재 블록의 L1 시간적 움직임 정보로 사용할 수 있다. 다른 예로 이 경우 부호화기 및 복호화기는, 복원된 주변 블록의 움직임 정보를 움직임 정보 후보 리스트에 추가할 수도 있으며, 영 벡터(0,0)를 움직임 정보 후보 리스트에 추가할 수도 있다. 이 때, 부호화기 및 복호화기는 복원된 주변 블록의 움직임 정보가 추가된 움직임 정보 후보 리스트 또는 영 벡터(0,0)가 추가된 움직임 정보 후보 리스트를 기반으로 현재 블록의 L1 시간적 움직임 정보를 재설정할 수 있다. In the above-described embodiments, there may be no motion information available in the motion information candidate list of the current block. In this case, as an example, the encoder and the decoder may use the motion information of the reconstructed neighboring block as the L1 temporal motion information of the current block, as in step S640 described above. As another example, in this case, the encoder and the decoder may add the motion information of the reconstructed neighboring block to the motion information candidate list, and may add a zero vector (0,0) to the motion information candidate list. In this case, the encoder and the decoder may reset the L1 temporal motion information of the current block based on the motion information candidate list to which the motion information of the reconstructed neighboring block is added or the motion information candidate list to which the zero vector (0,0) is added. have.

상술한 실시예들에서 L0 시간적 움직임 정보 및 L1 시간적 움직임 정보는 시간적으로 도출된 움직임 정보이므로, 객체의 이동에 의한 움직임 정보에 해당될 가능성이 높다. 따라서, 부호화기 및 복호화기는 복원된 주변 블록 및/또는 움직임 정보 후보 리스트에서 현재 블록의 L1 시간적 움직임 정보로 사용될 움직임 정보를 탐색할 때, 영 벡터(0,0)를 갖는 움직임 정보는 선택하지 않고 영 벡터(0,0)를 갖지 않는 움직임 정보를 선택할 수도 있다. 이는 영 벡터(0,0)에 해당되는 움직임 정보를 갖는 블록은, 객체가 아닌 배경에 해당될 가능성이 높기 때문이다.In the above-described embodiments, since the L0 temporal motion information and the L1 temporal motion information are temporally derived motion information, there is a high possibility that they correspond to motion information due to the movement of an object. Accordingly, when the encoder and the decoder search for motion information to be used as L1 temporal motion information of the current block from the reconstructed neighboring block and/or motion information candidate list, motion information having a zero vector (0,0) is not selected and zero It is also possible to select motion information that does not have a vector (0,0). This is because a block having motion information corresponding to a zero vector (0, 0) is highly likely to correspond to a background rather than an object.

한편, 재설정된 L1 시간적 움직임 정보는 현재 블록의 L0 시간적 움직임 정보와 동일할 수도 있다. 따라서, 부호화기 및 복호화기는 복원된 주변 블록 및/또는 움직임 정보 후보 리스트에서 현재 블록의 L1 시간적 움직임 정보로 사용될 움직임 정보를 탐색할 때, L0 시간적 움직임 정보와 동일하지 않은 움직임 정보를 선택할 수 있다. 예를 들어, 상술한 S640에서와 같이, 복원된 주변 블록을 기반으로 현재 블록의 L1 시간적 움직임 정보를 도출하는 경우, 부호화기 및 복호화기는 현재 블록의 L0 시간적 움직임 정보와 다른 움직임 정보를 갖는 블록을 상기 L1 시간적 움직임 정보 도출에 사용되는 블록으로 결정할 수 있다. 이 때, 부호화기 및 복호화기는 현재 블록의 L0 시간적 움직임 정보와의 차이가 소정의 임계값(threshold) 이하인 움직임 정보만을, 현재 블록의 L1 시간적 움직임 정보로 사용될 움직임 정보로 선택할 수도 있다. 여기서, 상기 소정의 임계값은 현재 블록의 모드 정보, 현재 블록의 움직임 정보, 주변 블록의 모드 정보 및/또는 주변 블록의 움직임 정보 등을 기반으로 정해질 수 있으며, 다양한 방식으로 결정될 수 있다.Meanwhile, the reset L1 temporal motion information may be the same as the L0 temporal motion information of the current block. Accordingly, the encoder and the decoder may select motion information that is not identical to the L0 temporal motion information when searching for motion information to be used as the L1 temporal motion information of the current block from the reconstructed neighboring block and/or motion information candidate list. For example, as in S640 described above, when the L1 temporal motion information of the current block is derived based on the reconstructed neighboring block, the encoder and the decoder may select a block having motion information different from the L0 temporal motion information of the current block. It can be determined as a block used for deriving L1 temporal motion information. In this case, the encoder and the decoder may select only motion information whose difference from the L0 temporal motion information of the current block is less than or equal to a predetermined threshold as motion information to be used as the L1 temporal motion information of the current block. Here, the predetermined threshold value may be determined based on mode information of the current block, motion information of the current block, mode information of the neighboring block, and/or motion information of the neighboring block, and may be determined in various ways.

또한, 상술한 실시예들에서, 복원된 주변 블록의 움직임 정보 및 움직임 정보 후보 리스트로부터 선택된 움직임 정보는 각각 L0 움직임 정보 및 L1 움직임 정보를 모두 포함할 수 있다. 이 경우, 부호화기 및 복호화기는 상기 L0 움직임 정보 및 L1 움직임 정보 중에서 하나의 움직임 정보를, 현재 블록의 L1 시간적 움직임 정보로 사용될 움직임 정보로 결정할 수 있다. 일례로, 부호화기 및 복호화기는 복원된 주변 블록의 움직임 정보 및/또는 움직임 정보 후보 리스트로부터 선택된 움직임 정보에서 L0 움직임 정보를 현재 블록의 L1 시간적 움직임 정보로 사용할 수 있다. 이 때, 복원된 주변 블록의 움직임 정보 및/또는 움직임 정보 후보 리스트로부터 선택된 움직임 정보에 L0 움직임 정보가 존재하지 않는 경우, 부호화기 및 복호화기는 L1 움직임 정보를 현재 블록의 L1 시간적 움직임 정보로 사용할 수 있다. 다른 예로, 부호화기 및 복호화기는 복원된 주변 블록의 움직임 정보 및/또는 움직임 정보 후보 리스트로부터 선택된 움직임 정보에서 L1 움직임 정보를 현재 블록의 L1 시간적 움직임 정보로 사용할 수 있다. 이 때, 복원된 주변 블록의 움직임 정보 및/또는 움직임 정보 후보 리스트로부터 선택된 움직임 정보에 L1 움직임 정보가 존재하지 않는 경우, 부호화기 및 복호화기는 L0 움직임 정보를 현재 블록의 L1 시간적 움직임 정보로 사용할 수 있다.Also, in the above-described embodiments, the motion information of the reconstructed neighboring block and the motion information selected from the motion information candidate list may include both L0 motion information and L1 motion information, respectively. In this case, the encoder and the decoder may determine one of the L0 motion information and the L1 motion information as motion information to be used as the L1 temporal motion information of the current block. For example, the encoder and the decoder may use the L0 motion information from the motion information of the reconstructed neighboring block and/or the motion information selected from the motion information candidate list as the L1 temporal motion information of the current block. In this case, when the L0 motion information does not exist in the motion information of the reconstructed neighboring block and/or the motion information selected from the motion information candidate list, the encoder and the decoder may use the L1 motion information as the L1 temporal motion information of the current block. . As another example, the encoder and the decoder may use the L1 motion information from the motion information of the reconstructed neighboring block and/or the motion information selected from the motion information candidate list as the L1 temporal motion information of the current block. In this case, when the L1 motion information does not exist in the motion information of the reconstructed neighboring block and/or the motion information selected from the motion information candidate list, the encoder and the decoder may use the L0 motion information as the L1 temporal motion information of the current block. .

한편, 부호화기 및 복호화기는 상술한 S640 단계에서 현재 블록의 L1 시간적 움직임 정보(예를 들어, L1 움직임 벡터)를 재설정하기 위해, 복원된 주변 블록의 움직임 정보 및/또는 움직임 정보 후보 리스트를 사용하지 않을 수도 있다. 이 때, 부호화기 및 복호화기는 현재 블록의 L0 시간적 움직임 정보(예를 들어, L0 움직임 벡터)를 기반으로 현재 블록의 L1 시간적 움직임 정보(예를 들어, L1 움직임 벡터)를 재설정할 수 있다. 이하, 이와 관련된 실시예들이 서술되며 이는 움직임 벡터를 기준으로 서술하기로 한다.On the other hand, the encoder and the decoder do not use the motion information and/or the motion information candidate list of the reconstructed neighboring block to reset the L1 temporal motion information (eg, the L1 motion vector) of the current block in step S640 described above. may be In this case, the encoder and the decoder may reset L1 temporal motion information (eg, L1 motion vector) of the current block based on L0 temporal motion information (eg, L0 motion vector) of the current block. Hereinafter, related embodiments will be described, which will be described based on a motion vector.

일 실시예로, 부호화기 및 복호화기는 현재 블록의 L0 시간적 움직임 정보(L0 움직임 벡터)가 지시하는 위치에서 소정의 거리 및/또는 방향을 기반으로 이동된 상대적인 위치를 지시하는 움직임 정보를 현재 블록의 L1 시간적 움직임 정보(L1 움직임 벡터)로 사용할 수 있다. 일례로, 부호화기 및 복호화기는 현재 블록의 L0 시간적 움직임 정보가 지시하는 위치에서 수직 및/또는 수평 방향으로 1/4 픽셀 크기(예를 들어, (-1,0), (1,0), (0,-1), (0,1), (-1,-1), (-1,1), (1,-1), (1,1) 등. 여기서, 1/4 픽셀 단위는 1에 해당됨.)만큼 이동된 위치를 지시하는 움직임 정보를 현재 블록의 L1 시간적 움직임 정보로 사용할 수 있다. 다른 예로, 부호화기 및 복호화기는 현재 블록의 L0 시간적 움직임 정보가 지시하는 위치에서 수직 및/또는 수평 방향으로 1/2 픽셀 크기(예를 들어, (-2,0), (2,0), (0,-2), (0,2), (-2,-2), (-2,2), (2,-2), (2,2) 등. 여기서, 1/4 픽셀 단위는 1에 해당됨.)만큼 이동된 위치를 지시하는 움직임 정보를 현재 블록의 L1 시간적 움직임 정보로 사용할 수 있다. 또 다른 예로, 부호화기 및 복호화기는 현재 블록의 L0 시간적 움직임 정보가 지시하는 위치에서 수직 및/또는 수평 방향으로 정수 픽셀 크기(예를 들어, (-4,0), (4,0), (0,-4), (0,4), (-4,-4), (-4,4), (4,-4), (4,4) 등. 여기서, 1/4 픽셀 단위는 1에 해당됨.)만큼 이동된 위치를 지시하는 움직임 정보를 현재 블록의 L1 시간적 움직임 정보로 사용할 수도 있다. 한편, 움직임 벡터는 수직 방향 성분 및 수평 방향 성분을 포함하므로, 상술한 방법들(1/4 픽셀 크기만큼 이동, 1/2 픽셀 크기만큼 이동, 정수 픽셀 크기만큼 이동)은 수평 방향 성분 및 수직 방향 성분에 대해 각각 독립적으로 적용될 수도 있다. 이 때, 수평 방향의 이동 거리 및 수직 방향의 이동 거리는 서로 다를 수도 있다.In an embodiment, the encoder and the decoder transmit motion information indicating a relative position moved based on a predetermined distance and/or direction from a position indicated by the L0 temporal motion information (L0 motion vector) of the current block to the L1 of the current block. It can be used as temporal motion information (L1 motion vector). As an example, the encoder and the decoder have a 1/4 pixel size (eg, (-1,0), (1,0), ( 0,-1), (0,1), (-1,-1), (-1,1), (1,-1), (1,1), etc. where 1/4 pixel unit is 1 ) may be used as the L1 temporal motion information of the current block. As another example, the encoder and the decoder have a 1/2 pixel size (eg, (-2,0), (2,0), ( 0,-2), (0,2), (-2,-2), (-2,2), (2,-2), (2,2), etc. where 1/4 pixel unit is 1 ) may be used as the L1 temporal motion information of the current block. As another example, the encoder and the decoder have integer pixel sizes (eg, (-4,0), (4,0), (0) in the vertical and/or horizontal direction at the position indicated by the L0 temporal motion information of the current block. ,-4), (0,4), (-4,-4), (-4,4), (4,-4), (4,4), etc. where 1/4 pixel unit is 1 The motion information indicating the position moved by the corresponding amount) may be used as the L1 temporal motion information of the current block. On the other hand, since the motion vector includes a vertical component and a horizontal component, the above-described methods (moving by 1/4 pixel size, moving by 1/2 pixel size, moving by integer pixel size) include a horizontal component and a vertical component. Each component may be independently applied. In this case, the moving distance in the horizontal direction and the moving distance in the vertical direction may be different from each other.

다른 실시예로, 부호화기 및 복호화기는 현재 블록의 L0 시간적 움직임 정보(L0 움직임 벡터)의 값을 다른 픽셀 단위의 값으로 변경한 후 변경된 값을 현재 블록의 L1 시간적 움직임 정보(L1 움직임 벡터)로 사용할 수 있다. 일례로, 현재 블록의 L0 시간적 움직임 정보의 값이 1/4 픽셀 단위의 값인 경우, 부호화기 및 복호화기는 쉬프트 연산 등을 기반으로 상기 L0 시간적 움직임 정보의 값을 1/2 픽셀 단위의 값으로 변경할 수 있고, 상기 변경된 값을 현재 블록의 L1 시간적 움직임 정보로 사용할 수 있다. 다른 예로, 현재 블록의 L0 시간적 움직임 정보의 값이 1/2 픽셀 단위의 값인 경우, 부호화기 및 복호화기는 쉬프트 연산 등을 기반으로 상기 L0 시간적 움직임 정보의 값을 정수 픽셀 단위의 값으로 변경할 수 있고, 상기 변경된 값을 현재 블록의 L1 시간적 움직임 정보로 사용할 수 있다.In another embodiment, the encoder and the decoder change the value of the L0 temporal motion information (L0 motion vector) of the current block to a value of another pixel unit, and then use the changed value as the L1 temporal motion information (L1 motion vector) of the current block. can As an example, when the value of the L0 temporal motion information of the current block is a value in units of 1/4 pixels, the encoder and the decoder can change the value of the L0 temporal motion information to a value in units of 1/2 pixels based on a shift operation, etc. and the changed value may be used as L1 temporal motion information of the current block. As another example, if the value of the L0 temporal motion information of the current block is a value of 1/2 pixel unit, the encoder and the decoder may change the value of the L0 temporal motion information to a value of integer pixel units based on a shift operation, etc., The changed value may be used as L1 temporal motion information of the current block.

현재 블록의 L0 시간적 움직임 정보(예를 들어, L0 움직임 벡터)를 기반으로 현재 블록의 L1 시간적 움직임 정보(예를 들어, L1 움직임 벡터)를 재설정하는 방법은 상술한 실시예에 한정되지 않으며, 구현 및/또는 필요에 따라 다양한 형태로 적용될 수 있다.The method of resetting the L1 temporal motion information (eg, L1 motion vector) of the current block based on the L0 temporal motion information (eg, L0 motion vector) of the current block is not limited to the above-described embodiment, and the implementation and/or may be applied in various forms as needed.

한편, 상술한 실시예에서 시간적 움직임 정보 재설정 전 S610 단계로 입력되는 시간적 움직임 정보는 움직임 벡터뿐만 아니라 참조 픽쳐 인덱스(reference picture index)도 포함할 수 있다. 여기서, L0 움직임 벡터 및 L1 움직임 벡터는 상술한 바와 같이 콜 블록을 기반으로 시간적으로 도출된 움직임 벡터일 수 있고, L0 참조 픽쳐 인덱스 및 L1 참조 픽쳐 인덱스는 복원된 주변 블록으로부터 공간적으로 도출된 참조 픽쳐 인덱스일 수 있다. 이 때, 상기 L0 참조 픽쳐 인덱스 및 상기 L1 참조 픽쳐 인덱스는, 복원된 주변 블록의 참조 픽쳐 인덱스 중에서 음수가 아닌 가장 작은 값으로 설정될 수 있다. 한편, 다른 예로 L0 입력 참조 픽쳐 인덱스 및 L1 입력 참조 픽쳐 인덱스는 복원된 주변 블록의 움직임 정보에 관계 없이 0으로 설정될 수도 있다.Meanwhile, in the above-described embodiment, the temporal motion information input to step S610 before resetting the temporal motion information may include not only a motion vector but also a reference picture index. Here, the L0 motion vector and the L1 motion vector may be motion vectors temporally derived based on the collocated block as described above, and the L0 reference picture index and the L1 reference picture index are spatially derived reference pictures from the reconstructed neighboring blocks. It can be an index. In this case, the L0 reference picture index and the L1 reference picture index may be set to the smallest non-negative value among the reference picture indexes of the reconstructed neighboring blocks. Meanwhile, as another example, the L0 input reference picture index and the L1 input reference picture index may be set to 0 regardless of the motion information of the reconstructed neighboring blocks.

L1 시간적 움직임 정보의 L1 움직임 벡터가 복원된 주변 블록을 기반으로 재설정되는 경우, L1 시간적 움직임 정보의 L1 참조 픽쳐 인덱스에 대해서도 재설정 과정이 수행될 수 있다. When the L1 motion vector of the L1 temporal motion information is reset based on the reconstructed neighboring block, the resetting process may also be performed on the L1 reference picture index of the L1 temporal motion information.

이하, 후술되는 도 6 내지 도 8의 실시예에 한하여 설명의 편의상 시간적 움직임 정보 재설정 전 S610 단계로 입력되는 시간적 움직임 정보는 입력 시간적 움직임 정보(L0 입력 시간적 움직임 정보, L1 입력 시간적 움직임 정보)라 한다. 또한 입력 시간적 움직임 정보에 포함된 움직임 벡터는 입력 움직임 벡터(L0 입력 움직임 벡터, L1 입력 움직임 벡터), 입력 시간적 움직임 정보에 포함된 참조 픽쳐 인덱스는 입력 참조 픽쳐 인덱스(L0 입력 참조 픽쳐 인덱스, L1 입력 참조 픽쳐 인덱스), 입력 시간적 움직임 정보에 포함된 참조 픽쳐 번호는 입력 참조 픽쳐 번호(L0 입력 참조 픽쳐 번호, L1 입력 참조 픽쳐 번호)라 한다.Hereinafter, only for the embodiments of FIGS. 6 to 8, which will be described later, for convenience of explanation, the temporal motion information input to step S610 before resetting the temporal motion information is called input temporal motion information (L0 input temporal motion information, L1 input temporal motion information). . In addition, the motion vector included in the input temporal motion information is an input motion vector (L0 input motion vector, L1 input motion vector), and the reference picture index included in the input temporal motion information is an input reference picture index (L0 input reference picture index, L1 input). A reference picture index) and a reference picture number included in the input temporal motion information are referred to as an input reference picture number (L0 input reference picture number, L1 input reference picture number).

상술한 바와 같이, L1 입력 움직임 벡터가 재설정되는 경우, 부호화기 및 복호화기는 L1 입력 참조 픽쳐 인덱스에 대해서도 재설정 과정을 수행할 수 있다. 이하, L1 입력 참조 픽쳐 인덱스에 대한 재설정 과정의 실시예들이 서술된다. As described above, when the L1 input motion vector is reset, the encoder and the decoder may also perform a reset process on the L1 input reference picture index. Hereinafter, embodiments of the reset process for the L1 input reference picture index will be described.

일 실시예로, 부호화기 및 복호화기는 복원된 주변 블록을 기반으로 L1 입력 참조 픽쳐 인덱스를 재설정할 수 있다. 상술한 바와 같이, 부호화기 및 복호화기는 복원된 주변 블록의 움직임 정보를 현재 블록의 L1 시간적 움직임 정보로 사용할 수 있다. 이 때, 부호화기 및 복호화기는 L1 입력 참조 픽쳐 인덱스를 상기 복원된 주변 블록의 참조 픽쳐 인덱스로 재설정함으로써 최종 L1 참조 픽쳐 인덱스를 도출할 수 있다. 다른 실시예로, 부호화기 및 복호화기는 L1 입력 참조 픽쳐 인덱스 값을 소정의 고정된 참조 픽쳐 인덱스 값으로 재설정함으로써 최종 L1 참조 픽쳐 인덱스를 도출할 수도 있다. As an embodiment, the encoder and the decoder may reset the L1 input reference picture index based on the reconstructed neighboring blocks. As described above, the encoder and the decoder may use the reconstructed motion information of the neighboring block as the L1 temporal motion information of the current block. In this case, the encoder and the decoder may derive the final L1 reference picture index by resetting the L1 input reference picture index to the reference picture index of the reconstructed neighboring block. In another embodiment, the encoder and the decoder may derive the final L1 reference picture index by resetting the L1 input reference picture index value to a predetermined fixed reference picture index value.

또 다른 실시예로, L0 입력 시간적 움직임 정보(예를 들어, L0 입력 움직임 벡터, L0 입력 참조 픽쳐 인덱스 등) 와 L1 입력 시간적 움직임 정보(예를 들어, L1 입력 움직임 벡터, L1 입력 참조 픽쳐 인덱스 등)가 동일한 경우, 부호화기 및 복호화기는 L0 입력 참조 픽쳐 인덱스 및 L1 입력 참조 픽쳐 인덱스를 모두 0의 값으로 재설정하여 최종 시간적 움직임 정보로 사용할 수도 있다. 이는, L0 입력 시간적 움직임 정보와 L1 입력 시간적 움직임 정보가 동일한 경우, L0 참조 픽쳐 인덱스 및 L1 참조 픽쳐 인덱스가 모두 0일 확률이 높기 때문이다.In another embodiment, L0 input temporal motion information (eg, L0 input motion vector, L0 input reference picture index, etc.) and L1 input temporal motion information (eg, L1 input motion vector, L1 input reference picture index, etc.) ) is the same, the encoder and the decoder may reset both the L0 input reference picture index and the L1 input reference picture index to a value of 0 to use as final temporal motion information. This is because, when the L0 input temporal motion information and the L1 input temporal motion information are the same, there is a high probability that both the L0 reference picture index and the L1 reference picture index are 0.

또 다른 실시예로, 부호화기 및 복호화기는 L1 입력 참조 픽쳐 인덱스를 L0 입력 참조 픽쳐 인덱스와 동일한 값으로 재설정할 수 있다. 반면, 부호화기 및 복호화기는 L1 입력 참조 픽쳐 인덱스 값을 L0 입력 참조 픽쳐 인덱스와 동일하지 않은 참조 픽쳐 인덱스 값으로 재설정할 수도 있다. 일례로, 복원된 주변 블록이 갖는 참조 픽쳐 인덱스 중에 L0 입력 참조 픽쳐 인덱스와 동일하지 않은 참조 픽쳐 인덱스가 존재할 수 있다. 이 때, 예를 들어 부호화기 및 복호화기는 L1 입력 참조 픽쳐 인덱스의 재설정을 위해, 상기 L0 입력 참조 픽쳐 인덱스와 동일하지 않은 참조 픽쳐 인덱스 중에서 가장 자주 사용된 참조 픽쳐 인덱스를 사용할 수 있다. 다른 예로, 이 때 부호화기 및 복호화기는 L1 입력 참조 픽쳐 인덱스의 재설정을 위해, 상기 L0 입력 참조 픽쳐 인덱스와 동일하지 않은 참조 픽쳐 인덱스 중에서 음수가 아닌 가장 작은 값을 갖는 참조 픽쳐 인덱스를 사용할 수도 있다.As another embodiment, the encoder and the decoder may reset the L1 input reference picture index to the same value as the L0 input reference picture index. On the other hand, the encoder and the decoder may reset the L1 input reference picture index value to a reference picture index value that is not the same as the L0 input reference picture index. As an example, a reference picture index that is not the same as the L0 input reference picture index may exist among the reference picture indexes of the reconstructed neighboring blocks. In this case, for example, the encoder and the decoder may use the most frequently used reference picture index among reference picture indexes that are not the same as the L0 input reference picture index to reset the L1 input reference picture index. As another example, in this case, the encoder and the decoder may use the reference picture index having the smallest non-negative value among the reference picture indices that are not the same as the L0 input reference picture index to reset the L1 input reference picture index.

한편, 상술한 바와 같이 부호화기 및 복호화기는 L1 입력 시간적 움직임 정보에서 L1 입력 움직임 벡터 값을 복원된 주변 블록의 움직임 벡터와 동일한 값으로 재설정함으로써 최종 L1 시간적 움직임 벡터를 도출할 수 있다. 이 때, 상기 복원된 주변 블록의 움직임 벡터는 L1 입력 참조 픽쳐 인덱스 및/또는 재설정된 L1 참조 픽쳐 인덱스에 따라 스케일링되어 사용될 수도 있다. L1 입력 시간적 움직임 정보에서 L1 입력 참조 픽쳐 인덱스는 재설정 과정 없이 그대로 최종 L1 시간적 움직임 정보로 사용될 수도 있고, 상술한 실시예에서와 같이 재설정 과정을 거쳐 최종 L1 시간적 움직임 정보로 사용될 수도 있다. 이 때, 복원된 주변 블록의 움직임 벡터에 대응하는 참조 픽쳐, 및 최종 L1 참조 픽쳐 인덱스가 지시하는 참조 픽쳐는 서로 다를 수 있다. 이 경우, 부호화기 및 복호화기는 복원된 주변 블록의 움직임 벡터에 대한 스케일링을 수행하고 스케일링된 움직임 벡터를 현재 블록의 최종 L1 시간적 움직임 정보로 사용할 수 있다.Meanwhile, as described above, the encoder and the decoder may derive the final L1 temporal motion vector by resetting the L1 input motion vector value in the L1 input temporal motion information to the same value as the motion vector of the reconstructed neighboring block. In this case, the motion vector of the reconstructed neighboring block may be scaled and used according to the L1 input reference picture index and/or the reset L1 reference picture index. In the L1 input temporal motion information, the L1 input reference picture index may be used as the final L1 temporal motion information as it is without a resetting process, or may be used as the final L1 temporal motion information through a resetting process as in the above-described embodiment. In this case, the reference picture corresponding to the motion vector of the reconstructed neighboring block and the reference picture indicated by the final L1 reference picture index may be different from each other. In this case, the encoder and the decoder may perform scaling on the motion vector of the reconstructed neighboring block and use the scaled motion vector as the final L1 temporal motion information of the current block.

상술한 실시예들은 움직임 벡터의 재설정 과정 및 참조 픽쳐 인덱스(예를 들어, RefIdxLX, X=0,1)의 재설정 과정에 따라 다양한 방법으로 조합되어 적용될 수 있다. 이하, 후술되는 실시예들에서 L1 입력 움직임 벡터는 복원된 주변 블록을 기반으로 재설정된다고 가정한다. 즉, 부호화기 및 복호화기는 L1 입력 움직임 벡터를 복원된 주변 블록의 움직임 벡터 중에서 하나의 값으로 재설정한다고 가정한다.The above-described embodiments may be combined and applied in various ways according to a motion vector resetting process and a reference picture index resetting process (eg, RefIdxLX, X=0,1). Hereinafter, it is assumed that the L1 input motion vector is reset based on the reconstructed neighboring block in the embodiments to be described below. That is, it is assumed that the encoder and the decoder reset the L1 input motion vector to one of the motion vectors of the reconstructed neighboring blocks.

일 실시예로, 부호화기 및 복호화기는 L1 입력 움직임 벡터의 재설정을 위해, 복원된 주변 블록의 움직임 벡터 중에서 영 벡터(0,0)가 아닌 움직임 벡터만을 사용할 수 있다. 이 때, 일례로 L1 입력 참조 픽쳐 인덱스는 재설정 과정 없이 그대로 최종 L1 시간적 움직임 정보로 사용될 수 있다. 다른 예로, L1 입력 참조 픽쳐 인덱스 값은 복원된 주변 블록이 갖는 참조 픽쳐 인덱스 값으로 재설정될 수 있고, 재설정된 참조 픽쳐 인덱스가 최종 L1 시간적 움직임 정보로 사용될 수 있다. 또 다른 예로, L1 입력 참조 픽쳐 인덱스 값은 소정의 고정된 참조 픽쳐 인덱스 값으로 재설정될 수도 있다. 이들 각각에 대한 구체적인 실시예는 상술한 바 있으므로, 여기서는 생략하기로 한다.In an embodiment, the encoder and the decoder may use only a motion vector other than a zero vector (0,0) among motion vectors of reconstructed neighboring blocks to reset the L1 input motion vector. In this case, for example, the L1 input reference picture index may be used as the final L1 temporal motion information as it is without a reset process. As another example, the L1 input reference picture index value may be reset to the reference picture index value of the reconstructed neighboring block, and the reset reference picture index may be used as the final L1 temporal motion information. As another example, the L1 input reference picture index value may be reset to a predetermined fixed reference picture index value. Specific examples of each of these have been described above, and thus will be omitted here.

다른 실시예로, 부호화기 및 복호화기는 L1 입력 움직임 벡터의 재설정을 위해, 복원된 주변 블록의 움직임 벡터를 스케일링하여 사용할 수 있다. 이 경우, 상기 스케일링된 움직임 벡터가 최종 L1 시간적 움직임 정보로 사용될 수 있다. 이 때, 일례로 L1 입력 참조 픽쳐 인덱스는 재설정 과정 없이 그대로 최종 L1 시간적 움직임 정보로 사용될 수 있다. 다른 예로, L1 입력 참조 픽쳐 인덱스 값은 복원된 주변 블록이 갖는 참조 픽쳐 인덱스 값으로 재설정될 수 있고, 재설정된 참조 픽쳐 인덱스가 최종 L1 시간적 움직임 정보로 사용될 수 있다. 또 다른 예로, L1 입력 참조 픽쳐 인덱스 값은 소정의 고정된 참조 픽쳐 인덱스 값으로 재설정될 수도 있다. 이들 각각에 대한 구체적인 실시예는 상술한 바 있으므로, 여기서는 생략하기로 한다.In another embodiment, the encoder and the decoder may scale and use the motion vector of the reconstructed neighboring block to reset the L1 input motion vector. In this case, the scaled motion vector may be used as the final L1 temporal motion information. In this case, for example, the L1 input reference picture index may be used as the final L1 temporal motion information as it is without a reset process. As another example, the L1 input reference picture index value may be reset to the reference picture index value of the reconstructed neighboring block, and the reset reference picture index may be used as the final L1 temporal motion information. As another example, the L1 input reference picture index value may be reset to a predetermined fixed reference picture index value. Specific examples of each of these have been described above, and thus will be omitted here.

또 다른 실시예로, 부호화기 및 복호화기는 L1 입력 움직임 벡터의 재설정을 위해, 복원된 주변 블록의 움직임 벡터 중에서 현재 블록의 L0 시간적 움직임 정보(L0 움직임 벡터)와의 차이가 소정의 임계값 이하인 움직임 벡터만을 사용할 수 있다. 이 경우, 부호화기 및 복호화기는 복원된 주변 블록의 움직임 벡터 중에서 현재 블록의 L0 시간적 움직임 정보(L0 움직임 벡터)와 동일하지 않은 움직임 벡터만을 사용할 수도 있다. 이 때, 일례로 L1 입력 참조 픽쳐 인덱스는 재설정 과정 없이 그대로 최종 L1 시간적 움직임 정보로 사용될 수 있다. 다른 예로, L1 입력 참조 픽쳐 인덱스 값은 복원된 주변 블록이 갖는 참조 픽쳐 인덱스 값으로 재설정될 수 있고, 재설정된 참조 픽쳐 인덱스가 최종 L1 시간적 움직임 정보로 사용될 수 있다. 또 다른 예로, L1 입력 참조 픽쳐 인덱스 값은 소정의 고정된 참조 픽쳐 인덱스 값으로 재설정될 수도 있다. 이들 각각에 대한 구체적인 실시예는 상술한 바 있으므로, 여기서는 생략하기로 한다.In another embodiment, in order to reset the L1 input motion vector, the encoder and the decoder only use motion vectors whose difference from the L0 temporal motion information (L0 motion vector) of the current block is less than or equal to a predetermined threshold among motion vectors of the reconstructed neighboring blocks. Can be used. In this case, the encoder and the decoder may use only a motion vector that is not identical to the L0 temporal motion information (L0 motion vector) of the current block among the motion vectors of the reconstructed neighboring blocks. In this case, for example, the L1 input reference picture index may be used as the final L1 temporal motion information as it is without a reset process. As another example, the L1 input reference picture index value may be reset to the reference picture index value of the reconstructed neighboring block, and the reset reference picture index may be used as the final L1 temporal motion information. As another example, the L1 input reference picture index value may be reset to a predetermined fixed reference picture index value. Specific examples of each of these have been described above, and thus will be omitted here.

움직임 벡터의 재설정 과정 및 참조 픽쳐 인덱스의 재설정 과정의 실시예들의 조합은 상술한 실시예에 한정되는 것이 아니며, 구현 및/또는 필요에 따라 상술한 실시예들 뿐만 아니라 다양한 형태의 조합이 제공될 수 있다.The combination of the embodiments of the motion vector resetting process and the reference picture index resetting process is not limited to the above-described embodiment, and various types of combinations may be provided as well as the above-described embodiments according to implementation and/or necessity. have.

한편, 상술한 바와 같이 재설정된 L1 시간적 움직임 정보는 현재 블록의 L0 시간적 움직임 정보와 동일할 수 있다. 따라서, 재설정된 L1 시간적 움직임 정보가 현재 블록의 L0 시간적 움직임 정보와 동일한 경우, 부호화기 및 복호화기는 현재 블록의 예측 방향 정보를 단방향 예측으로 다시 설정할 수 있다. 이 때, 부호화기 및 복호화기는 L0 시간적 움직임 정보만을 현재 블록의 시간적 움직임 정보로 사용할 수 있다. 이러한 방법은 상술한 실시예들과 결합된 조합으로서 본 발명에 적용될 수 있다.Meanwhile, the L1 temporal motion information reset as described above may be the same as the L0 temporal motion information of the current block. Accordingly, when the reset L1 temporal motion information is the same as the L0 temporal motion information of the current block, the encoder and the decoder may reset the prediction direction information of the current block to unidirectional prediction. In this case, the encoder and the decoder may use only the L0 temporal motion information as the temporal motion information of the current block. This method can be applied to the present invention in combination with the above-described embodiments.

도 7은 L1 시간적 움직임 정보의 재설정을 위해 사용되는 복원된 주변 블록의 실시예를 개략적으로 나타내는 도면이다. 도 7에서 블록 710은 현재 블록(X)을 나타낸다. 7 is a diagram schematically illustrating an embodiment of a reconstructed neighboring block used for resetting L1 temporal motion information. In FIG. 7, block 710 represents the current block (X).

상술한 바와 같이, 복원된 주변 블록은 이미 부호화 및/또는 복호화되어 복원된 현재 픽쳐 내의 블록으로서, 현재 블록(710)에 인접한 블록 및/또는 현재 블록의 외부 코너에 위치한 블록을 포함할 수 있다. 도 7의 실시예에서 현재 블록(710) 외부의 좌측 하단 코너에 위치한 블록은 좌측 하단 코너 블록(A)이라 하고, 현재 블록(710) 외부의 좌측 상단 코너에 위치한 블록은 좌측 상단 코너 블록(E)이라 하며, 현재 블록(710) 외부의 우측 상단 코너에 위치한 블록은 우측 상단 코너 블록(C)이라 한다. 또한 현재 블록(710) 좌측에 인접한 블록 중에서 가장 상단에 위치한 블록은 좌측 최상단 블록(F), 현재 블록(710) 좌측에 인접한 블록 중에서 가장 하단에 위치한 블록은 좌측 최하단 블록(A), 현재 블록(710) 상단에 인접한 블록 중에서 가장 좌측에 위치한 블록은 상단 최좌측 블록(G), 현재 블록(710) 상단에 인접한 블록 중에서 가장 우측에 위치한 블록은 상단 최우측 블록(B)이라 한다.As described above, the reconstructed neighboring block is a block in the reconstructed current picture that has already been encoded and/or decoded, and may include a block adjacent to the current block 710 and/or a block located at an outer corner of the current block. In the embodiment of FIG. 7 , the block located at the lower left corner outside the current block 710 is called a lower left corner block (A), and the block located at the upper left corner outside the current block 710 is the upper left corner block (E) ), and the block located in the upper right corner outside the current block 710 is referred to as the upper right corner block (C). Also, among the blocks adjacent to the left of the current block 710, the uppermost block is the upper left block (F), the lowermost block among the blocks adjacent to the left of the current block 710 is the left lowermost block (A), the current block ( 710) Among the blocks adjacent to the top, the leftmost block is called the top leftmost block (G), and the rightmost block among the blocks adjacent to the top of the current block 710 is called the top rightmost block (B).

도 6의 실시예에서 상술한 바와 같이, 부호화기 및 복호화기는 소정의 조건에 따라 복원된 주변 블록의 움직임 정보를 현재 블록의 L1 시간적 움직임 정보로 사용할 수 있다. 즉, 부호화기 및 복호화기는 현재 블록의 L1 시간적 움직임 정보 값을 복원된 주변 블록의 움직임 정보 값으로 재설정할 수 있다. 이 때, 현재 블록의 L1 시간적 움직임 정보로 사용되는 움직임 정보는 다양한 방법으로 도출될 수 있다.As described above in the embodiment of FIG. 6 , the encoder and the decoder may use the motion information of the neighboring block reconstructed according to a predetermined condition as the L1 temporal motion information of the current block. That is, the encoder and the decoder may reset the L1 temporal motion information value of the current block to the motion information value of the reconstructed neighboring block. In this case, the motion information used as the L1 temporal motion information of the current block may be derived in various ways.

일 실시예로, 부호화기 및 복호화기는 복원된 주변 블록 중에서 소정의 위치에 존재하는 한 개의 블록으로부터 L1 시간적 움직임 정보로 사용되는 움직임 정보를 도출할 수 있다. 이 때, 상기 소정의 위치의 블록은 좌측 최하단 블록(A), 상단 최우측 블록(B), 우측 상단 코너 블록(C), 좌측 하단 코너 블록(D),좌측 상단 코너 블록(E), 좌측 최상단 블록(F) 및 상단 최좌측 블록(G) 중에서 하나에 해당될 수 있다.As an embodiment, the encoder and the decoder may derive motion information used as the L1 temporal motion information from one block existing at a predetermined position among the reconstructed neighboring blocks. At this time, the block at the predetermined position is the lower left block (A), the upper right block (B), the upper right corner block (C), the lower left corner block (D), the upper left corner block (E), the left It may correspond to one of the uppermost block (F) and the upper leftmost block (G).

다른 실시예로, 부호화기 및 복호화기는 복원된 주변 블록 중에서 소정의 위치에 존재하는 복수 개의 블록을 소정의 순서로 스캔할 수 있다. 이 때, 부호화기 및 복호화기는 스캔 순서상 움직임 정보가 존재하는 첫 번째 블록의 움직임 정보를 현재 블록의 L1 시간적 움직임 정보로 사용할 수 있다. 스캔 대상 블록 및 스캔 순서는 다양한 형태로 정해질 수 있다. 일례로, 부호화기 및 복호화기는 좌측 최상단 블록(F), 상단 최좌측 블록(B) 및 상단 최우측 블록(B) 순으로 주변 블록을 스캔할 수 있다. 다른 예로, 부호화기 및 복호화기는 좌측 최상단 블록(F), 상단 최좌측 블록(G), 우측 상단 코너 블록(C), 좌측 하단 코너 블록(D) 및 좌측 상단 코너 블록(E) 순으로 주변 블록을 스캔할 수도 있다. 또 다른 예로, 부호화기 및 복호화기는 좌측 최하단 블록(A), 상단 최우측 블록(B) 및 좌측 상단 코너 블록(E) 순으로 주변 블록을 스캔할 수 있다. 또 다른 예로, 부호화기 및 복호화기는 좌측 최하단 블록(A), 상단 최우측 블록(B), 우측 상단 코너 블록(C), 좌측 하단 코너 블록(D) 및 좌측 상단 코너 블록(E) 순으로 주변 블록을 스캔할 수도 있다. 또 다른 예로 부호화기 및 복호화기는 좌측 최하단 블록(A), 상단 최우측 블록(B), 우측 상단 코너 블록(C), 좌측 하단 코너 블록(D),좌측 상단 코너 블록(E), 좌측 최상단 블록(F) 및 상단 최좌측 블록(G) 순으로 주변 블록을 스캔할 수도 있다.In another embodiment, the encoder and the decoder may scan a plurality of blocks existing at a predetermined position among the reconstructed neighboring blocks in a predetermined order. In this case, the encoder and the decoder may use the motion information of the first block in which the motion information exists in the scan order as the L1 temporal motion information of the current block. A scan target block and a scan order may be determined in various forms. As an example, the encoder and the decoder may scan the neighboring blocks in the order of the left uppermost block (F), the upper leftmost block (B), and the upper rightmost block (B). As another example, the encoder and decoder block neighboring blocks in the order of the upper left block (F), the upper leftmost block (G), the upper right corner block (C), the lower left corner block (D), and the upper left corner block (E). You can also scan. As another example, the encoder and the decoder may scan the neighboring blocks in the order of the lower left block (A), the upper right block (B), and the upper left corner block (E). As another example, the encoder and decoder are adjacent blocks in the order of the lower left block (A), the upper right block (B), the upper right corner block (C), the lower left corner block (D), and the upper left corner block (E) can also be scanned. As another example, the encoder and decoder are the lower left block (A), the upper right block (B), the upper right corner block (C), the lower left corner block (D), the upper left corner block (E), the upper left block ( F) and the upper leftmost block (G) in the order of the neighboring blocks may be scanned.

또 다른 실시예로, 부호화기 및 복호화기는 복원된 주변 블록 중에서 소정의 위치에 존재하는 복수 개의 블록의 움직임 정보에 대해 중간 값을 도출할 수 있고, 상기 도출된 중간 값을 현재 블록의 L1 시간적 움직임 정보로 사용할 수 있다. 예를 들어, 상기 복수 개의 블록은 좌측 최상단 블록(F), 상단 최좌측 블록(G), 우측 상단 코너 블록(C), 좌측 하단 코너 블록(D) 및 좌측 상단 코너 블록(E)일 수 있다. As another embodiment, the encoder and the decoder may derive an intermediate value for motion information of a plurality of blocks existing at a predetermined position among the reconstructed neighboring blocks, and use the derived intermediate value as the L1 temporal motion information of the current block. can be used as For example, the plurality of blocks may be a left uppermost block (F), an upper leftmost block (G), an upper right corner block (C), a lower left corner block (D), and an upper left corner block (E). .

복원된 주변 블록으로부터 현재 블록의 L1 시간적 움직임 정보를 도출하는 방법은 상술한 실시예에 한정되는 것이 아니며, 현재 블록의 L1 시간적 움직임 정보는 구현 및/또는 필요에 따라 다양한 방법으로 도출될 수 있다.The method of deriving the L1 temporal motion information of the current block from the reconstructed neighboring block is not limited to the above-described embodiment, and the L1 temporal motion information of the current block may be derived in various ways according to implementation and/or necessity.

이하, 복호화기 입장에서 도 6 및 도 7의 실시예에 따른 시간적 움직임 정보 도출 과정의 실시예가 서술된다.Hereinafter, an embodiment of a process of deriving temporal motion information according to the embodiments of FIGS. 6 and 7 from the decoder's point of view will be described.

상기 시간적 움직임 정보 도출 프로세스를 위한 입력에는, 현재 블록의 최좌상단 샘플의 위치 (xP, yP), 입력 움직임 벡터(mvLXCol) 및 입력 참조 픽쳐 번호(RefPicOrder(currPic, refIdxLX, LX)) 등이 있을 수 있다. 여기서, currPic는 현재 픽쳐를 의미할 수 있다. 상기 프로세스의 출력은 최종 시간적 움직임 정보로 사용되는 움직임 벡터(mvLXCol) 및 최종 시간적 움직임 정보의 존재 유무를 나타내는 정보(availableFlagLXCol)일 수 있다. 여기서, X는 0 또는 1의 값을 가질 수 있다. 예를 들어, X가 0인 경우, mvLXCol, refIdxLX, LX는 mvL0Col, refIdxL0, L0을 나타낼 수 있으며, 이는 L0 시간적 움직임 정보와 관련된 변수들을 의미할 수 있다. 또한, mvLX는 움직임 벡터를 나타낼 수 있고, mvLX[0]은 x 성분의 움직임 벡터, mvLX[1]은 y 성분의 움직임 벡터를 의미할 수 있다. refIdxLX는 참조 픽쳐들이 저장된 LX 참조 픽쳐 리스트 내의 참조 픽쳐를 지시하는 LX 참조 픽쳐 인덱스를 나타낼 수 있다. refIdxLX 값이 0인 경우, refIdxLX는 LX 참조 픽쳐 리스트 내의 첫 번째 참조 픽쳐를 지시할 수 있고, refIdxLX 값이 -1인 경우, refIdxLX는 참조 픽쳐 리스트 내에 참조 픽쳐가 존재하지 않음을 나타낼 수 있다. 또한, 후술되는 predFlagLX는 예측 블록 생성시에 움직임 보상이 수행되는지 여부를 나타낼 수 있다. 예를 들어, predFlagLX 값이 1인 경우, 부호화기 및 복호화기는 예측 블록 생성시에 움직임 보상을 수행할 수 있다.The input for the temporal motion information derivation process may include the position (xP, yP) of the upper-left sample of the current block, an input motion vector (mvLXCol), and an input reference picture number (RefPicOrder(currPic, refIdxLX, LX)). have. Here, currPic may mean a current picture. The output of the process may be a motion vector (mvLXCol) used as the final temporal motion information and information indicating the presence or absence of the final temporal motion information (availableFlagLXCol). Here, X may have a value of 0 or 1. For example, when X is 0, mvLXCol, refIdxLX, and LX may represent mvL0Col, refIdxL0, and L0, which may mean variables related to L0 temporal motion information. Also, mvLX may indicate a motion vector, mvLX[0] may indicate an x-component motion vector, and mvLX[1] may indicate a y-component motion vector. refIdxLX may indicate an LX reference picture index indicating a reference picture in an LX reference picture list in which reference pictures are stored. When the refIdxLX value is 0, refIdxLX may indicate the first reference picture in the LX reference picture list. When the refIdxLX value is -1, refIdxLX may indicate that the reference picture does not exist in the reference picture list. In addition, predFlagLX, which will be described later, may indicate whether motion compensation is performed when generating a prediction block. For example, when the predFlagLX value is 1, the encoder and the decoder may perform motion compensation when generating the prediction block.

만일 입력 움직임 벡터 mvL0Col 및 mvL1Col이 동일하고, RefPicOrder(currPic, refIdxL0, L0)과 RefPicOrder(currPic, refIdxL1, L1)이 동일하다면(즉, L0 참조 픽쳐 번호와 L1 참조 픽쳐 번호가 동일하다면), 부호화기 및 복호화기는 다음 과정을 수행할 수 있다.If the input motion vectors mvL0Col and mvL1Col are the same and RefPicOrder(currPic, refIdxL0, L0) and RefPicOrder(currPic, refIdxL1, L1) are the same (that is, if the L0 reference picture number and the L1 reference picture number are the same), the encoder and The decoder may perform the following process.

만일, 현재 블록의 좌측에 인접한 좌측 최상단 블록(A(xP-1, yP))이 존재하고, 상기 좌측 최상단 블록이 인트라 모드로 부호화된 블록이 아니고, predFlagL0A이 ‘1’이고 mvL0A가 (0,0)이 아니면, 부호화기 및 복호화기는 다음 과정을 수행할 수 있다. 여기서, A는 predFlagL0A 및 mvL0A가 좌측 최상단 블록(A)에 관한 정보임을 나타낼 수 있다.If there is a left uppermost block (A(xP-1, yP)) adjacent to the left of the current block, the left uppermost block is not an intra-mode coded block, predFlagL0A is '1' and mvL0A is (0, 0), the encoder and the decoder may perform the following process. Here, A may indicate that predFlagL0A and mvL0A are information about the upper left block (A).

mvL1Col = mvL0AmvL1Col = mvL0A

그렇지 않고, 만일 현재 블록의 상단에 인접한 상단 최좌측 블록(B(xP, yP-1))이 존재하고, 상기 상단 최좌측 블록이 인트라 모드로 부호화된 블록이 아니고, predFlagL0B이 ‘1’이고 mvL0B가 (0,0)이 아니면, 부호화기 및 복호화기는 다음 과정을 수행할 수 있다. 여기서, B는 predFlagL0B 및 mvL0B가 좌측 최상단 블록(B)에 관한 정보임을 나타낼 수 있다.Otherwise, if there is an upper leftmost block (B(xP, yP-1)) adjacent to the upper end of the current block, the upper leftmost block is not an intra mode coded block, predFlagL0B is '1' and mvL0B If is not (0,0), the encoder and the decoder may perform the following process. Here, B may indicate that predFlagL0B and mvL0B are information about the upper left block (B).

mvL1Col = mvL0BmvL1Col = mvL0B

그렇지 않고, 만일 현재 블록 외부의 좌측 상단 코너에 위치한 좌측 상단 코너 블록(E(xP-1, yP-1))이 존재하고, 상기 상단 최좌측 블록이 인트라 모드로 부호화된 블록이 아니고, predFlagL0E이 ‘1’이고 mvL0E가 (0,0)이 아니면, 부호화기 및 복호화기는 다음 과정을 수행할 수 있다. 여기서, E는 predFlagL0E 및 mvL0E가 좌측 최상단 블록(E)에 관한 정보임을 나타낼 수 있다.Otherwise, if there is an upper-left corner block (E(xP-1, yP-1)) located in the upper-left corner outside the current block, the upper-leftmost block is not an intra-mode coded block, and predFlagL0E is If '1' and mvL0E is not (0,0), the encoder and the decoder may perform the following process. Here, E may indicate that predFlagLOE and mvL0E are information about the upper left block (E).

mvL1Col = mvL0EmvL1Col = mvL0E

이 때 만일, mvL0Col과 mvL1Col이 동일하면, 부호화기 및 복호화기는 다음 과정을 수행할 수 있다. At this time, if mvL0Col and mvL1Col are the same, the encoder and the decoder may perform the following process.

avilableFlagL1Col = 0 avilableFlagL1Col = 0

그리고, 부호화기 및 복호화기는 다음 과정을 수행할 수 있다. Then, the encoder and the decoder may perform the following process.

availableFlagCol = availableFlagL0Col || availableFlagL1Col availableFlagCol = availableFlagL0Col || availableFlagL1Col

predFlagLXCol = availableFlagLXColpredFlagLXCol = availableFlagLXCol

여기서, availableFlagCol은 시간적 움직임 정보가 도출되었는지 여부를 나타내고, predFlagLXCol은 L0 시간적 움직임 정보 및 L1 시간적 움직임 정보 각각에 대한 최종 시간적 움직임 정보의 존재 유무를 나타낼 수 있다.Here, availableFlagCol may indicate whether temporal motion information is derived, and predFlagLXCol may indicate whether final temporal motion information for each of L0 temporal motion information and L1 temporal motion information exists.

도 8은 도 6의 실시예에 따른 시간적 움직임 정보 도출 과정을 수행할 수 있는 인터 예측 장치의 일 실시예를 개략적으로 나타내는 블록도이다. 도 8의 실시예에 따른 인터 예측 장치는 시간적 움직임 정보 판단부(810), 복원된 주변 블록 움직임 정보 판단부(820), 예측 방향 정보 재설정 및 L0 움직임 정보 설정부(830) 및 L1 시간적 움직임 정보 재설정부(840)를 포함할 수 있다.8 is a block diagram schematically illustrating an embodiment of an inter prediction apparatus capable of performing a process of deriving temporal motion information according to the embodiment of FIG. 6 . The inter prediction apparatus according to the embodiment of FIG. 8 includes a temporal motion information determination unit 810 , a reconstructed neighboring block motion information determination unit 820 , a prediction direction information resetting and L0 motion information setting unit 830 , and L1 temporal motion information A reset unit 840 may be included.

도 8을 참조하면, 시간적 움직임 정보 판단부(810)는 입력 시간적 움직임 정보에서 L0 시간적 움직임 정보와 L1 시간적 움직임 정보가 동일한지 여부, 즉 L0 참조 픽쳐 번호와 L1 참조 픽쳐 번호가 동일하고 L0 움직임 벡터와 L1 움직임 벡터가 동일한지 여부를 판단할 수 있다. Referring to FIG. 8 , the temporal motion information determining unit 810 determines whether L0 temporal motion information and L1 temporal motion information are the same in the input temporal motion information, that is, the L0 reference picture number and the L1 reference picture number are the same, and the L0 motion vector It can be determined whether and L1 motion vectors are the same.

L0 시간적 움직임 정보와 L1 시간적 움직임 정보가 동일하지 않은 경우, 인터 예측 장치는 입력 시간적 움직임 정보를 그대로 현재 블록의 시간적 움직임 정보로 사용할 수 있다. AMVP가 적용되는 경우, 상기 현재 블록의 시간적 움직임 정보는 현재 블록에 대한 예측 움직임 벡터 후보로 결정되거나 등록될 수 있다. 또한, 머지가 적용되는 경우, 상기 현재 블록의 시간적 움직임 정보는 현재 블록에 대한 머지 후보로 결정되거나 등록될 수 있다. L0 시간적 움직임 정보와 L1 시간적 움직임 정보가 동일한 경우에는 복원된 주변 블록 움직임 정보 판단부(820)에 의한 판단 과정이 수행될 수 있다. When the L0 temporal motion information and the L1 temporal motion information are not the same, the inter prediction apparatus may use the input temporal motion information as the temporal motion information of the current block as it is. When AMVP is applied, the temporal motion information of the current block may be determined or registered as a prediction motion vector candidate for the current block. Also, when the merge is applied, the temporal motion information of the current block may be determined or registered as a merge candidate for the current block. When the L0 temporal motion information and the L1 temporal motion information are the same, a determination process by the restored neighboring block motion information determiner 820 may be performed.

한편, 도 6에서 상술한 바와 같이 시간적 움직임 정보 판단부(810)는 L0 시간적 움직임 정보와 L1 시간적 움직임 정보의 동일성 여부가 아닌, L0 참조 픽쳐 번호 및 L1 참조 픽쳐 번호의 동일성 여부 또는 콜 블록의 예측 방향을 판단할 수도 있다. 예를 들어, L0 참조 픽쳐 번호 및 L1 참조 픽쳐 번호가 동일하지 않은 경우, 인터 예측 장치는 입력 시간적 움직임 정보를 그대로 현재 블록의 시간적 움직임 정보로 사용할 수 있고, L0 참조 픽쳐 번호 및 L1 참조 픽쳐 번호가 동일한 경우 복원된 주변 블록 움직임 정보 판단부(820)에 의한 판단 과정이 수행될 수 있다. 다른 예로, 콜 블록의 예측 방향이 양방향 예측인 경우, 인터 예측 장치는 입력 시간적 움직임 정보를 그대로 현재 블록의 시간적 움직임 정보로 사용할 수 있고, 콜 블록의 예측 방향이 단방향 예측인 경우 복원된 주변 블록 움직임 정보 판단부(820)에 의한 판단 과정이 수행될 수도 있다.On the other hand, as described above in FIG. 6 , the temporal motion information determining unit 810 determines whether the L0 temporal motion information and the L1 temporal motion information are identical, not whether the L0 reference picture number and the L1 reference picture number are identical or whether the collocated block is predicted. direction can be determined. For example, if the L0 reference picture number and the L1 reference picture number are not the same, the inter prediction apparatus may use the input temporal motion information as it is as the temporal motion information of the current block, and the L0 reference picture number and the L1 reference picture number are In the same case, a determination process by the restored neighboring block motion information determination unit 820 may be performed. As another example, when the prediction direction of the collocated block is bidirectional prediction, the inter prediction apparatus can use the input temporal motion information as it is as the temporal motion information of the current block, and when the prediction direction of the collocated block is unidirectional prediction, the reconstructed neighboring block motion A determination process by the information determination unit 820 may be performed.

복원된 주변 블록 움직임 정보 판단부(820)는 복원된 주변 블록의 움직임 정보가 존재하는지 여부를 판단할 수 있다. 복원된 주변 블록의 움직임 정보가 존재하지 않는 경우(예를 들어, 소정의 위치 및/또는 소정의 방법으로 선택된 위치의 복원된 주변 블록 중에서 움직임 정보를 갖는 블록이 존재하지 않는 경우), 예측 방향 정보 재설정 및 L0 움직임 정보 설정부(830)에 의한 예측 방향 정보 재설정 및 L0 움직임 정보 설정 과정이 수행될 수 있다. 또한, 복원된 주변 블록의 움직임 정보가 존재하는 경우(예를 들어, 소정의 위치 및/또는 소정의 방법으로 선택된 위치의 복원된 주변 블록 중에서 움직임 정보를 갖는 블록이 존재하는 경우), L1 시간적 움직임 정보 재설정부(840)에 의한 재설정 과정이 수행될 수 있다.The reconstructed neighboring block motion information determining unit 820 may determine whether motion information of the reconstructed neighboring block exists. When motion information of a reconstructed neighboring block does not exist (eg, when a block having motion information does not exist among reconstructed neighboring blocks at a predetermined position and/or a position selected by a predetermined method), prediction direction information The reset and L0 motion information setting unit 830 may perform a process of resetting prediction direction information and setting L0 motion information. In addition, when motion information of a reconstructed neighboring block exists (eg, when a block having motion information exists among reconstructed neighboring blocks at a predetermined position and/or a position selected by a predetermined method), L1 temporal motion A reset process by the information resetting unit 840 may be performed.

복원된 주변 블록의 움직임 정보가 존재하지 않는 경우, 예측 방향 정보 재설정 및 L0 움직임 정보 설정부(830)는 현재 블록의 예측 방향 정보를 단방향 예측으로 다시 설정할 수 있다. 또한 이 때, 예측 방향 정보 재설정 및 L0 움직임 정보 설정부(830)는 입력 시간적 움직임 정보 중에서 L0 시간적 움직임 정보만을 현재 블록의 최종 시간적 움직임 정보로 설정할 수 있다.When motion information of the reconstructed neighboring block does not exist, the prediction direction information resetting and L0 motion information setting unit 830 may reset the prediction direction information of the current block to unidirectional prediction. Also, at this time, the prediction direction information resetting and L0 motion information setting unit 830 may set only the L0 temporal motion information among the input temporal motion information as the final temporal motion information of the current block.

복원된 주변 블록의 움직임 정보가 존재하는 경우, L1 시간적 움직임 정보 재설정부(840)는 현재 블록의 L1 시간적 움직임 정보를 복원된 주변 블록의 움직임 정보로 재설정할 수 있다. 즉, 인터 예측 장치는 복원된 주변 블록의 움직임 정보를 현재 블록의 L1 시간적 움직임 정보로 사용할 수 있다. 이 때, 일례로 L1 시간적 움직임 정보 재설정부(840)는 복원된 주변 블록에서 현재 블록의 L1 시간적 움직임 정보로 사용될 움직임 정보를 탐색할 때, 영 벡터(0,0)를 갖는 움직임 정보는 선택하지 않고 영 벡터(0,0)를 갖지 않는 움직임 정보만을 선택할 수도 있다. 한편, L1 시간적 움직임 정보 재설정부(840)는 현재 블록의 움직임 정보 후보 리스트를 기반으로 현재 블록의 L1 시간적 움직임 정보를 재설정할 수도 있다. 상술한 각각의 방법에 대한 구체적인 실시예는 도 6 및 도 7에서 상술한 바 있으므로, 여기서는 생략하기로 한다.When motion information of the reconstructed neighboring block exists, the L1 temporal motion information resetter 840 may reset the L1 temporal motion information of the current block to the motion information of the reconstructed neighboring block. That is, the inter prediction apparatus may use the motion information of the reconstructed neighboring block as the L1 temporal motion information of the current block. At this time, for example, when the L1 temporal motion information resetter 840 searches for motion information to be used as the L1 temporal motion information of the current block in the reconstructed neighboring block, the motion information having a zero vector (0, 0) is not selected. It is also possible to select only motion information that does not have a zero vector (0, 0). Meanwhile, the L1 temporal motion information resetting unit 840 may reset the L1 temporal motion information of the current block based on the motion information candidate list of the current block. A specific embodiment of each of the above-described methods has been described above with reference to FIGS. 6 and 7 , and thus will be omitted herein.

도 9는 본 발명에 따른 현재 블록의 시간적 움직임 정보 도출 방법의 다른 실시예를 개략적으로 나타내는 흐름도이다. 9 is a flowchart schematically illustrating another embodiment of a method for deriving temporal motion information of a current block according to the present invention.

후술되는 실시예들은 시간적 움직임 정보를 중심으로 서술되지만 본 발명은 이에 한정되는 것은 아니다. 예를 들어, 도 9의 실시예에 따른 방법들은 머지 모드 및/또는 AMVP 모드에서의 시간적 움직임 정보뿐만 아니라, 머지 모드에서 머지 후보 리스트를 기반으로 도출된 현재 블록의 움직임 정보 및/또는 AMVP 모드에서 예측 움직임 벡터 후보 리스트를 기반으로 도출된 현재 블록의 움직임 정보에도 동일하거나 유사한 방식으로 적용될 수 있다.Embodiments to be described below will be described based on temporal motion information, but the present invention is not limited thereto. For example, the methods according to the embodiment of FIG. 9 include not only temporal motion information in the merge mode and/or AMVP mode, but also motion information of a current block derived based on the merge candidate list in the merge mode and/or in the AMVP mode. The same or similar method may be applied to motion information of the current block derived based on the prediction motion vector candidate list.

상술한 바와 같이, 시간적 움직임 정보는 이미 복원된 콜 픽쳐 내에서 현재 블록에 대응하는 콜 블록의 움직임 정보를 기반으로 도출될 수 있다. 여기서, 상기 콜 픽쳐는 일례로 참조 픽쳐 리스트에 포함된 참조 픽쳐 중에서 하나의 픽쳐에 해당될 수 있다. 부호화기 및 복호화기는, 콜 픽쳐 내에서 현재 블록과 공간적으로 동일한 위치에 존재하는 블록을 기준으로 소정의 상대적인 위치를 결정할 수 있고, 상기 결정된 소정의 상대적인 위치(예를 들어, 상기 현재 블록과 공간적으로 동일한 위치에 존재하는 블록의 내부 및/또는 외부의 위치)를 기반으로 상기 콜 블록을 도출할 수 있다. 콜 블록을 기반으로 도출되는 시간적 움직임 정보는 예측 방향 정보, L0 참조 픽쳐 번호, L1 참조 픽쳐 번호, L0 움직임 벡터 및 L1 움직임 벡터 등을 포함할 수 있다.As described above, the temporal motion information may be derived based on the motion information of the collocated block corresponding to the current block in the already reconstructed collocated picture. Here, the collocated picture may correspond to, for example, one picture among reference pictures included in the reference picture list. The encoder and the decoder may determine a predetermined relative position based on a block existing at the same spatial position as the current block in the collocated picture, and the determined relative position (eg, spatially identical to the current block). The collocated block may be derived based on the position inside and/or outside the block existing in the position). The temporal motion information derived based on the collocated block may include prediction direction information, L0 reference picture number, L1 reference picture number, L0 motion vector, L1 motion vector, and the like.

도 9를 참조하면, 부호화기 및 복호화기는 콜 블록을 기반으로 도출된 시간적 움직임 정보에서 L0 시간적 움직임 정보와 L1 시간적 움직임 정보가 동일한지 여부, 즉 L0 참조 픽쳐 번호와 L1 참조 픽쳐 번호가 동일하고 L0 움직임 벡터와 L1 움직임 벡터가 동일한지 여부를 판단할 수 있다(S910). 이하, 후술되는 도 9 내지 도 11의 실시예에 한하여, 설명의 편의상 시간적 움직임 정보 재설정 전 S910 단계로 입력되는 시간적 움직임 정보는 입력 시간적 움직임 정보(L0 입력 시간적 움직임 정보, L1 입력 시간적 움직임 정보)라 한다. 또한 입력 시간적 움직임 정보에 포함된 움직임 벡터는 입력 움직임 벡터(L0 입력 움직임 벡터, L1 입력 움직임 벡터), 입력 시간적 움직임 정보에 포함된 참조 픽쳐 인덱스는 입력 참조 픽쳐 인덱스(L0 입력 참조 픽쳐 인덱스, L1 입력 참조 픽쳐 인덱스), 입력 시간적 움직임 정보에 포함된 참조 픽쳐 번호는 입력 참조 픽쳐 번호(L0 입력 참조 픽쳐 번호, L1 입력 참조 픽쳐 번호)라 한다.Referring to FIG. 9 , the encoder and the decoder determine whether L0 temporal motion information and L1 temporal motion information are the same in the temporal motion information derived based on the collocated block, that is, the L0 reference picture number and the L1 reference picture number are the same and the L0 motion information is the same. It may be determined whether the vector and the L1 motion vector are the same (S910). Hereinafter, only for the embodiments of FIGS. 9 to 11, which will be described later, for convenience of explanation, the temporal motion information input to step S910 before resetting the temporal motion information is input temporal motion information (L0 input temporal motion information, L1 input temporal motion information). do. In addition, the motion vector included in the input temporal motion information is an input motion vector (L0 input motion vector, L1 input motion vector), and the reference picture index included in the input temporal motion information is an input reference picture index (L0 input reference picture index, L1 input). A reference picture index) and a reference picture number included in the input temporal motion information are referred to as an input reference picture number (L0 input reference picture number, L1 input reference picture number).

L0 입력 시간적 움직임 정보와 L1 입력 시간적 움직임 정보가 동일하지 않은 경우, 즉 L0 입력 참조 픽쳐 번호와 L1 입력 참조 픽쳐 번호가 동일하지 않거나 및/또는 L0 입력 움직임 벡터와 L1 입력 움직임 벡터가 동일하지 않은 경우, 부호화기 및 복호화기는 콜 블록을 기반으로 도출된 입력 시간적 움직임 정보를 그대로 현재 블록의 시간적 움직임 정보로 사용할 수 있다. AMVP가 적용되는 경우, 상기 현재 블록의 시간적 움직임 정보는 현재 블록의 예측 움직임 벡터 후보로 결정되거나 등록될 수 있다. 또한, 머지가 적용되는 경우, 상기 현재 블록의 시간적 움직임 정보는 현재 블록의 머지 후보로 결정되거나 등록될 수 있다. When the L0 input temporal motion information and the L1 input temporal motion information are not the same, that is, the L0 input reference picture number and the L1 input reference picture number are not the same and/or the L0 input motion vector and the L1 input motion vector are not the same , the encoder and the decoder may use the input temporal motion information derived based on the collocated block as the temporal motion information of the current block as it is. When AMVP is applied, the temporal motion information of the current block may be determined or registered as a prediction motion vector candidate of the current block. Also, when the merge is applied, the temporal motion information of the current block may be determined or registered as a merge candidate of the current block.

L0 입력 시간적 움직임 정보와 L1 입력 시간적 움직임 정보가 동일한 경우, 부호화기 및 복호화기는 콜 블록의 움직임 정보가 존재하는지 여부를 판단할 수 있다(S920). 여기서, 상기 콜 블록은 입력 시간적 움직임 정보 도출을 위해 사용되는 콜 블록이 아닌 새로이 도출된 콜 블록일 수 있다. 예를 들어, 부호화기 및 복호화기는 소정의 위치 및/또는 소정의 방법으로 선택된 위치의 콜 블록 중에서 움직임 정보를 갖는 블록이 존재하는지 여부를 판단할 수 있다. When the L0 input temporal motion information and the L1 input temporal motion information are the same, the encoder and the decoder may determine whether motion information of the collocated block exists ( S920 ). Here, the collocated block may be a newly derived collocated block rather than a collocated block used for deriving input temporal motion information. For example, the encoder and the decoder may determine whether a block having motion information exists among collocated blocks at a predetermined position and/or a position selected by a predetermined method.

이하, 도 9 내지 도 11의 실시예에 한하여, 설명의 편의상 입력 시간적 움직임 정보 도출을 위해 사용되는 콜 블록은 제1 콜 블록이라 하고, S920 단계에서와 같이 움직임 정보 존재 여부의 판단 대상이 되면서 후술되는 S940 단계에서와 같이 L1 입력 시간적 움직임 정보의 재설정을 위해 사용되는 콜 블록은 제2 콜 블록이라 한다. 또한, 제1 콜 블록을 포함하는 콜 픽쳐는 제1 콜 픽쳐라 하고, 제2 콜 블록을 포함하는 콜 픽쳐는 제2 콜 픽쳐라 한다. 여기서, 일례로 제1 콜 픽쳐 및 제2 콜 픽쳐는 각각 참조 픽쳐 리스트에 포함된 참조 픽쳐 중에서 하나의 픽쳐에 해당될 수 있다.Hereinafter, only in the embodiments of FIGS. 9 to 11 , for convenience of explanation, the collocated block used for deriving input temporal motion information is referred to as a first collocated block, and as in step S920, it is a target for determining whether motion information exists and will be described later. As in step S940, the collocated block used for resetting the L1 input temporal motion information is referred to as a second collocated block. Also, the collocated picture including the first collocated block is referred to as a first collocated picture, and the collocated picture including the second collocated block is referred to as a second collocated picture. Here, for example, the first collocated picture and the second collocated picture may each correspond to one picture from among the reference pictures included in the reference picture list.

제2 콜 블록의 움직임 정보가 존재하지 않는 경우(예를 들어, 소정의 위치 및/또는 소정의 방법으로 선택된 위치의 제2 콜 블록 중에서 움직임 정보를 갖는 블록이 존재하지 않는 경우), 부호화기 및 복호화기는 현재 블록의 예측 방향 정보를 단방향 예측으로 다시 설정할 수 있다(S930). 또한 이 때, 부호화기 및 복호화기는 L0 입력 시간적 움직임 정보만을 현재 블록의 시간적 움직임 정보로 사용할 수 있다.When motion information of the second collocated block does not exist (eg, when a block having motion information does not exist among the second collocated blocks at a predetermined position and/or a position selected by a predetermined method), the encoder and the decoder The group may reset the prediction direction information of the current block to unidirectional prediction (S930). Also, at this time, the encoder and the decoder may use only the L0 input temporal motion information as the temporal motion information of the current block.

제2 콜 블록의 움직임 정보가 존재하는 경우(예를 들어, 소정의 위치 및/또는 소정의 방법으로 선택된 위치의 제2 콜 블록 중에서 움직임 정보를 갖는 블록이 존재하는 경우), 부호화기 및 복호화기는 상기 제2 콜 블록의 움직임 정보를 현재 블록의 최종 L1 시간적 움직임 정보로 사용할 수 있다(S940). 즉, 이 때 부호화기 및 복호화기는 현재 블록의 L1 입력 시간적 움직임 정보를 상기 제2 콜 블록의 움직임 정보로 재설정할 수 있다. L1 입력 시간적 움직임 정보의 재설정을 위해 사용되는 제2 콜 픽쳐 및 제2 콜 블록의 구체적인 실시예는 후술하기로 한다.When motion information of the second collocated block exists (for example, when a block having motion information exists among the second collocated blocks at a predetermined position and/or a position selected by a predetermined method), the encoder and the decoder The motion information of the second collocated block may be used as the final L1 temporal motion information of the current block (S940). That is, at this time, the encoder and the decoder may reset the L1 input temporal motion information of the current block to the motion information of the second collocated block. A specific embodiment of the second collocated picture and the second collocated block used for resetting the L1 input temporal motion information will be described later.

상술한 실시예에서 현재 블록의 시간적 움직임 정보 도출 방법은 일련의 단계로서 순서도를 기초로 설명되고 있으나, 순서도의 하나 또는 그 이상의 단계는 삭제될 수도 있다. 예를 들어, 상술한 실시예에서 S920 및 S940의 단계는 생략될 수도 있다. 이 때, L0 입력 시간적 움직임 정보와 L1 입력 시간적 움직임 정보가 동일한 경우, 부호화기 및 복호화기는 현재 블록의 예측 방향 정보를 단방향 예측으로 다시 설정할 수 있다(S930). 또한 이 때, 부호화기 및 복호화기는 L0 입력 시간적 움직임 정보만을 현재 블록의 최종 시간적 움직임 정보로 사용할 수 있다. In the above-described embodiment, the method for deriving temporal motion information of the current block is described based on a flowchart as a series of steps, but one or more steps in the flowchart may be deleted. For example, in the above-described embodiment, steps S920 and S940 may be omitted. In this case, when the L0 input temporal motion information and the L1 input temporal motion information are the same, the encoder and the decoder may reset the prediction direction information of the current block to the unidirectional prediction (S930). Also, at this time, the encoder and the decoder may use only the L0 input temporal motion information as the final temporal motion information of the current block.

한편, 상술한 실시예에서는 L0 입력 시간적 움직임 정보와 L1 입력 시간적 움직임 정보의 동일성을 기반으로 S920 내지 S940 과정의 수행 여부가 결정되지만, 부호화기 및 복호화기는 다른 조건을 기반으로 S920 내지 S940 과정의 수행 여부를 결정할 수도 있다.Meanwhile, in the above-described embodiment, it is determined whether to perform the processes S920 to S940 based on the sameness of the L0 input temporal motion information and the L1 input temporal motion information, but the encoder and the decoder perform the processes S920 to S940 based on different conditions. may decide

일 실시예로, 부호화기 및 복호화기는 L0 입력 참조 픽쳐 번호 및 L1 입력 참조 픽쳐 번호의 동일성을 기반으로 S920 내지 S940 과정의 수행 여부를 결정할 수 있다. 일례로, 부호화기 및 복호화기는 L0 입력 참조 픽쳐 번호 및 L1 입력 참조 픽쳐 번호가 동일한 경우에 S920 내지 S940 과정을 수행할 수 있다.As an embodiment, the encoder and the decoder may determine whether to perform steps S920 to S940 based on the sameness of the L0 input reference picture number and the L1 input reference picture number. For example, when the L0 input reference picture number and the L1 input reference picture number are the same, the encoder and the decoder may perform processes S920 to S940.

다른 실시예로, 부호화기 및 복호화기는 제1 콜 블록의 예측 방향을 기반으로 S920 내지 S940 과정의 수행 여부를 결정할 수 있다. 상술한 바와 같이, 예측 방향 정보는 예측이 수행되는 블록에 대해 단방향 예측이 적용되는지 또는 양방향 예측이 적용되는지 여부를 지시하는 정보를 의미할 수 있다. 따라서, 상기 예측 방향은 단방향 예측 또는 양방향 예측에 해당될 수 있다. 일례로, 부호화기 및 복호화기는 제1 콜 블록의 움직임 정보(예측 방향)가 양방향 예측이 아닌 단방향 예측인 경우에 S920 내지 S940 과정을 수행할 수 있다. 이는 제1 콜 블록의 예측 방향이 단방향 예측인 경우, 결과적으로 제1 콜 블록으로부터 도출되는 입력 시간적 움직임 정보에서, L0 입력 시간적 움직임 정보와 L1 입력 시간적 움직임 정보가 동일할 수 있기 때문이다.As another embodiment, the encoder and the decoder may determine whether to perform steps S920 to S940 based on the prediction direction of the first collocated block. As described above, the prediction direction information may refer to information indicating whether unidirectional prediction or bidirectional prediction is applied to a block on which prediction is performed. Accordingly, the prediction direction may correspond to unidirectional prediction or bidirectional prediction. For example, when the motion information (prediction direction) of the first collocated block is unidirectional prediction rather than bidirectional prediction, the encoder and the decoder may perform processes S920 to S940. This is because, in the case where the prediction direction of the first collocated block is unidirectional prediction, as a result, in the input temporal motion information derived from the first collocated block, the L0 input temporal motion information and the L1 input temporal motion information may be the same.

또 다른 실시예로, 부호화기 및 복호화기는 제1 콜 블록에 움직임 정보가 존재하는지 여부에 관한 정보를 기반으로 S920 내지 S940 과정의 수행 여부를 결정할 수도 있다. 일례로, 부호화기 및 복호화기는 제1 콜 블록에 움직임 정보가 존재하지 않는 경우에 S920 내지 S940 과정을 수행할 수 있다. 이 경우, 상술한 S940 단계에서는 L1 입력 시간적 움직임 정보가 아닌 L0 입력 시간적 움직임 정보가 재설정될 수 있다. 즉, 부호화기 및 복호화기는 L0 입력 시간적 움직임 정보를 제2 콜 블록의 움직임 정보로 설정할 수 있으며, 현재 블록에 대해 양방향 예측이 아닌 단방향 예측을 수행할 수 있다. 또한, 제1 콜 블록에 움직임 정보가 존재하지 않는 경우, 상술한 S940 단계에서 부호화기 및 복호화기는 L0 입력 시간적 움직임 정보와 L1 입력 시간적 움직임 정보를 모두 재설정할 수도 있다. 즉, 부호화기 및 복호화기는 L0 입력 시간적 움직임 정보 및 L1 입력 시간적 움직임 정보를 모두 제2 콜 블록의 움직임 정보로 재설정할 수 있으며, 현재 블록에 대해 양방향 예측을 수행할 수도 있다.As another embodiment, the encoder and the decoder may determine whether to perform steps S920 to S940 based on information on whether motion information exists in the first collocated block. For example, the encoder and the decoder may perform steps S920 to S940 when motion information does not exist in the first collocated block. In this case, in step S940 described above, the L0 input temporal motion information rather than the L1 input temporal motion information may be reset. That is, the encoder and the decoder may set the L0 input temporal motion information as the motion information of the second collocated block, and may perform unidirectional prediction instead of bidirectional prediction on the current block. Also, when there is no motion information in the first collocated block, the encoder and the decoder may reset both the L0 input temporal motion information and the L1 input temporal motion information in step S940. That is, the encoder and the decoder may reset both the L0 input temporal motion information and the L1 input temporal motion information to the motion information of the second collocated block, and may perform bidirectional prediction on the current block.

또 다른 실시예로, 부호화기 및 복호화기는 현재 블록의 크기를 기반으로 S920 내지 S940 과정의 수행 여부를 결정할 수도 있다. 일례로, 부호화기 및 복호화기는 현재 블록의 크기가 소정의 크기보다 작은지 여부를 판단할 수 있다. 여기서, 상기 현재 블록은 CU, PU 및/또는 TU일 수 있으며, 상기 소정의 크기는 예를 들어 8x8, 16x16 또는 32x32 등 중에서 하나일 수 있다. 이 때, 부호화기 및 복호화기는 현재 블록의 크기가 소정의 크기보다 작은 경우에 S920 내지 S940 과정을 수행할 수 있다.As another embodiment, the encoder and the decoder may determine whether to perform steps S920 to S940 based on the size of the current block. For example, the encoder and the decoder may determine whether the size of the current block is smaller than a predetermined size. Here, the current block may be a CU, a PU, and/or a TU, and the predetermined size may be, for example, one of 8x8, 16x16, or 32x32. In this case, when the size of the current block is smaller than a predetermined size, the encoder and the decoder may perform processes S920 to S940.

또 다른 실시예로, 부호화기 및 복호화기는 제1 콜 블록의 움직임 정보에서 L0 움직임 벡터 및/또는 L1 움직임 벡터가 영 벡터(0,0)에 해당되는 경우에 S920 내지 S940 과정을 수행할 수도 있다. 이 경우, 상술한 S940 단계에서 부호화기 및 복호화기는 영 벡터(0,0)에 해당되는 움직임 벡터(들)를 재설정할 수 있다. 일례로, 상기 영 벡터(0,0)에 해당되는 움직임 벡터(들)는 제2 콜 블록의 움직임 벡터로 설정될 수 있고, 다른 예로, 상기 영 벡터(0,0)에 해당되는 움직임 벡터(들)는 복원된 주변 블록의 움직임 벡터로 설정될 수도 있으며, 또 다른 예로, 상기 영 벡터(0,0)에 해당되는 움직임 벡터(들)는 제1 콜 블록의 주변에 위치한 블록의 움직임 벡터로 설정될 수도 있다. 또 다른 실시예로, 부호화기 및 복호화기는 제1 콜 블록의 움직임 정보에서 L0 움직임 벡터 및/또는 L1 움직임 벡터가 영 벡터(0,0)에 해당되지 않는 경우에 S920 내지 S940 과정을 수행할 수도 있다. 이 경우, 상술한 S940 단계에서 부호화기 및 복호화기는 영 벡터(0,0)에 해당되지 않는 움직임 벡터(들)을 재설정할 수 있으며, 상기 영 벡터(0,0)에 해당되지 않는 움직임 벡터(들)은 제2 콜 블록의 움직임 벡터로 재설정될 수 있다.As another embodiment, the encoder and the decoder may perform steps S920 to S940 when the L0 motion vector and/or the L1 motion vector in the motion information of the first collocated block corresponds to a zero vector (0,0). In this case, in step S940 described above, the encoder and the decoder may reset the motion vector(s) corresponding to the zero vector (0,0). As an example, the motion vector(s) corresponding to the zero vector (0,0) may be set as the motion vector of the second collocated block, and as another example, the motion vector(s) corresponding to the zero vector (0,0) ( ) may be set as a motion vector of a reconstructed neighboring block. As another example, the motion vector(s) corresponding to the zero vector (0,0) is a motion vector of a block located near the first collocated block. may be set. As another embodiment, the encoder and the decoder may perform steps S920 to S940 when the L0 motion vector and/or the L1 motion vector in the motion information of the first collocated block do not correspond to the zero vector (0,0). . In this case, in step S940 described above, the encoder and the decoder may reset motion vector(s) that do not correspond to the zero vector (0,0), and the motion vector(s) that do not correspond to the zero vector (0,0) ) may be reset to the motion vector of the second collocated block.

상기 S920 내지 S940 과정의 수행 여부가 결정되는 조건은 상술한 실시예에 한정되지 않으며, 조건 및/또는 필요에 따라 다양한 조건이 적용될 수 있다.The conditions for determining whether to perform the processes S920 to S940 are not limited to the above-described embodiments, and various conditions may be applied according to conditions and/or needs.

상술한 실시예들에서 L0 입력 시간적 움직임 정보 및 L1 입력 시간적 움직임 정보는 시간적으로 도출된 움직임 정보이므로, 객체의 이동에 의한 움직임 정보에 해당될 가능성이 높다. 따라서, 부호화기 및 복호화기는 제2 콜 블록에서 현재 블록의 최종 L1 시간적 움직임 정보로 사용될 움직임 정보를 탐색할 때, 영 벡터(0,0)를 갖는 움직임 정보는 선택하지 않고 영 벡터(0,0)를 갖지 않는 움직임 정보를 선택할 수도 있다. 이는 영 벡터(0,0)에 해당되는 움직임 정보를 갖는 블록은, 객체가 아닌 배경에 해당될 가능성이 높기 때문이다.In the above-described embodiments, since the L0 input temporal motion information and the L1 input temporal motion information are temporally derived motion information, there is a high possibility that they correspond to motion information due to the movement of an object. Therefore, when the encoder and the decoder search for motion information to be used as the final L1 temporal motion information of the current block in the second collocated block, motion information having a zero vector (0,0) is not selected and the zero vector (0,0) is not selected. It is also possible to select motion information that does not have . This is because a block having motion information corresponding to a zero vector (0, 0) is highly likely to correspond to a background rather than an object.

한편, 재설정된 최종 L1 시간적 움직임 정보는 현재 블록의 L0 입력 시간적 움직임 정보와 동일할 수도 있다. 따라서, 부호화기 및 복호화기는 제2 콜 블록에서 현재 블록의 최종 L1 시간적 움직임 정보로 사용될 움직임 정보를 탐색할 때, L0 입력 시간적 움직임 정보와 동일하지 않은 움직임 정보를 선택할 수 있다. 예를 들어, S940에서와 같이, 제2 콜 블록을 기반으로 현재 블록의 최종 L1 시간적 움직임 정보를 도출하는 경우, 부호화기 및 복호화기는 현재 블록의 L0 입력 시간적 움직임 정보와 다른 움직임 정보를 갖는 블록을 상기 최종 L1 시간적 움직임 정보 도출에 사용되는 블록으로 결정할 수 있다. 이 때, 부호화기 및 복호화기는 현재 블록의 L0 입력 시간적 움직임 정보와의 차이가 소정의 임계값(threshold) 이하인 움직임 정보만을, 최종 L1 시간적 움직임 정보로 사용될 움직임 정보로 선택할 수도 있다. 여기서, 상기 소정의 임계값은 현재 블록의 모드 정보, 현재 블록의 움직임 정보, 주변 블록의 모드 정보 및/또는 주변 블록의 움직임 정보 등을 기반으로 정해질 수 있으며, 다양한 방식으로 결정될 수 있다.Meanwhile, the reset final L1 temporal motion information may be the same as the L0 input temporal motion information of the current block. Accordingly, when searching for motion information to be used as the final L1 temporal motion information of the current block in the second collocated block, the encoder and the decoder may select motion information that is not the same as the L0 input temporal motion information. For example, as in S940, when the final L1 temporal motion information of the current block is derived based on the second collocated block, the encoder and the decoder refer to a block having motion information different from the L0 input temporal motion information of the current block. It can be determined as a block used for deriving the final L1 temporal motion information. In this case, the encoder and the decoder may select only motion information whose difference from the L0 input temporal motion information of the current block is less than or equal to a predetermined threshold as motion information to be used as the final L1 temporal motion information. Here, the predetermined threshold value may be determined based on mode information of the current block, motion information of the current block, mode information of the neighboring block, and/or motion information of the neighboring block, and may be determined in various ways.

*또한, 상술한 실시예들에서, 제2 콜 블록의 움직임 정보는 L0 움직임 정보 및 L1 움직임 정보를 모두 포함할 수 있다. 이 경우, 부호화기 및 복호화기는 상기 L0 움직임 정보 및 상기 L1 움직임 정보 중에서 하나의 움직임 정보를, 현재 블록의 최종 L1 시간적 움직임 정보로 사용될 움직임 정보로 결정할 수 있다. 일례로, 부호화기 및 복호화기는 제2 콜 블록의 L0 움직임 정보를 현재 블록에 대한 최종 L1 시간적 움직임 정보로 사용할 수 있다. 이 때, 제2 콜 블록에 L0 움직임 정보가 존재하지 않는 경우, 부호화기 및 복호화기는 제2 콜 블록의 L1 움직임 정보를 현재 블록에 대한 최종 L1 시간적 움직임 정보로 사용할 수 있다. 다른 예로, 부호화기 및 복호화기는 제2 콜 블록의 L1 움직임 정보를 현재 블록에 대한 최종 L1 시간적 움직임 정보로 사용할 수 있다. 이 때, 제2 콜 블록에 L1 움직임 정보가 존재하지 않는 경우, 부호화기 및 복호화기는 제2 콜 블록의 L0 움직임 정보를 현재 블록에 대한 최종 L1 시간적 움직임 정보로 사용할 수 있다.*In addition, in the above-described embodiments, the motion information of the second collocated block may include both L0 motion information and L1 motion information. In this case, the encoder and the decoder may determine one of the L0 motion information and the L1 motion information as motion information to be used as the final L1 temporal motion information of the current block. As an example, the encoder and the decoder may use the L0 motion information of the second collocated block as the final L1 temporal motion information of the current block. In this case, when the L0 motion information does not exist in the second collocated block, the encoder and the decoder may use the L1 motion information of the second collocated block as the final L1 temporal motion information for the current block. As another example, the encoder and the decoder may use the L1 motion information of the second collocated block as the final L1 temporal motion information of the current block. In this case, when the L1 motion information does not exist in the second collocated block, the encoder and the decoder may use the L0 motion information of the second collocated block as the final L1 temporal motion information for the current block.

한편, 부호화기 및 복호화기는 상술한 S940 단계에서 현재 블록의 L1 입력 시간적 움직임 정보(예를 들어, L1 입력 움직임 벡터)를 재설정하기 위해, 제2 콜 블록의 움직임 정보를 사용하지 않을 수도 있다. 이 때, 부호화기 및 복호화기는 제1 콜 블록의 움직임 정보(예를 들어, 움직임 벡터)를 기반으로 현재 블록의 L1 입력 시간적 움직임 정보(예를 들어, L1 입력 움직임 벡터)를 재설정할 수 있다. 이하, 이와 관련된 실시예들이 서술되며 이는 움직임 벡터를 기준으로 서술하기로 한다.Meanwhile, the encoder and the decoder may not use the motion information of the second collocated block to reset the L1 input temporal motion information (eg, the L1 input motion vector) of the current block in step S940 described above. In this case, the encoder and the decoder may reset L1 input temporal motion information (eg, L1 input motion vector) of the current block based on the motion information (eg, motion vector) of the first collocated block. Hereinafter, related embodiments will be described, which will be described based on a motion vector.

일 실시예로, 부호화기 및 복호화기는 제1 콜 픽쳐 내에서, 제1 콜 블록의 움직임 정보(움직임 벡터)가 지시하는 위치에서 소정의 거리 및/또는 방향을 기반으로 이동된 상대적인 위치를 지시하는 움직임 정보를 현재 블록의 최종 L1 시간적 움직임 정보(L1 움직임 벡터)로 사용할 수 있다. 일례로, 부호화기 및 복호화기는 제1 콜 블록의 움직임 정보가 지시하는 위치에서 수직 및/또는 수평 방향으로 1/4 픽셀 크기 (예를 들어, (-1,0), (1,0), (0,-1), (0,1), (-1,-1), (-1,1), (1,-1), (1,1) 등. 여기서, 1/4 픽셀 단위는 1에 해당됨.)만큼 이동된 위치를 지시하는 움직임 정보를 현재 블록의 최종 L1 시간적 움직임 정보로 사용할 수 있다. 다른 예로, 부호화기 및 복호화기는 제1 콜 블록의 움직임 정보가 지시하는 위치에서 수직 및/또는 수평 방향으로 1/2 픽셀 크기(예를 들어, (-2,0), (2,0), (0,-2), (0,2), (-2,-2), (-2,2), (2,-2), (2,2) 등. 여기서, 1/4 픽셀 단위는 1에 해당됨.)만큼 이동된 위치를 지시하는 움직임 정보를 현재 블록의 최종 L1 시간적 움직임 정보로 사용할 수 있다. 또 다른 예로, 부호화기 및 복호화기는 제1 콜 블록의 움직임 정보가 지시하는 위치에서 수직 및/또는 수평 방향으로 정수 픽셀 크기(예를 들어, (-4,0), (4,0), (0,-4), (0,4), (-4,-4), (-4,4), (4,-4), (4,4) 등. 여기서, 1/4 픽셀 단위는 1에 해당됨.)만큼 이동된 위치를 지시하는 움직임 정보를 현재 블록의 최종 L1 시간적 움직임 정보로 사용할 수도 있다. 한편, 움직임 벡터는 수직 방향 성분 및 수평 방향 성분을 포함하므로, 상술한 방법들(1/4 픽셀 크기만큼 이동, 1/2 픽셀 크기만큼 이동, 정수 픽셀 크기만큼 이동)은 수평 방향 성분 및 수직 방향 성분에 대해 각각 독립적으로 적용될 수도 있다. 이 때, 수평 방향의 이동 거리 및 수직 방향의 이동 거리는 서로 다를 수도 있다.In one embodiment, the encoder and the decoder are motion indicating a relative position moved based on a predetermined distance and/or direction from a position indicated by motion information (motion vector) of the first collocated block within the first collocated picture. The information may be used as the final L1 temporal motion information (L1 motion vector) of the current block. As an example, the encoder and the decoder have a 1/4 pixel size (eg, (-1,0), (1,0), ( 0,-1), (0,1), (-1,-1), (-1,1), (1,-1), (1,1), etc. where 1/4 pixel unit is 1 .) may be used as the final L1 temporal motion information of the current block, the motion information indicating the moved position. As another example, the encoder and the decoder have a 1/2 pixel size (eg, (-2,0), (2,0), ( 0,-2), (0,2), (-2,-2), (-2,2), (2,-2), (2,2), etc. where 1/4 pixel unit is 1 .) may be used as the final L1 temporal motion information of the current block, the motion information indicating the moved position. As another example, the encoder and the decoder have integer pixel sizes (eg, (-4,0), (4,0), (0) in the vertical and/or horizontal direction at the position indicated by the motion information of the first collocated block. ,-4), (0,4), (-4,-4), (-4,4), (4,-4), (4,4), etc. where 1/4 pixel unit is 1 The motion information indicating the position moved as much as applicable.) may be used as the final L1 temporal motion information of the current block. On the other hand, since the motion vector includes a vertical component and a horizontal component, the above-described methods (moving by 1/4 pixel size, moving by 1/2 pixel size, moving by integer pixel size) include a horizontal component and a vertical component. Each component may be independently applied. In this case, the moving distance in the horizontal direction and the moving distance in the vertical direction may be different from each other.

다른 실시예로, 부호화기 및 복호화기는 제1 콜 블록의 움직임 정보(움직임 벡터) 값을 다른 픽셀 단위의 값으로 변경한 후 변경된 값을 현재 블록의 최종 L1 시간적 움직임 정보(L1 움직임 벡터)로 사용할 수 있다. 일례로, 제1 콜 블록의 움직임 정보 값이 1/4 픽셀 단위의 값인 경우, 부호화기 및 복호화기는 쉬프트 연산 등을 기반으로 상기 제1 콜 블록의 움직임 정보 값을 1/2 픽셀 단위의 값으로 변경할 수 있고, 상기 변경된 값을 현재 블록의 최종 L1 시간적 움직임 정보로 사용할 수 있다. 다른 예로, 제1 콜 블록의 움직임 정보 값이 1/2 픽셀 단위의 값인 경우, 부호화기 및 복호화기는 쉬프트 연산 등을 기반으로 상기 제1 콜 블록의 움직임 정보 값을 정수 픽셀 단위의 값으로 변경할 수 있고, 상기 변경된 값을 현재 블록의 최종 L1 시간적 움직임 정보로 사용할 수 있다.In another embodiment, the encoder and the decoder may change the value of the motion information (motion vector) of the first collocated block to a value of another pixel unit, and then use the changed value as the final L1 temporal motion information (L1 motion vector) of the current block. have. For example, when the motion information value of the first collocated block is a value in units of 1/4 pixels, the encoder and the decoder change the value of the motion information of the first collocated block to a value in units of 1/2 pixels based on a shift operation, etc. and the changed value may be used as the final L1 temporal motion information of the current block. As another example, when the motion information value of the first collocated block is a value in units of 1/2 pixels, the encoder and the decoder may change the value of the motion information of the first collocated block to a value in units of integer pixels based on a shift operation, etc. , the changed value may be used as the final L1 temporal motion information of the current block.

제1 콜 블록의 움직임 정보(예를 들어, 움직임 벡터)를 기반으로 현재 블록의 L1 입력 시간적 움직임 정보(예를 들어, L1 입력 움직임 벡터)를 재설정하는 방법은 상술한 실시예에 한정되지 않으며, 구현 및/또는 필요에 따라 다양한 형태로 적용될 수 있다. 또한, 상술한 실시예에 따른 방법들은 도 9의 S940 단계에서와 같이 제2 콜 블록의 움직임 정보를 기반으로 L1 입력 시간적 움직임 정보를 재설정하는 경우에도 동일하거나 유사한 방식으로 적용될 수 있다.The method of resetting the L1 input temporal motion information (eg, L1 input motion vector) of the current block based on the motion information (eg, motion vector) of the first collocated block is not limited to the above-described embodiment, It may be applied in various forms according to implementation and/or needs. In addition, the methods according to the above-described embodiment may be applied in the same or similar manner to the case of resetting the L1 input temporal motion information based on the motion information of the second collocated block as in step S940 of FIG. 9 .

한편, 상술한 실시예에서 S910 단계로 입력되는 입력 시간적 움직임 정보는 입력 움직임 벡터뿐만 아니라 입력 참조 픽쳐 인덱스도 포함할 수 있다. 여기서, L0 입력 움직임 벡터 및 L1 입력 움직임 벡터는 상술한 바와 같이 제1 콜 블록을 기반으로 시간적으로 도출된 움직임 벡터일 수 있고, L0 입력 참조 픽쳐 인덱스 및 L1 입력 참조 픽쳐 인덱스는 복원된 주변 블록으로부터 공간적으로 도출된 참조 픽쳐 인덱스일 수 있다. 이 때, L0 입력 참조 픽쳐 인덱스 및 L1 입력 참조 픽쳐 인덱스는, 복원된 주변 블록의 참조 픽쳐 인덱스 중에서 음수가 아닌 가장 작은 값으로 설정될 수 있다. 한편, 다른 예로 L0 입력 참조 픽쳐 인덱스 및 L1 입력 참조 픽쳐 인덱스는 복원된 주변 블록의 움직임 정보에 관계 없이 0으로 설정될 수도 있다.Meanwhile, in the above-described embodiment, the input temporal motion information input in step S910 may include an input reference picture index as well as an input motion vector. Here, the L0 input motion vector and the L1 input motion vector may be motion vectors temporally derived based on the first collocated block as described above, and the L0 input reference picture index and the L1 input reference picture index are obtained from the reconstructed neighboring blocks. It may be a spatially derived reference picture index. In this case, the L0 input reference picture index and the L1 input reference picture index may be set to the smallest non-negative value among the reference picture indexes of the reconstructed neighboring blocks. Meanwhile, as another example, the L0 input reference picture index and the L1 input reference picture index may be set to 0 regardless of the motion information of the reconstructed neighboring blocks.

L1 입력 움직임 벡터가 제2 콜 블록을 기반으로 재설정되는 경우, L1 입력 참조 픽쳐 인덱스에 대해서도 재설정 과정이 수행될 수 있다. 이하, L1 입력 참조 픽쳐 인덱스에 대한 재설정 과정의 실시예들이 서술된다.When the L1 input motion vector is reset based on the second collocated block, a reset process may also be performed on the L1 input reference picture index. Hereinafter, embodiments of the reset process for the L1 input reference picture index will be described.

일 실시예로, 부호화기 및 복호화기는 제2 콜 블록을 기반으로 L1 입력 참조 픽쳐 인덱스를 재설정할 수 있다. 상술한 바와 같이, 부호화기 및 복호화기는 제2 콜 블록의 움직임 정보를 현재 블록의 최종 L1 시간적 움직임 정보로 사용할 수 있다. 이 때, 부호화기 및 복호화기는 L1 입력 참조 픽쳐 인덱스를 상기 제2 콜 블록의 참조 픽쳐 인덱스로 재설정함으로써 최종 L1 참조 픽쳐 인덱스를 도출할 수 있다. 다른 실시예로, 부호화기 및 복호화기는 L1 입력 참조 픽쳐 인덱스 값을 소정의 고정된 참조 픽쳐 인덱스 값으로 재설정함으로써 최종 L1 참조 픽쳐 인덱스를 도출할 수도 있다.As an embodiment, the encoder and the decoder may reset the L1 input reference picture index based on the second collocated block. As described above, the encoder and the decoder may use the motion information of the second collocated block as the final L1 temporal motion information of the current block. In this case, the encoder and the decoder may derive the final L1 reference picture index by resetting the L1 input reference picture index to the reference picture index of the second collocated block. In another embodiment, the encoder and the decoder may derive the final L1 reference picture index by resetting the L1 input reference picture index value to a predetermined fixed reference picture index value.

또 다른 실시예로, L0 입력 시간적 움직임 정보(예를 들어, L0 입력 움직임 벡터, L0 입력 참조 픽쳐 인덱스 등) 와 L1 입력 시간적 움직임 정보(예를 들어, L1 입력 움직임 벡터, L1 입력 참조 픽쳐 인덱스 등)가 동일한 경우, 부호화기 및 복호화기는 L0 입력 참조 픽쳐 인덱스 및 L1 입력 참조 픽쳐 인덱스를 모두 0의 값으로 재설정하여 최종 시간적 움직임 정보로 사용할 수도 있다. 이는, L0 입력 시간적 움직임 정보와 L1 입력 시간적 움직임 정보가 동일한 경우, L0 참조 픽쳐 인덱스 및 L1 참조 픽쳐 인덱스가 모두 0일 확률이 높기 때문이다.In another embodiment, L0 input temporal motion information (eg, L0 input motion vector, L0 input reference picture index, etc.) and L1 input temporal motion information (eg, L1 input motion vector, L1 input reference picture index, etc.) ) is the same, the encoder and the decoder may reset both the L0 input reference picture index and the L1 input reference picture index to a value of 0 to use as final temporal motion information. This is because, when the L0 input temporal motion information and the L1 input temporal motion information are the same, there is a high probability that both the L0 reference picture index and the L1 reference picture index are 0.

또 다른 실시예로, 부호화기 및 복호화기는 L1 입력 참조 픽쳐 인덱스 값을 L0 입력 참조 픽쳐 인덱스 값과 동일한 값으로 재설정할 수 있다. 반면, 부호화기 및 복호화기는 L1 입력 참조 픽쳐 인덱스 값을 L0 입력 참조 픽쳐 인덱스와 동일하지 않은 참조 픽쳐 인덱스 값으로 재설정할 수도 있다. 복원된 주변 블록이 갖는 참조 픽쳐 인덱스 중에는 L0 입력 참조 픽쳐 인덱스와 동일하지 않은 참조 픽쳐 인덱스가 존재할 수 있다. 이 때, 예를 들어 부호화기 및 복호화기는 L1 입력 참조 픽쳐 인덱스의 재설정을 위해, 상기 L0 입력 참조 픽쳐 인덱스와 동일하지 않은 참조 픽쳐 인덱스 중에서 가장 자주 사용된 참조 픽쳐 인덱스를 사용할 수 있다. 다른 예로, 이 때 부호화기 및 복호화기는 L1 입력 참조 픽쳐 인덱스의 재설정을 위해, 상기 L0 입력 참조 픽쳐 인덱스와 동일하지 않은 참조 픽쳐 인덱스 중에서 음수가 아닌 가장 작은 값을 갖는 참조 픽쳐 인덱스를 사용할 수도 있다.As another embodiment, the encoder and the decoder may reset the L1 input reference picture index value to the same value as the L0 input reference picture index value. On the other hand, the encoder and the decoder may reset the L1 input reference picture index value to a reference picture index value that is not the same as the L0 input reference picture index. Among the reference picture indexes of the reconstructed neighboring blocks, there may be a reference picture index that is not the same as the L0 input reference picture index. In this case, for example, the encoder and the decoder may use the most frequently used reference picture index among reference picture indexes that are not the same as the L0 input reference picture index to reset the L1 input reference picture index. As another example, in this case, the encoder and the decoder may use the reference picture index having the smallest non-negative value among the reference picture indices that are not the same as the L0 input reference picture index to reset the L1 input reference picture index.

한편, 상술한 바와 같이 부호화기 및 복호화기는 L1 입력 움직임 벡터 값을 제2 콜 블록의 움직임 벡터와 동일한 값으로 재설정함으로써 최종 L1 시간적 움직임 벡터를 도출할 수 있다. 이 때, 상기 제2 콜 블록의 움직임 벡터는 L1 입력 참조 픽쳐 인덱스 및/또는 재설정된 L1 참조 픽쳐 인덱스에 따라 스케일링되어 사용될 수도 있다. L1 입력 참조 픽쳐 인덱스는 재설정 과정 없이 그대로 최종 L1 참조 픽쳐 인덱스로 사용될 수도 있고, 상술한 실시예에서와 같이 재설정 과정을 거쳐 최종 L1 참조 픽쳐 인덱스로 사용될 수도 있다. 이 때, 제2 콜 블록의 움직임 벡터에 대응하는 참조 픽쳐, 및 최종 L1 참조 픽쳐 인덱스가 지시하는 참조 픽쳐는 서로 다를 수 있다. 이 경우, 부호화기 및 복호화기는 제2 콜 블록의 움직임 벡터에 대한 스케일링을 수행하고 상기 스케일링된 움직임 벡터를 현재 블록의 최종 L1 시간적 움직임 벡터로 사용할 수 있다.Meanwhile, as described above, the encoder and the decoder may derive the final L1 temporal motion vector by resetting the L1 input motion vector value to the same value as the motion vector of the second collocated block. In this case, the motion vector of the second collocated block may be scaled and used according to the L1 input reference picture index and/or the reset L1 reference picture index. The L1 input reference picture index may be used as the final L1 reference picture index as it is without a reset process, or may be used as the final L1 reference picture index through the reset process as in the above-described embodiment. In this case, the reference picture corresponding to the motion vector of the second collocated block and the reference picture indicated by the final L1 reference picture index may be different from each other. In this case, the encoder and the decoder may perform scaling on the motion vector of the second collocated block and use the scaled motion vector as the final L1 temporal motion vector of the current block.

상술한 실시예들은 움직임 벡터의 재설정 과정 및 참조 픽쳐 인덱스(예를 들어, RefIdxLX, X=0,1)의 재설정 과정에 따라 다양한 방법으로 조합되어 적용될 수 있다. 이하, 후술되는 실시예들에서 L1 입력 움직임 벡터는 제2 콜 블록을 기반으로 재설정된다고 가정한다. 즉, 부호화기 및 복호화기는 L1 입력 움직임 벡터를 제2 콜 블록의 움직임 벡터 중에서 하나의 값으로 재설정한다고 가정한다.The above-described embodiments may be combined and applied in various ways according to a motion vector resetting process and a reference picture index resetting process (eg, RefIdxLX, X=0,1). Hereinafter, it is assumed that the L1 input motion vector is reset based on the second collocated block in embodiments to be described below. That is, it is assumed that the encoder and the decoder reset the L1 input motion vector to one of the motion vectors of the second collocated block.

일 실시예로, 부호화기 및 복호화기는 L0 입력 시간적 움직임 정보 도출에 사용된 제1 콜 픽쳐를 그대로 제2 콜 픽쳐로 사용할 수 있고, 제2 콜 블록은 상기 제2 콜 픽쳐에서 도출될 수 있다. 이 때, 부호화기 및 복호화기는 L1 입력 움직임 벡터의 재설정을 위해, 상기 제2 콜 블록의 움직임 벡터를 스케일링하여 사용할 수 있다. 이 경우, 상기 스케일링된 움직임 벡터가 최종 L1 시간적 움직임 정보로 사용될 수 있다. 이 때, 일례로 L1 입력 참조 픽쳐 인덱스는 재설정 과정 없이 그대로 최종 L1 시간적 움직임 정보로 사용될 수 있다. 즉, 부호화기 및 복호화기는 현재 블록의 L1 시간적 움직임 정보에 L1 입력 참조 픽쳐 인덱스를 그대로 할당할 수 있다. 또 다른 예로, L1 입력 참조 픽쳐 인덱스 값은 소정의 고정된 참조 픽쳐 인덱스 값으로 재설정될 수도 있다. 즉, 부호화기 및 복호화기는 현재 블록의 L1 시간적 움직임 정보에 소정의 고정된 참조 픽쳐 인덱스 값을 할당할 수 있으며, 상기 소정의 고정된 참조 픽쳐 인덱스가 최종 L1 시간적 움직임 정보로 사용될 수 있다.As an embodiment, the encoder and the decoder may use the first collocated picture used to derive the L0 input temporal motion information as it is as the second collocated picture, and the second collocated block may be derived from the second collocated picture. In this case, the encoder and the decoder may scale and use the motion vector of the second collocated block to reset the L1 input motion vector. In this case, the scaled motion vector may be used as the final L1 temporal motion information. In this case, for example, the L1 input reference picture index may be used as the final L1 temporal motion information as it is without a reset process. That is, the encoder and the decoder may allocate the L1 input reference picture index to the L1 temporal motion information of the current block as it is. As another example, the L1 input reference picture index value may be reset to a predetermined fixed reference picture index value. That is, the encoder and the decoder may allocate a predetermined fixed reference picture index value to the L1 temporal motion information of the current block, and the predetermined fixed reference picture index may be used as the final L1 temporal motion information.

다른 실시예로, 부호화기 및 복호화기는 상술한 실시예에서와 같이 L0 입력 시간적 움직임 정보 도출에 사용된 제1 콜 픽쳐를 그대로 제2 콜 픽쳐로 사용할 수 있고, 제2 콜 블록은 상기 제2 콜 픽쳐에서 도출될 수 있다. 이 때, 부호화기 및 복호화기는 L1 입력 움직임 벡터의 재설정을 위해, 제2 콜 블록의 움직임 벡터 중에서 L0 입력 움직임 벡터와 동일하지 않으면서 L0 입력 움직임 벡터와의 차이가 소정의 임계값 이하인 움직임 벡터를 도출할 수 있다. 부호화기 및 복호화기는 상기 도출된 움직임 벡터에 대한 스케일링을 수행할 수 있으며, 스케일링된 움직임 벡터는 최종 L1 시간적 움직임 정보로 사용될 수 있다. 이 때, 일례로 L1 입력 참조 픽쳐 인덱스는 재설정 과정 없이 그대로 최종 L1 시간적 움직임 정보로 사용될 수 있다. 즉, 부호화기 및 복호화기는 현재 블록의 L1 시간적 움직임 정보에 L1 입력 참조 픽쳐 인덱스를 그대로 할당할 수 있다. 또 다른 예로, L1 입력 참조 픽쳐 인덱스 값은 소정의 고정된 참조 픽쳐 인덱스 값으로 재설정될 수도 있다. 즉, 부호화기 및 복호화기는 현재 블록의 L1 시간적 움직임 정보에 소정의 고정된 참조 픽쳐 인덱스 값을 할당할 수 있으며, 상기 소정의 고정된 참조 픽쳐 인덱스가 최종 L1 시간적 움직임 정보로 사용될 수 있다.In another embodiment, the encoder and the decoder may use the first collocated picture used for deriving the L0 input temporal motion information as it is as the second collocated picture as in the above-described embodiment, and the second collocated block is the second collocated picture. can be derived from At this time, in order to reset the L1 input motion vector, the encoder and the decoder derive a motion vector that is not the same as the L0 input motion vector from among the motion vectors of the second collocated block and has a difference from the L0 input motion vector equal to or less than a predetermined threshold. can do. The encoder and the decoder may perform scaling on the derived motion vector, and the scaled motion vector may be used as final L1 temporal motion information. In this case, for example, the L1 input reference picture index may be used as the final L1 temporal motion information as it is without a reset process. That is, the encoder and the decoder may allocate the L1 input reference picture index to the L1 temporal motion information of the current block as it is. As another example, the L1 input reference picture index value may be reset to a predetermined fixed reference picture index value. That is, the encoder and the decoder may allocate a predetermined fixed reference picture index value to the L1 temporal motion information of the current block, and the predetermined fixed reference picture index may be used as the final L1 temporal motion information.

또 다른 실시예로, 부호화기 및 복호화기는 L0 입력 시간적 움직임 정보 도출에 사용된 제1 콜 픽쳐와 동일하지 않은 참조 픽쳐를 제2 콜 픽쳐로 사용할 수도 있다. 여기서, 상기 제2 콜 픽쳐는 일례로 제1 콜 픽쳐와 동일하지 않은 L1 참조 픽쳐 리스트 내의 참조 픽쳐 중에서 가장 최근에 복호화된 참조 픽쳐일 수 있다. 다른 예로, 부호화기 및 복호화기는 복원된 주변 블록의 참조 픽쳐 번호를 기반으로 가장 사용 빈도가 높은 참조 픽쳐를 제2 콜 픽쳐로 선택할 수도 있다. 제2 콜 블록은 상기 제2 콜 픽쳐에서 도출될 수 있으며, 이 때 부호화기 및 복호화기는 L1 입력 움직임 벡터의 재설정을 위해, 상기 제2 콜 블록의 움직임 벡터를 스케일링하여 사용할 수 있다. 이 경우, 상기 스케일링된 움직임 벡터가 최종 L1 시간적 움직임 정보로 사용될 수 있다. 이 때, 일례로 L1 입력 참조 픽쳐 인덱스는 재설정 과정 없이 그대로 최종 L1 시간적 움직임 정보로 사용될 수 있다. 즉, 부호화기 및 복호화기는 현재 블록의 L1 시간적 움직임 정보에 L1 입력 참조 픽쳐 인덱스를 그대로 할당할 수 있다. 또 다른 예로, L1 입력 참조 픽쳐 인덱스 값은 소정의 고정된 참조 픽쳐 인덱스 값으로 재설정될 수도 있다. 즉, 부호화기 및 복호화기는 현재 블록의 L1 시간적 움직임 정보에 소정의 고정된 참조 픽쳐 인덱스 값을 할당할 수 있으며, 상기 소정의 고정된 참조 픽쳐 인덱스가 최종 L1 시간적 움직임 정보로 사용될 수 있다.As another embodiment, the encoder and the decoder may use a reference picture that is not the same as the first collocated picture used for deriving the L0 input temporal motion information as the second collocated picture. Here, the second collocated picture may be, for example, a most recently decoded reference picture among reference pictures in the L1 reference picture list that is not identical to the first collocated picture. As another example, the encoder and the decoder may select the most frequently used reference picture as the second collocated picture based on the reference picture numbers of the reconstructed neighboring blocks. The second collocated block may be derived from the second collocated picture, and in this case, the encoder and the decoder may scale and use the motion vector of the second collocated block to reset the L1 input motion vector. In this case, the scaled motion vector may be used as the final L1 temporal motion information. In this case, for example, the L1 input reference picture index may be used as the final L1 temporal motion information as it is without a reset process. That is, the encoder and the decoder may allocate the L1 input reference picture index to the L1 temporal motion information of the current block as it is. As another example, the L1 input reference picture index value may be reset to a predetermined fixed reference picture index value. That is, the encoder and the decoder may allocate a predetermined fixed reference picture index value to the L1 temporal motion information of the current block, and the predetermined fixed reference picture index may be used as the final L1 temporal motion information.

또 다른 실시예로, 부호화기 및 복호화기는 상술한 실시예에서와 같이 L0 입력 시간적 움직임 정보 도출에 사용된 제1 콜 픽쳐와 동일하지 않은 참조 픽쳐를 제2 콜 픽쳐로 사용할 수 있으며, 제2 콜 블록은 상기 제2 콜 픽쳐에서 도출될 수 있다. 여기서, 상기 제2 콜 픽쳐는 일례로 제1 콜 픽쳐와 동일하지 않은 L1 참조 픽쳐 리스트 내의 참조 픽쳐 중에서 가장 최근에 복호화된 참조 픽쳐일 수 있다. 다른 예로, 부호화기 및 복호화기는 복원된 주변 블록의 참조 픽쳐 번호를 기반으로 가장 사용 빈도가 높은 참조 픽쳐를 제2 콜 픽쳐로 선택할 수도 있다. 이 때, 부호화기 및 복호화기는 L1 입력 움직임 벡터의 재설정을 위해, 제2 콜 블록의 움직임 벡터 중에서 L0 입력 움직임 벡터와 동일하지 않으면서 L0 입력 움직임 벡터와의 차이가 소정의 임계값 이하인 움직임 벡터를 도출할 수 있다. 부호화기 및 복호화기는 상기 도출된 움직임 벡터에 대한 스케일링을 수행할 수 있으며, 스케일링된 움직임 벡터는 최종 L1 시간적 움직임 정보로 사용될 수 있다. 이 때, 일례로 L1 입력 참조 픽쳐 인덱스는 재설정 과정 없이 그대로 최종 L1 시간적 움직임 정보로 사용될 수 있다. 즉, 부호화기 및 복호화기는 현재 블록의 L1 시간적 움직임 정보에 L1 입력 참조 픽쳐 인덱스를 그대로 할당할 수 있다. 또 다른 예로, L1 입력 참조 픽쳐 인덱스 값은 소정의 고정된 참조 픽쳐 인덱스 값으로 재설정될 수도 있다. 즉, 부호화기 및 복호화기는 현재 블록의 L1 시간적 움직임 정보에 소정의 고정된 참조 픽쳐 인덱스 값을 할당할 수 있으며, 상기 소정의 고정된 참조 픽쳐 인덱스가 최종 L1 시간적 움직임 정보로 사용될 수 있다.As another embodiment, the encoder and the decoder may use, as the second collocated picture, a reference picture that is not the same as the first collocated picture used for deriving the L0 input temporal motion information as in the above-described embodiment, and the second collocated block may be derived from the second collocated picture. Here, the second collocated picture may be, for example, a most recently decoded reference picture among reference pictures in the L1 reference picture list that is not identical to the first collocated picture. As another example, the encoder and the decoder may select the most frequently used reference picture as the second collocated picture based on the reference picture numbers of the reconstructed neighboring blocks. At this time, in order to reset the L1 input motion vector, the encoder and the decoder derive a motion vector that is not the same as the L0 input motion vector from among the motion vectors of the second collocated block and has a difference from the L0 input motion vector equal to or less than a predetermined threshold. can do. The encoder and the decoder may perform scaling on the derived motion vector, and the scaled motion vector may be used as final L1 temporal motion information. In this case, for example, the L1 input reference picture index may be used as the final L1 temporal motion information as it is without a reset process. That is, the encoder and the decoder may allocate the L1 input reference picture index to the L1 temporal motion information of the current block as it is. As another example, the L1 input reference picture index value may be reset to a predetermined fixed reference picture index value. That is, the encoder and the decoder may allocate a predetermined fixed reference picture index value to the L1 temporal motion information of the current block, and the predetermined fixed reference picture index may be used as the final L1 temporal motion information.

움직임 벡터의 재설정 과정 및 참조 픽쳐 인덱스의 재설정 과정의 실시예들의 조합은 상술한 실시예에 한정되는 것이 아니며, 구현 및/또는 필요에 따라 상술한 실시예들 뿐만 아니라 다양한 형태의 조합이 제공될 수 있다.The combination of the embodiments of the motion vector resetting process and the reference picture index resetting process is not limited to the above-described embodiment, and various types of combinations may be provided as well as the above-described embodiments according to implementation and/or necessity. have.

한편, 재설정된 L1 시간적 움직임 정보는 현재 블록의 L0 시간적 움직임 정보와 동일할 수 있다. 따라서, 재설정된 L1 시간적 움직임 정보가 현재 블록의 L0 시간적 움직임 정보와 동일한 경우, 부호화기 및 복호화기는 현재 블록의 예측 방향 정보를 단방향 예측으로 다시 설정할 수도 있다. 이 때, 부호화기 및 복호화기는 L0 시간적 움직임 정보만을 현재 블록의 시간적 움직임 정보로 사용할 수 있다. 이러한 방법은 상술한 실시예들과 결합된 조합으로서 본 발명에 적용될 수도 있다.Meanwhile, the reset L1 temporal motion information may be the same as the L0 temporal motion information of the current block. Accordingly, when the reset L1 temporal motion information is the same as the L0 temporal motion information of the current block, the encoder and the decoder may reset the prediction direction information of the current block to unidirectional prediction. In this case, the encoder and the decoder may use only the L0 temporal motion information as the temporal motion information of the current block. This method may be applied to the present invention as a combination combined with the above-described embodiments.

도 10은 L1 시간적 움직임 정보의 재설정을 위해 사용되는 제2 콜 블록의 실시예를 개략적으로 나타내는 도면이다. 10 is a diagram schematically illustrating an embodiment of a second collocated block used for resetting L1 temporal motion information.

부호화기 및 복호화기는 제2 콜 픽쳐 내에서 현재 블록과 공간적으로 동일한 위치에 존재하는 동일 위치 블록을 기준으로 제2 콜 블록을 결정할 수 있다. 도 10에서 블록 1010은 현재 블록을 나타내고, 블록 1020은 제2 콜 픽쳐 내의 동일 위치 블록을 나타낸다. 여기서, 상기 제2 콜 픽쳐는 다양한 방식으로 결정될 수 있다.The encoder and the decoder may determine the second collocated block based on a co-located block that is spatially co-located with the current block in the second collocated picture. In FIG. 10 , a block 1010 indicates a current block, and a block 1020 indicates a co-located block in the second collocated picture. Here, the second collocated picture may be determined in various ways.

일 실시예로, 부호화기 및 복호화기는 L0 참조 픽쳐 리스트에 포함된 참조 픽쳐 중에서 하나의 참조 픽쳐를 제2 콜 픽쳐로 결정할 수 있다. 일례로, 부호화기 및 복호화기는 L0 참조 픽쳐 리스트 내의 첫 번째 참조 픽쳐를 제2 콜 픽쳐로 결정할 수 있다. 다른 예로, 부호화기 및 복호화기는 L0 참조 픽쳐 리스트 내의 두 번째 참조 픽쳐를 제2 콜 픽쳐로 결정할 수 있다. 또 다른 예로, 부호화기 및 복호화기는 L0 참조 픽쳐 리스트 내의 세 번째 참조 픽쳐를 제2 콜 픽쳐로 결정할 수 있다. 또 다른 예로, 부호화기 및 복호화기는 L0 참조 픽쳐 리스트 내의 네 번째 참조 픽쳐를 제2 콜 픽쳐로 결정할 수도 있다.As an embodiment, the encoder and the decoder may determine one reference picture from among reference pictures included in the L0 reference picture list as the second collocated picture. As an example, the encoder and the decoder may determine the first reference picture in the L0 reference picture list as the second collocated picture. As another example, the encoder and the decoder may determine the second reference picture in the L0 reference picture list as the second collocated picture. As another example, the encoder and the decoder may determine the third reference picture in the L0 reference picture list as the second collocated picture. As another example, the encoder and the decoder may determine the fourth reference picture in the L0 reference picture list as the second collocated picture.

다른 실시예로, 부호화기 및 복호화기는 L1 참조 픽쳐 리스트에 포함된 참조 픽쳐 중에서 하나의 참조 픽쳐를 제2 콜 픽쳐로 결정할 수 있다. 일례로, 부호화기 및 복호화기는 L1 참조 픽쳐 리스트 내의 첫 번째 참조 픽쳐를 제2 콜 픽쳐로 결정할 수 있다. 다른 예로, 부호화기 및 복호화기는 L1 참조 픽쳐 리스트 내의 두 번째 참조 픽쳐를 제2 콜 픽쳐로 결정할 수 있다. 또 다른 예로, 부호화기 및 복호화기는 L1 참조 픽쳐 리스트 내의 세 번째 참조 픽쳐를 제2 콜 픽쳐로 결정할 수 있다. 또 다른 예로, 부호화기 및 복호화기는 L1 참조 픽쳐 리스트 내의 네 번째 참조 픽쳐를 제2 콜 픽쳐로 결정할 수도 있다.In another embodiment, the encoder and the decoder may determine one reference picture from among reference pictures included in the L1 reference picture list as the second collocated picture. As an example, the encoder and the decoder may determine the first reference picture in the L1 reference picture list as the second collocated picture. As another example, the encoder and the decoder may determine the second reference picture in the L1 reference picture list as the second collocated picture. As another example, the encoder and the decoder may determine the third reference picture in the L1 reference picture list as the second collocated picture. As another example, the encoder and the decoder may determine the fourth reference picture in the L1 reference picture list as the second collocated picture.

또 다른 실시예로, 부호화기 및/또는 복호화기는 L0 참조 픽쳐 리스트 및 L1 참조 픽쳐 리스트 내의 모든 참조 픽쳐(및/또는 소정의 조건에 따라 결정된 일부 참조 픽쳐) 중에서 가장 높은 부호화 효율을 제공하는 참조 픽쳐를 제2 콜 픽쳐로 사용할 수 있다. 여기서, 부호화 효율은 각 참조 픽쳐 내에서 제2 콜 블록에 대응되는 위치에 존재하는 블록의 움직임 정보를 기반으로 결정될 수 있다. 이 때, 부호화기는 부호화 효율에 기반하여 제2 콜 픽쳐를 도출할 수 있고, 상기 제2 콜 픽쳐를 지시하는 제2 콜 픽쳐 정보를 복호화기로 전송할 수 있다. 복호화기는 상기 전송된 제2 콜 픽쳐 정보를 기반으로 제2 콜 픽쳐를 결정할 수 있다.In another embodiment, the encoder and/or decoder selects the reference picture that provides the highest coding efficiency among all reference pictures (and/or some reference pictures determined according to a predetermined condition) in the L0 reference picture list and the L1 reference picture list. It can be used as the second collocated picture. Here, the encoding efficiency may be determined based on motion information of a block existing at a position corresponding to the second collocated block in each reference picture. In this case, the encoder may derive the second collocated picture based on the encoding efficiency, and may transmit second collocated picture information indicating the second collocated picture to the decoder. The decoder may determine the second collocated picture based on the transmitted second collocated picture information.

상술한 실시예들에서, 부호화기 및 복호화기는 L0 입력 시간적 움직임 정보 도출에 사용된 제1 콜 픽쳐와 동일하지 않은 참조 픽쳐만을 제2 콜 픽쳐로 결정할 수도 있다. 이러한 경우에는 제1 콜 픽쳐와 동일하지 않은 참조 픽쳐만이 현재 블록의 최종 L1 시간적 움직임 정보 도출에 사용될 수 있다.In the above-described embodiments, the encoder and the decoder may determine only the reference picture that is not the same as the first collocated picture used for deriving the L0 input temporal motion information as the second collocated picture. In this case, only the reference picture that is not the same as the first collocated picture may be used to derive the final L1 temporal motion information of the current block.

제2 콜 픽쳐 결정 방법은 상술한 실시예에 한정되는 것은 아니며, 제2 콜 픽쳐는 구현 및/또는 필요에 따라 다른 방식으로 결정될 수도 있다. The method of determining the second collocated picture is not limited to the above-described embodiment, and the second collocated picture may be determined in another manner according to implementation and/or necessity.

한편, 도 10의 실시예에서, 동일 위치 블록(1020) 내부의 센터에 위치한 블록은 블록 D, 동위 위치 블록(1020) 내부의 좌측 상단 코너에 위치한 블록은 블록 S, 동일 위치 블록(1020) 내부의 좌측 하단 코너에 위치한 블록은 블록 Q, 동일 위치 블록(1020) 내부의 우측 상단 코너에 위치한 블록은 블록 R, 동일 위치 블록(1020) 내부의 우측 하단 코너에 위치한 블록은 블록 C라 한다. 또한, 동일 위치 블록(1020)의 좌측에 인접한 블록 중에서 가장 상단에 위치한 블록은 블록 F, 동일 위치 블록(1020)의 좌측에 인접한 블록 중에서 가장 하단에 위치한 블록은 블록 J, 동일 위치 블록(1020)의 상단에 인접한 블록 중에서 가장 좌측에 위치한 블록은 블록 G, 동일 위치 블록(1020)의 상단에 인접한 블록 중에서 가장 우측에 위치한 블록은 블록 M, 동일 위치 블록(1020)의 우측에 인접한 블록 중에서 가장 상단에 위치한 블록은 블록 N, 동일 위치 블록(1020)의 우측에 인접한 블록 중에서 가장 하단에 위치한 블록은 블록 B, 동일 위치 블록(1020)의 하단에 인접한 블록 중에서 가장 좌측에 위치한 블록은 블록 K, 동일 위치 블록(1020)의 하단에 인접한 블록 중에서 가장 우측에 위치한 블록은 블록 A라 한다. 또한, 동일 위치 블록(1020) 외부의 좌측 상단 코너에 위치한 블록은 블록 E, 동일 위치 블록(1020) 외부의 좌측 하단 코너에 위치한 블록은 블록 I, 동일 위치 블록(1020) 외부의 우측 상단 코너에 위치한 블록은 블록 L, 동일 위치 블록(1020) 외부의 우측 하단 코너에 위치한 블록은 블록 H라 한다. 또한, 블록 B의 우측에 인접하여 위치한 블록은 블록 P, 블록 A의 하단에 인접하여 위치한 블록은 블록 O라 한다.On the other hand, in the embodiment of Figure 10, the block located at the center inside the co-located block 1020 is block D, the block located at the upper left corner inside the co-located block 1020 is block S, the co-located block 1020 inside A block located at the lower left corner of the block Q is referred to as block Q, a block located at the upper right corner inside the co-located block 1020 is referred to as block R, and a block located at the lower right corner inside the co-located block 1020 is referred to as block C. In addition, among the blocks adjacent to the left of the co-located block 1020 , the uppermost block is block F, the lowest-located block among the blocks adjacent to the left of the co-located block 1020 is block J, and the co-located block 1020 ). The leftmost block among the blocks adjacent to the top of The block located at is block N, the lowermost block among the blocks adjacent to the right of the same location block 1020 is block B, the leftmost block among the blocks adjacent to the bottom of the same location block 1020 is block K, the same Among the blocks adjacent to the lower end of the location block 1020 , the rightmost block is referred to as a block A. In addition, the block located at the upper left corner outside the co-located block 1020 is block E, the block located at the lower left corner outside the co-located block 1020 is block I, the co-located block 1020 is outside the upper right corner The located block is referred to as block L, and the block located at the lower right corner outside the same location block 1020 is referred to as block H. In addition, a block located adjacent to the right side of block B is referred to as block P, and a block located adjacent to the lower end of block A is referred to as block O.

도 9의 실시예에서 상술한 바와 같이, 부호화기 및 복호화기는 소정의 조건에 따라 제2 콜 블록의 움직임 정보를 현재 블록의 최종 L1 시간적 움직임 정보로 사용할 수 있다. 즉, 부호화기 및 복호화기는 L1 입력 시간적 움직임 정보 값을 제2 콜 블록의 움직임 정보 값으로 재설정할 수 있다. 이 때, 상기 제2 콜 블록 및/또는 최종 L1 시간적 움직임 정보로 사용되는 움직임 다양한 방법으로 도출될 수 있다.As described above in the embodiment of FIG. 9 , the encoder and the decoder may use the motion information of the second collocated block as the final L1 temporal motion information of the current block according to a predetermined condition. That is, the encoder and the decoder may reset the L1 input temporal motion information value to the motion information value of the second collocated block. In this case, the motion used as the second collocated block and/or the final L1 temporal motion information may be derived by various methods.

일 실시예로, 부호화기 및 복호화기는 동일 위치 블록의 내부 및/또는 외부에 위치한 블록 중에서 동일 위치 블록을 기준으로 소정의 위치에 존재하는 한 개의 블록으로부터 최종 L1 시간적 움직임 정보로 사용되는 움직임 정보를 도출할 수 있다. 이 때, 상기 소정의 위치에 존재하는 한 개의 블록은 제2 콜 블록에 해당될 수 있다. 여기서, 상기 소정의 위치의 블록은 블록 A, 블록 B, 블록C, 블록D, 블록E, 블록F, 블록G, 블록H, 블록I, 블록J, 블록K, 블록L, 블록M, 블록N, 블록O, 블록P, 블록Q, 블록R 또는 블록S 일 수 있다.In one embodiment, the encoder and the decoder derive motion information used as the final L1 temporal motion information from one block existing at a predetermined position with respect to the same position block among blocks located inside and/or outside the same position block. can do. In this case, one block existing at the predetermined position may correspond to the second collocated block. Here, the block at the predetermined position is a block A, a block B, a block C, a block D, a block E, a block F, a block G, a block H, a block I, a block J, a block K, a block L, a block M, a block N , block O, block P, block Q, block R, or block S.

다른 실시예로, 부호화기 및 복호화기는 동일 위치 블록의 내부 및/또는 외부에 위치한 블록 중에서 소정의 위치에 존재하는 복수 개의 블록을 소정의 순서로 스캔할 수 있다. 이 때, 부호화기 및 복호화기는 스캔 순서상 움직임 정보가 존재하는 첫 번째 블록의 움직임 정보를 현재 블록의 최종 L1 시간적 움직임 정보로 사용할 수 있다. 여기서, 상기 움직임 정보가 존재하는 첫 번째 블록은 제2 콜 블록에 해당될 수 있다. 스캔 대상 블록 및 스캔 순서는 다양한 형태로 정해질 수 있다. 일례로, 부호화기 및 복호화기는 블록 H, 블록 D, 블록 A, 블록 B, 블록 C, 블록 I, 블록 J, 블록 F, 블록 G 및 블록 E 순으로 블록을 스캔할 수 있다.In another embodiment, the encoder and the decoder may scan a plurality of blocks existing at a predetermined position among blocks located inside and/or outside the same position block in a predetermined order. In this case, the encoder and the decoder may use the motion information of the first block in which the motion information exists in the scan order as the final L1 temporal motion information of the current block. Here, the first block in which the motion information exists may correspond to the second collocated block. A scan target block and a scan order may be determined in various forms. For example, the encoder and the decoder may scan the blocks in the order of block H, block D, block A, block B, block C, block I, block J, block F, block G, and block E.

또 다른 실시예로, 부호화기 및 복호화기는 동일 위치 블록의 내부 및/또는 외부에 위치한 블록 중에서 소정의 위치에 존재하는 복수 개의 블록의 움직임 정보에 대해 중간 값을 도출할 수 있고, 상기 도출된 중간 값을 현재 블록의 최종 L1 시간적 움직임 정보로 사용할 수 있다. 예를 들어, 상기 복수 개의 블록은 블록 H, 블록 D, 블록 A, 블록 B, 블록 C, 블록 I, 블록 J, 블록 F, 블록 G 및 블록 E 일 수 있다.As another embodiment, the encoder and the decoder may derive an intermediate value with respect to motion information of a plurality of blocks existing at a predetermined position among blocks located inside and/or outside the same position block, and the derived intermediate value can be used as the final L1 temporal motion information of the current block. For example, the plurality of blocks may be block H, block D, block A, block B, block C, block I, block J, block F, block G, and block E.

제2 콜 블록으로부터 현재 블록의 L1 시간적 움직임 정보를 도출하는 방법은 상술한 실시예에 한정되는 것이 아니며, 현재 블록의 L1 시간적 움직임 정보는 구현 및/또는 필요에 따라 다양한 방법으로 도출될 수 있다.A method of deriving the L1 temporal motion information of the current block from the second collocated block is not limited to the above-described embodiment, and the L1 temporal motion information of the current block may be derived in various ways according to implementation and/or necessity.

도 11은 도 9의 실시예에 따른 시간적 움직임 정보 도출 과정을 수행할 수 있는 인터 예측 장치의 일 실시예를 개략적으로 나타내는 블록도이다. 도 11의 실시예에 따른 인터 예측 장치는 시간적 움직임 정보 판단부(1110), 제2 콜 블록 움직임 정보 판단부(1120), 예측 방향 정보 재설정 및 L0 움직임 정보 설정부(1130) 및 L1 시간적 움직임 정보 재설정부(1140)를 포함할 수 있다.11 is a block diagram schematically illustrating an embodiment of an inter prediction apparatus capable of performing a process of deriving temporal motion information according to the embodiment of FIG. 9 . The inter prediction apparatus according to the embodiment of FIG. 11 includes a temporal motion information determination unit 1110 , a second collocated block motion information determination unit 1120 , a prediction direction information resetting and L0 motion information setting unit 1130 , and L1 temporal motion information A reset unit 1140 may be included.

도 11을 참조하면, 시간적 움직임 정보 판단부(1110)는 입력 시간적 움직임 정보에서 L0 입력 시간적 움직임 정보와 L1 입력 시간적 움직임 정보가 동일한지 여부, 즉 L0 입력 참조 픽쳐 번호와 L1 입력 참조 픽쳐 번호가 동일하고 L0 입력 움직임 벡터와 L1 입력 움직임 벡터가 동일한지 여부를 판단할 수 있다. Referring to FIG. 11 , the temporal motion information determining unit 1110 determines whether L0 input temporal motion information and L1 input temporal motion information are the same in the input temporal motion information, that is, the L0 input reference picture number and the L1 input reference picture number are the same. and it may be determined whether the L0 input motion vector and the L1 input motion vector are the same.

L0 입력 시간적 움직임 정보와 L1 입력 시간적 움직임 정보가 동일하지 않은 경우, 인터 예측 장치는 입력 시간적 움직임 정보를 그대로 현재 블록의 시간적 움직임 정보로 사용할 수 있다. AMVP가 적용되는 경우, 상기 현재 블록의 시간적 움직임 정보는 현재 블록에 대한 예측 움직임 벡터 후보로 결정되거나 등록될 수 있다. 또한, 머지가 적용되는 경우, 상기 현재 블록의 시간적 움직임 정보는 현재 블록에 대한 머지 후보로 결정되거나 등록될 수 있다. L0 입력 시간적 움직임 정보와 L1 입력 시간적 움직임 정보가 동일한 경우에는 제2 콜 블록 움직임 정보 판단부(1120)에 의한 판단 과정이 수행될 수 있다. When the L0 input temporal motion information and the L1 input temporal motion information are not the same, the inter prediction apparatus may use the input temporal motion information as the temporal motion information of the current block as it is. When AMVP is applied, the temporal motion information of the current block may be determined or registered as a prediction motion vector candidate for the current block. Also, when the merge is applied, the temporal motion information of the current block may be determined or registered as a merge candidate for the current block. When the L0 input temporal motion information and the L1 input temporal motion information are the same, a determination process by the second collocated block motion information determiner 1120 may be performed.

한편, 도 9에서 상술한 바와 같이 시간적 움직임 정보 판단부(1110)는 L0 입력 시간적 움직임 정보와 L1 입력 시간적 움직임 정보의 동일성 여부가 아닌, L0 입력 참조 픽쳐 번호 및 L1 입력 참조 픽쳐 번호의 동일성 여부 또는 제1 콜 블록의 예측 방향을 판단할 수도 있다. 예를 들어, L0 입력 참조 픽쳐 번호 및 L1 입력 참조 픽쳐 번호가 동일하지 않은 경우, 인터 예측 장치는 입력 시간적 움직임 정보를 그대로 현재 블록의 시간적 움직임 정보로 사용할 수 있고, L0 입력 참조 픽쳐 번호 및 L1 입력 참조 픽쳐 번호가 동일한 경우 제2 콜 블록 움직임 정보 판단부(1120)에 의한 판단 과정이 수행될 수 있다. 다른 예로, 제1 콜 블록의 예측 방향이 양방향 예측인 경우, 인터 예측 장치는 입력 시간적 움직임 정보를 그대로 현재 블록의 시간적 움직임 정보로 사용할 수 있고, 제1 콜 블록의 예측 방향이 단방향 예측인 경우 제2 콜 블록 움직임 정보 판단부(1120)에 의한 판단 과정이 수행될 수도 있다.On the other hand, as described above in FIG. 9 , the temporal motion information determining unit 1110 determines whether the L0 input temporal motion information and the L1 input temporal motion information are identical, not whether the L0 input reference picture number and the L1 input reference picture number are identical or not. The prediction direction of the first collocated block may be determined. For example, when the L0 input reference picture number and the L1 input reference picture number are not the same, the inter prediction apparatus may use the input temporal motion information as it is as the temporal motion information of the current block, and the L0 input reference picture number and L1 input When the reference picture numbers are the same, a determination process by the second collocated block motion information determination unit 1120 may be performed. As another example, when the prediction direction of the first collocated block is bidirectional prediction, the inter prediction apparatus may use the input temporal motion information as it is as the temporal motion information of the current block, and when the prediction direction of the first collocated block is unidirectional prediction, the inter prediction apparatus 2 A determination process by the collocated block motion information determination unit 1120 may be performed.

제2 콜 블록 움직임 정보 판단부(1120)는 제2 콜 블록의 움직임 정보가 존재하는지 여부를 판단할 수 있다. 제2 콜 블록의 움직임 정보가 존재하지 않는 경우(예를 들어, 소정의 위치 및/또는 소정의 방법으로 선택된 위치의 제2 콜 블록 중에서 움직임 정보를 갖는 블록이 존재하지 않는 경우), 예측 방향 정보 재설정 및 L0 움직임 정보 설정부(1130)에 의한 예측 방향 정보 재설정 및 L0 움직임 정보 설정 과정이 수행될 수 있다. 또한, 제2 콜 블록의 움직임 정보가 존재하는 경우(예를 들어, 소정의 위치 및/또는 소정의 방법으로 선택된 위치의 제2 콜 블록 중에서 움직임 정보를 갖는 블록이 존재하는 경우), L1 시간적 움직임 정보 재설정부(1140)에 의한 재설정 과정이 수행될 수 있다.The second collocated block motion information determiner 1120 may determine whether motion information of the second collocated block exists. When motion information of the second collocated block does not exist (eg, when a block having motion information does not exist among the second collocated blocks at a predetermined position and/or a position selected by a predetermined method), prediction direction information The resetting and L0 motion information setting unit 1130 may perform a process of resetting prediction direction information and setting L0 motion information. In addition, when motion information of the second collocated block exists (eg, when a block having motion information exists among second collocated blocks at a predetermined position and/or a position selected by a predetermined method), L1 temporal movement A resetting process by the information resetting unit 1140 may be performed.

제2 콜 블록의 움직임 정보가 존재하지 않는 경우, 예측 방향 정보 재설정 및 L0 움직임 정보 설정부(1130)는 현재 블록의 예측 방향 정보를 단방향 예측으로 다시 설정할 수 있다. 또한 이 때, 예측 방향 정보 재설정 및 L0 움직임 정보 설정부(1130)는 입력 시간적 움직임 정보 중에서 L0 입력 시간적 움직임 정보만을 현재 블록의 최종 시간적 움직임 정보로 설정할 수 있다.When the motion information of the second collocated block does not exist, the prediction direction information resetting and L0 motion information setting unit 1130 may reset the prediction direction information of the current block to unidirectional prediction. Also, at this time, the prediction direction information resetting and L0 motion information setting unit 1130 may set only the L0 input temporal motion information among the input temporal motion information as the final temporal motion information of the current block.

제2 콜 블록의 움직임 정보가 존재하는 경우, L1 시간적 움직임 정보 재설정부(1140)는 현재 블록의 L1 입력 시간적 움직임 정보를 제2 콜 블록의 움직임 정보로 재설정할 수 있다. 즉, 인터 예측 장치는 제2 콜 블록의 움직임 정보를 현재 블록의 최종 L1 시간적 움직임 정보로 사용할 수 있다. 이 때, 제2 콜 블록의 움직임 정보가 영 벡터(0,0)를 포함하는 경우, L1 시간적 움직임 정보 재설정부(1140)는 제2 콜 블록의 주변에 위치한 블록의 움직임 정보를 현재 블록의 최종 L1 시간적 움직임 정보로 사용할 수도 있다. 상술한 각각의 방법에 대한 구체적인 실시예는 도 6 및 도 7에서 상술한 바 있으므로, 여기서는 생략하기로 한다.When the motion information of the second collocated block exists, the L1 temporal motion information resetting unit 1140 may reset the L1 input temporal motion information of the current block to the motion information of the second collocated block. That is, the inter prediction apparatus may use the motion information of the second collocated block as the final L1 temporal motion information of the current block. At this time, when the motion information of the second collocated block includes a zero vector (0,0), the L1 temporal motion information resetter 1140 converts the motion information of a block located in the vicinity of the second collocated block to the last of the current block. It can also be used as L1 temporal motion information. A specific embodiment of each of the above-described methods has been described above with reference to FIGS. 6 and 7 , and thus will be omitted herein.

도 12는 본 발명에 따른 현재 블록의 움직임 정보 도출 방법의 실시예를 개략적으로 나타내는 도면이다.12 is a diagram schematically illustrating an embodiment of a method for deriving motion information of a current block according to the present invention.

상술한 바와 같이, 부호화기 및 복호화기는 복원된 주변 블록의 움직임 정보 및/또는 콜 블록의 움직임 정보를 기반으로 현재 블록의 움직임 정보를 도출할 수 있다. 여기서, 복원된 주변 블록은 복원된 주변 블록은 이미 부호화 및/또는 복호화되어 복원된 현재 픽쳐 내의 블록으로서, 현재 블록에 인접한 블록 및/또는 현재 블록의 외부 코너에 위치한 블록을 포함할 수 있다. 또한, 콜 블록은 콜 픽쳐 내에서 현재 블록에 대응되는 블록을 의미할 수 있으며, 상기 콜 픽쳐는 일례로 참조 픽쳐 리스트 내의 참조 픽쳐 중에서 하나의 픽쳐에 해당될 수 있다. 이 때, 복원된 주변 블록으로부터 도출되는 움직임 정보는 공간적 움직임 정보, 콜 블록을 기반으로 도출되는 움직임 정보는 시간적 움직임 정보로 불릴 수 있다. 여기서, 공간적 움직임 정보 및 시간적 움직임 정보는 각각 정보는 예측 방향 정보, L0 참조 픽쳐 번호, L1 참조 픽쳐 번호, L0 움직임 벡터 및 L1 움직임 벡터 등을 포함할 수 있다.As described above, the encoder and the decoder may derive the motion information of the current block based on the motion information of the reconstructed neighboring block and/or the motion information of the collocated block. Here, the reconstructed neighboring block is a block in the reconstructed current picture after the reconstructed neighboring block has already been encoded and/or decoded, and may include a block adjacent to the current block and/or a block located at an outer corner of the current block. Also, the collocated block may mean a block corresponding to the current block in the collocated picture, and the collocated picture may correspond to, for example, one picture among reference pictures in the reference picture list. In this case, motion information derived from the reconstructed neighboring block may be referred to as spatial motion information, and motion information derived based on the collocated block may be referred to as temporal motion information. Here, the spatial motion information and the temporal motion information may include prediction direction information, L0 reference picture number, L1 reference picture number, L0 motion vector, and L1 motion vector, respectively.

한편, 영상 복호화 과정에서는 네트워크의 트래픽 과다로 인해, 현재 픽쳐(및/또는 복호화 대상 픽쳐)의 이전 픽쳐들 중에서 복호화되지 않은 픽쳐가 존재할 수 있다. 이 경우, 현재 픽쳐 내의 블록에 대한 시간적 움직임 정보를 도출 과정에서 잘못된 콜 블록이 사용될 수 있고, 정확한 시간적 움직임 정보가 도출되지 않을 수 있으므로 현재 픽쳐가 제대로 복호화되지 않을 수 있다. 따라서, 상기 문제점을 해결하기 위해, 부호화기 및 복호화기는 현재 블록의 움직임 정보를 도출함에 있어, L0 움직임 정보 및 L1 움직임 정보 중에서 하나는 복원된 주변 블록을 기반으로 공간적으로 도출하고 다른 하나는 콜 블록을 기반으로 시간적으로 도출할 수 있다. 즉, 부호화기 및 복호화기는 L0 움직임 정보 및 L1 움직임 정보를 각각 독립적으로 설정할 수 있다. 이 경우, 복호화되지 않은 이전 픽쳐가 존재하는 경우에도 부호화기 및 복호화기는 현재 픽쳐가 어느 정도 복원되도록 할 수 있다.Meanwhile, in the video decoding process, an undecoded picture may exist among previous pictures of the current picture (and/or the picture to be decoded) due to excessive network traffic. In this case, an incorrect collocated block may be used in the process of deriving temporal motion information for a block in the current picture, and since accurate temporal motion information may not be derived, the current picture may not be properly decoded. Therefore, in order to solve the above problem, the encoder and the decoder, when deriving the motion information of the current block, one of the L0 motion information and the L1 motion information is spatially derived based on the reconstructed neighboring block, and the other is a collocated block. can be derived over time. That is, the encoder and the decoder may independently set the L0 motion information and the L1 motion information, respectively. In this case, even when an undecoded previous picture exists, the encoder and the decoder may allow the current picture to be reconstructed to some extent.

도 12를 참조하면, 부호화기 및 복호화기는 L0 움직임 정보를 설정할 수 있다(1210). 이 때, 부호화기 및 복호화기는 복원된 주변 블록을 기반으로 공간적으로 도출된 움직임 정보(공간적 움직임 정보)를 L0 움직임 정보로 사용하거나, 또는 콜 블록을 기반으로 시간적으로 도출된 움직임 정보(시간적 움직임 정보)를 L0 움직임 정보로 사용할 수 있다. 즉, 상기 L0 움직임 정보는 복원된 주변 블록을 기반으로 공간적으로 도출되거나, 또는 콜 블록을 기반으로 시간적으로 도출될 수 있다.Referring to FIG. 12 , the encoder and the decoder may set L0 motion information ( 1210 ). In this case, the encoder and the decoder use motion information (spatial motion information) spatially derived based on the reconstructed neighboring block as the L0 motion information, or motion information derived temporally based on the collocated block (temporal motion information) may be used as L0 motion information. That is, the L0 motion information may be spatially derived based on the reconstructed neighboring block or temporally based on the collocated block.

다시 도 12를 참조하면, 부호화기 및 복호화기는 L1 움직임 정보를 설정할 수 있다(1220). 이 때, 부호화기 및 복호화기는 복원된 주변 블록을 기반으로 공간적으로 도출된 움직임 정보(공간적 움직임 정보)를 L1 움직임 정보로 사용하거나, 또는 콜 블록을 기반으로 시간적으로 도출된 움직임 정보(시간적 움직임 정보)를 L1 움직임 정보로 사용할 수 있다. 즉, 상기 L1 움직임 정보는 복원된 주변 블록을 기반으로 공간적으로 도출되거나, 또는 콜 블록을 기반으로 시간적으로 도출될 수 있다.Referring back to FIG. 12 , the encoder and the decoder may set L1 motion information ( 1220 ). At this time, the encoder and the decoder use motion information (spatial motion information) spatially derived based on the reconstructed neighboring block as L1 motion information, or motion information derived temporally based on the collocated block (temporal motion information) may be used as L1 motion information. That is, the L1 motion information may be spatially derived based on a reconstructed neighboring block or temporally based on a collocated block.

일 실시예로, L0 움직임 정보가 콜 블록을 기반으로 시간적으로 도출된 움직임 정보인 경우, 부호화기 및 복호화기는 복원된 주변 블록을 기반으로 도출된 공간적 움직임 정보를 L1 움직임 정보로 사용할 수 있다. 다른 실시예로, L0 움직임 정보가 복원된 주변 블록을 기반으로 공간적으로 도출된 움직임 정보인 경우, 부호화기 및 복호화기는 콜 블록을 기반으로 도출된 시간적 움직임 정보를 L1 움직임 정보로 사용할 수 있다. As an embodiment, when the L0 motion information is motion information temporally derived based on the collocated block, the encoder and the decoder may use the spatial motion information derived based on the reconstructed neighboring block as the L1 motion information. As another embodiment, when the L0 motion information is motion information spatially derived based on the reconstructed neighboring block, the encoder and the decoder may use the temporal motion information derived based on the collocated block as the L1 motion information.

한편, 상술한 실시예에서, 부호화기 및 복호화기는 L0 움직임 정보를 기반으로 L1 움직임 정보를 도출할 수도 있다. 일례로, L0 움직임 정보는 콜 블록을 기반으로 도출된 움직임 정보라 가정한다. 이 경우, 상술한 바와 같이 부호화기 및 복호화기는 복원된 주변 블록을 기반으로 공간적으로 도출된 공간적 움직임 정보를 L1 움직임 정보로 사용할 수 있다. 이 때, 일례로 부호화기 및 복호화기는 L0 움직임 정보와 동일하거나 유사한 움직임 정보만을, L1 움직임 정보로 사용될 공간적 움직임 정보로서 도출할 수 있다. 다른 예로 부호화기 및 복호화기는 L0 움직임 정보와 동일하지 않은 움직임 정보만을, L1 움직임 정보로 사용될 공간적 움직임 정보로서 도출할 수도 있다. 이 때, 부호화기 및 복호화기는 L0 움직임 정보와의 차이가 소정의 임계값 이하인 움직임 정보만을 L1 움직임 정보로 사용될 공간적 움직임 저보로서 도출할 수도 있다. 여기서, 상기 소정의 임계값은 현재 블록의 모드 정보, 현재 블록의 움직임 정보, 주변 블록의 모드 정보 및/또는 주변 블록의 움직임 정보 등을 기반으로 정해질 수 있으며, 다양한 방식으로 결정될 수 있다.Meanwhile, in the above-described embodiment, the encoder and the decoder may derive the L1 motion information based on the L0 motion information. As an example, it is assumed that the L0 motion information is motion information derived based on a collocated block. In this case, as described above, the encoder and the decoder may use spatial motion information spatially derived based on the reconstructed neighboring blocks as the L1 motion information. In this case, for example, the encoder and the decoder may derive only motion information identical to or similar to the L0 motion information as spatial motion information to be used as the L1 motion information. As another example, the encoder and the decoder may derive only motion information that is not identical to the L0 motion information as spatial motion information to be used as the L1 motion information. In this case, the encoder and the decoder may derive only motion information whose difference from the L0 motion information is less than or equal to a predetermined threshold as spatial motion information to be used as the L1 motion information. Here, the predetermined threshold value may be determined based on mode information of the current block, motion information of the current block, mode information of the neighboring block, and/or motion information of the neighboring block, and may be determined in various ways.

L0 움직임 정보 및 L1 움직임 정보를 설정하는 방법은 상술한 실시예에 한정되지 않으며, 구현 및/또는 필요에 따라 달라질 수 있다.A method of setting the L0 motion information and the L1 motion information is not limited to the above-described embodiment, and may vary according to implementation and/or necessity.

한편, L0 움직임 정보 및/또는 L1 움직임 정보가 복원된 주변 블록의 움직임 정보를 기반으로 공간적으로 도출되는 경우, 복원된 주변 블록의 움직임 정보는 공간적으로 도출된 공간적 움직임 정보 및 시간적으로 도출된 시간적 움직임 정보를 모두 포함할 수도 있다. 이 때, 부호화기 및 복호화기는 복원된 주변 블록의 움직임 정보 중에서 공간적으로 도출된 공간적 움직임 정보만을 이용하여 현재 블록의 L0 움직임 정보 및/또는 현재 블록의 L1 움직임 정보를 도출할 수 있다.On the other hand, when the L0 motion information and/or the L1 motion information is spatially derived based on the motion information of the reconstructed neighboring block, the motion information of the reconstructed neighboring block is the spatially derived spatial motion information and the temporally derived temporal motion. It may contain all information. In this case, the encoder and the decoder may derive the L0 motion information of the current block and/or the L1 motion information of the current block by using only spatially derived spatial motion information among the motion information of the reconstructed neighboring blocks.

다시 도 12를 참조하면, 부호화기 및 복호화기는 L0 움직임 정보 및 L1 움직임 정보를 통합함으로써, 현재 블록의 움직임 정보를 도출할 수 있다(1230).Referring back to FIG. 12 , the encoder and the decoder may derive the motion information of the current block by integrating the L0 motion information and the L1 motion information ( 1230 ).

한편, 상기 도출된 현재 블록의 움직임 정보에서 L0 움직임 정보 및 L1 움직임 정보는 서로 동일할 수도 있다. 따라서, 상기 L0 움직임 정보와 상기 L1 움직임 정보가 동일한 경우, 부호화기 및 복호화기는 현재 블록의 예측 방향 정보를 단방향 예측으로 다시 설정할 수 있다. 이 때, 부호화기 및 복호화기는 L0 움직임 정보만을 현재 블록의 움직임 정보로 사용할 수 있다. Meanwhile, in the derived motion information of the current block, the L0 motion information and the L1 motion information may be identical to each other. Accordingly, when the L0 motion information and the L1 motion information are the same, the encoder and the decoder may reset the prediction direction information of the current block to unidirectional prediction. In this case, the encoder and the decoder may use only the L0 motion information as the motion information of the current block.

도 13은 도 12의 실시예에 따른 움직임 정보 도출 과정을 수행할 수 있는 인터 예측 장치의 일 실시예를 개략적으로 나타내는 블록도이다. 도 13의 실시예에 따른 인터 예측 장치는 L0 움직임 정보 설정부(1310), L1 움직임 정보 설정부(1320) 및 움직임 정보 통합부(1330)를 포함할 수 있다.13 is a block diagram schematically illustrating an embodiment of an inter prediction apparatus capable of performing a motion information derivation process according to the embodiment of FIG. 12 . The inter prediction apparatus according to the embodiment of FIG. 13 may include an L0 motion information setting unit 1310 , an L1 motion information setting unit 1320 , and a motion information integrator 1330 .

도 12의 실시예에서 상술한 바와 같이, 부호화기 및 복호화기는 L0 움직임 정보 및 L1 움직임 정보를 각각 독립적으로 설정할 수 있다. 이 때, 부호화기 및 복호화기는 L0 움직임 정보 및 L1 움직임 정보 중에서 하나는 복원된 주변 블록을 기반으로 공간적으로 도출하고 다른 하나는 콜 블록을 기반으로 시간적으로 도출할 수 있다.As described above in the embodiment of FIG. 12 , the encoder and the decoder may independently set the L0 motion information and the L1 motion information, respectively. In this case, the encoder and the decoder may spatially derive one of the L0 motion information and the L1 motion information based on the reconstructed neighboring block and the other temporally derive the other one based on the collocated block.

도 13을 참조하면, L0 움직임 정보 설정부(1310)는 L0 움직임 정보를 설정할 수 있다. 이 때, 부호화기 및 복호화기는 복원된 주변 블록을 기반으로 공간적으로 도출된 움직임 정보(공간적 움직임 정보)를 L0 움직임 정보로 사용하거나, 또는 콜 블록을 기반으로 시간적으로 도출된 움직임 정보(시간적 움직임 정보)를 L0 움직임 정보로 사용할 수 있다. 즉, 상기 L0 움직임 정보는 복원된 주변 블록을 기반으로 공간적으로 도출되거나, 또는 콜 블록을 기반으로 시간적으로 도출될 수 있다.Referring to FIG. 13 , the L0 motion information setting unit 1310 may set L0 motion information. In this case, the encoder and the decoder use motion information (spatial motion information) spatially derived based on the reconstructed neighboring block as the L0 motion information, or motion information derived temporally based on the collocated block (temporal motion information) may be used as L0 motion information. That is, the L0 motion information may be spatially derived based on the reconstructed neighboring block or temporally based on the collocated block.

다시 도 13을 참조하면, L1 움직임 정보 설정부(1320)는 L1 움직임 정보를 설정할 수 있다. 이 때, 부호화기 및 복호화기는 복원된 주변 블록을 기반으로 공간적으로 도출된 움직임 정보(공간적 움직임 정보)를 L1 움직임 정보로 사용하거나, 또는 콜 블록을 기반으로 시간적으로 도출된 움직임 정보(시간적 움직임 정보)를 L1 움직임 정보로 사용할 수 있다. 즉, 상기 L1 움직임 정보는 복원된 주변 블록을 기반으로 공간적으로 도출되거나, 또는 콜 블록을 기반으로 시간적으로 도출될 수 있다. Referring back to FIG. 13 , the L1 motion information setting unit 1320 may set L1 motion information. At this time, the encoder and the decoder use motion information (spatial motion information) spatially derived based on the reconstructed neighboring block as L1 motion information, or motion information derived temporally based on the collocated block (temporal motion information) may be used as L1 motion information. That is, the L1 motion information may be spatially derived based on a reconstructed neighboring block or temporally based on a collocated block.

L0 움직임 정보 및 L1 움직임 정보를 설정하는 방법의 구체적인 실시예는 도 12에서 상술한 바 있으므로, 여기서는 생략하기로 한다.A specific embodiment of a method of setting the L0 motion information and the L1 motion information has been described above with reference to FIG. 12, and thus will be omitted herein.

다시 도 13을 참조하면, 움직임 정보 통합부(1330)는 L0 움직임 정보 설정부(1310)에서 설정된 L0 움직임 정보 및 L1 움직임 정보 설정부(1320)에서 설정된 L1 움직임 정보를 통합함으로써, 현재 블록의 움직임 정보를 도출할 수 있다.Referring back to FIG. 13 , the motion information integrator 1330 integrates the L0 motion information set by the L0 motion information setting unit 1310 and the L1 motion information set by the L1 motion information setting unit 1320 , thereby moving the current block. information can be derived.

도 14는 본 발명에 따른 현재 블록의 시간적 움직임 정보 도출 방법의 또 다른 실시예를 개략적으로 나타내는 흐름도이다.14 is a flowchart schematically illustrating another embodiment of a method for deriving temporal motion information of a current block according to the present invention.

후술되는 실시예들은 시간적 움직임 정보를 중심으로 서술되지만 본 발명은 이에 한정되는 것은 아니다. 예를 들어, 도 14의 실시예에 따른 방법들은 머지 모드 및/또는 AMVP 모드에서의 시간적 움직임 정보뿐만 아니라, 머지 모드에서 머지 후보 리스트를 기반으로 도출된 현재 블록의 움직임 정보 및/또는 AMVP 모드에서 예측 움직임 벡터 후보 리스트를 기반으로 도출된 현재 블록의 움직임 정보에도 동일하거나 유사한 방식으로 적용될 수 있다.Embodiments to be described below will be described based on temporal motion information, but the present invention is not limited thereto. For example, the methods according to the embodiment of FIG. 14 include not only temporal motion information in the merge mode and/or AMVP mode, but also motion information of a current block derived based on the merge candidate list in the merge mode and/or in the AMVP mode. The same or similar method may be applied to motion information of the current block derived based on the prediction motion vector candidate list.

상술한 바와 같이, 시간적 움직임 정보는 이미 복원된 콜 픽쳐 내에서 현재 블록에 대응하는 콜 블록의 움직임 정보를 기반으로 도출될 수 있다. 여기서, 상기 콜 픽쳐는 일례로 참조 픽쳐 리스트에 포함된 참조 픽쳐 중에서 하나의 픽쳐에 해당될 수 있다. 부호화기 및 복호화기는, 콜 픽쳐 내에서 현재 블록과 공간적으로 동일한 위치에 존재하는 블록을 기준으로 소정의 상대적인 위치를 결정할 수 있고, 상기 결정된 소정의 상대적인 위치(예를 들어, 상기 현재 블록과 공간적으로 동일한 위치에 존재하는 블록의 내부 및/또는 외부의 위치)를 기반으로 상기 콜 블록을 도출할 수 있다. 콜 블록을 기반으로 도출되는 시간적 움직임 정보는 예측 방향 정보, L0 참조 픽쳐 번호, L1 참조 픽쳐 번호, L0 움직임 벡터 및 L1 움직임 벡터 등을 포함할 수 있다.As described above, the temporal motion information may be derived based on the motion information of the collocated block corresponding to the current block in the already reconstructed collocated picture. Here, the collocated picture may correspond to, for example, one picture among reference pictures included in the reference picture list. The encoder and the decoder may determine a predetermined relative position based on a block existing at the same spatial position as the current block in the collocated picture, and the determined relative position (eg, spatially identical to the current block). The collocated block may be derived based on the position inside and/or outside the block existing in the position). The temporal motion information derived based on the collocated block may include prediction direction information, L0 reference picture number, L1 reference picture number, L0 motion vector, L1 motion vector, and the like.

도 14를 참조하면, 부호화기 및 복호화기는 콜 블록을 기반으로 도출된 시간적 움직임 정보에서 L0 시간적 움직임 정보와 L1 시간적 움직임 정보가 동일한지 여부, 즉 L0 참조 픽쳐 번호와 L1 참조 픽쳐 번호가 동일하고 L0 움직임 벡터와 L1 움직임 벡터가 동일한지 여부를 판단할 수 있다(S1410).Referring to FIG. 14 , the encoder and the decoder determine whether L0 temporal motion information and L1 temporal motion information are the same in the temporal motion information derived based on the collocated block, that is, the L0 reference picture number and the L1 reference picture number are the same and the L0 motion information is the same. It may be determined whether the vector and the L1 motion vector are the same (S1410).

이하, 후술되는 도 14 내지 도 15의 실시예에 한하여, 설명의 편의상 시간적 움직임 정보 재설정 전 S1410 단계로 입력되는 시간적 움직임 정보는 입력 시간적 움직임 정보(L0 입력 시간적 움직임 정보, L1 입력 시간적 움직임 정보)라 한다. 이 때, 상기 입력 시간적 움직임 정보는 콜 블록을 기반으로 도출된 시간적 움직임 정보에 해당될 수 있다. 또한 입력 시간적 움직임 정보에 포함된 움직임 벡터는 입력 움직임 벡터(L0 입력 움직임 벡터, L1 입력 움직임 벡터), 입력 시간적 움직임 정보에 포함된 참조 픽쳐 인덱스는 입력 참조 픽쳐 인덱스(L0 입력 참조 픽쳐 인덱스, L1 입력 참조 픽쳐 인덱스), 입력 시간적 움직임 정보에 포함된 참조 픽쳐 번호는 입력 참조 픽쳐 번호(L0 입력 참조 픽쳐 번호, L1 입력 참조 픽쳐 번호)라 한다. 또한, 후술되는 실시예에서 L0 입력 참조 픽쳐 번호가 지시하는 참조 픽쳐는 L0 참조 픽쳐, L1 입력 참조 픽쳐 번호가 지시하는 참조 픽쳐는 L1 참조 픽쳐라 한다.Hereinafter, only for the embodiments of FIGS. 14 to 15, which will be described later, for convenience of explanation, the temporal motion information input to step S1410 before resetting the temporal motion information is input temporal motion information (L0 input temporal motion information, L1 input temporal motion information). do. In this case, the input temporal motion information may correspond to temporal motion information derived based on the collocated block. In addition, the motion vector included in the input temporal motion information is an input motion vector (L0 input motion vector, L1 input motion vector), and the reference picture index included in the input temporal motion information is an input reference picture index (L0 input reference picture index, L1 input). A reference picture index) and a reference picture number included in the input temporal motion information are referred to as an input reference picture number (L0 input reference picture number, L1 input reference picture number). In addition, in an embodiment to be described later, the reference picture indicated by the L0 input reference picture number is referred to as an L0 reference picture, and the reference picture indicated by the L1 input reference picture number is referred to as an L1 reference picture.

L0 시간적 움직임 정보와 L1 시간적 움직임 정보가 동일하지 않은 경우, 즉 L0 참조 픽쳐 번호와 L1 참조 픽쳐 번호가 동일하지 않거나 및/또는 L0 움직임 벡터와 L1 입력 움직임 벡터가 동일하지 않은 경우, 부호화기 및 복호화기는 콜 블록을 기반으로 도출된 입력 시간적 움직임 정보를 그대로 현재 블록의 최종 시간적 움직임 정보로 사용할 수 있다. AMVP가 적용되는 경우, 상기 최종 시간적 움직임 정보는 현재 블록의 예측 움직임 벡터 후보로 결정되거나 등록될 수 있다. 또한, 머지가 적용되는 경우, 상기 최종 시간적 움직임 정보는 현재 블록의 머지 후보로 결정되거나 등록될 수 있다. When the L0 temporal motion information and the L1 temporal motion information are not the same, that is, the L0 reference picture number and the L1 reference picture number are not the same and/or the L0 motion vector and the L1 input motion vector are not the same, the encoder and the decoder The input temporal motion information derived based on the collocated block may be used as the final temporal motion information of the current block as it is. When AMVP is applied, the final temporal motion information may be determined or registered as a prediction motion vector candidate of the current block. Also, when merge is applied, the final temporal motion information may be determined or registered as a merge candidate of the current block.

L0 입력 시간적 움직임 정보와 L1 입력 시간적 움직임 정보가 동일한 경우, 부호화기 및 복호화기는 L1 참조 픽쳐에서 최종 L1 시간적 움직임 정보로 사용될 움직임 정보를 탐색하거나 도출할 수 있다(S1420). 여기서, L0 입력 시간적 움직임 정보와 L1 입력 시간적 움직임 정보가 서로 동일하므로, L1 참조 픽쳐는 L0 참조 픽쳐와 동일한 픽쳐에 해당될 수 있다. 따라서, 후술되는 실시예에서 L1 참조 픽쳐는 L0 참조 픽쳐와 동일한 픽쳐를 의미할 수 있다.When the L0 input temporal motion information and the L1 input temporal motion information are the same, the encoder and the decoder may search for or derive motion information to be used as the final L1 temporal motion information in the L1 reference picture (S1420). Here, since the L0 input temporal motion information and the L1 input temporal motion information are identical to each other, the L1 reference picture may correspond to the same picture as the L0 reference picture. Accordingly, in an embodiment to be described later, the L1 reference picture may mean the same picture as the L0 reference picture.

일례로 부호화기 및 복호화기는 동일한 방법으로 L1 참조 픽쳐에서 움직임 정보를 탐색하여 도출할 수 있다. 이 때, 부호화기는 L1 참조 픽쳐에서 도출된 움직임 정보를 복호화기로 전송하지 않을 수 있다. 다른 예로 부호화기는 소정의 방법에 의해 L1 참조 픽쳐에서 움직임 정보를 도출한 후, 도출된 움직임 정보를 비트스트림에 포함시켜 복호화기로 전송할 수 있다. 이 때, 복호화기는 전송된 움직임 정보를 기반으로 최종 L1 시간적 움직임 정보로 사용될 움직임 정보를 결정할 수 있다. 부호화기에서 도출된 움직임 정보는 참조 픽쳐 인덱스 및 움직임 벡터 등을 포함할 수 있고, 부호화기는 상기 참조 픽쳐 인덱스와 움직임 벡터를 각각 독립적으로 복호화기로 전송할 수 있다. 이 때, 부호화기는 현재 블록의 실제 움직임 벡터 및 L1 참조 픽쳐로부터 도출된 움직임 벡터의 차분 값을 구한 후, 그 차분 값을 복호화기로 전송할 수도 있다. For example, the encoder and the decoder may search and derive motion information from the L1 reference picture in the same way. In this case, the encoder may not transmit the motion information derived from the L1 reference picture to the decoder. As another example, the encoder may derive motion information from the L1 reference picture by a predetermined method, then include the derived motion information in a bitstream and transmit it to the decoder. In this case, the decoder may determine motion information to be used as the final L1 temporal motion information based on the transmitted motion information. The motion information derived from the encoder may include a reference picture index and a motion vector, and the encoder may independently transmit the reference picture index and the motion vector to the decoder. In this case, the encoder may obtain a difference value between the actual motion vector of the current block and the motion vector derived from the L1 reference picture, and then transmit the difference value to the decoder.

다시 도 14를 참조하면, 부호화기 및 복호화기는 L1 참조 픽쳐에서 도출된 움직임 정보를 현재 블록의 최종 L1 시간적 움직임 정보로 사용할 수 있다(S1430). 즉, 이 때 부호화기 및 복호화기는 L1 입력 시간적 움직임 정보 값을 L1 참조 픽쳐에서 도출된 움직임 정보의 값으로 재설정할 수 있다. Referring back to FIG. 14 , the encoder and the decoder may use the motion information derived from the L1 reference picture as the final L1 temporal motion information of the current block ( S1430 ). That is, at this time, the encoder and the decoder may reset the L1 input temporal motion information value to the value of the motion information derived from the L1 reference picture.

이하, L1 참조 픽쳐에서 최종 L1 시간적 움직임 정보로 사용될 움직임 정보를 도출하는 방법의 실시예들이 서술된다.Hereinafter, embodiments of a method of deriving motion information to be used as final L1 temporal motion information from an L1 reference picture will be described.

일 실시예로, 부호화기 및 복호화기는 L1 참조 픽쳐 내에서, L0 입력 시간적 움직임 정보(움직임 벡터)가 지시하는 위치를 중심으로, 소정의 범위 내에 존재하는 위치를 지시하는 움직임 정보를 최종 L1 시간적 움직임 정보(L1 움직임 벡터)로 사용할 수 있다. 구체적으로, 상기 소정의 범위는 L1 참조 픽쳐 내에서 L0 입력 시간적 움직임 정보가 지시하는 위치를 중심으로, 수직 및/또는 수평 방향으로 +T 및/또는 -T 거리 이내의 위치를 포함하는 범위에 해당될 수 있다. 여기서, 일례로 T는 1/4 픽셀 단위의 거리를 나타내는 값일 수 있고, 다른 예로 T는 1/2 픽셀 단위의 거리를 나타내는 값일 수 있다. 또 다른 예로, T는 정수 픽셀 단위의 거리를 나타내는 값일 수도 있다. 정수 픽셀 단위가 사용되는 경우에는, 움직임 보상 시에 보간(interpolation) 과정이 수행되지 않을 수 있으므로, 계산 복잡도가 감소될 수 있다.In an embodiment, the encoder and the decoder generate motion information indicating a position within a predetermined range with respect to a position indicated by the L0 input temporal motion information (motion vector) in the L1 reference picture, and finally L1 temporal motion information. (L1 motion vector) can be used. Specifically, the predetermined range corresponds to a range including a position within a distance of +T and/or -T in the vertical and/or horizontal direction with respect to the position indicated by the L0 input temporal motion information in the L1 reference picture. can be Here, as an example, T may be a value indicating a distance in units of 1/4 pixels, and as another example, T may be a value indicating a distance in units of 1/2 pixels. As another example, T may be a value indicating a distance in units of integer pixels. When an integer pixel unit is used, since an interpolation process may not be performed during motion compensation, calculation complexity may be reduced.

다른 예로, 부호화기는 L1 참조 픽쳐 내에서, 현재 블록에 대응하는 입력 블록(원본 블록)과 가장 잘 매칭되거나 유사한 영역을 도출할 수 있다. 이 때, 부호화기는 상기 도출된 영역을 기반으로 현재 블록의 최종 L1 시간적 움직임 정보로 사용될 움직임 정보를 도출할 수 있다. 일례로, 부호화기는 상기 도출된 영역에 해당되는 블록의 위치 및 현재 블록의 위치를 기반으로 최종 L1 시간적 움직임 정보로 사용될 움직임 벡터를 도출할 수 있고, 상기 도출된 영역에 해당되는 블록을 기반으로 최종 L1 시간적 움직임 정보로 사용될 참조 픽쳐 인덱스(및/또는 참조 픽쳐 번호)를 도출할 수 있다. 도출된 움직임 정보는 비트스트림에 포함되어 부호화기로부터 복호화기로 전송될 수 있다. 이 때, 복호화기는 전송된 움직임 정보를 기반으로 L1 입력 시간적 움직임 정보를 재설정할 수 있다.As another example, the encoder may derive a region that best matches or is similar to an input block (original block) corresponding to the current block in the L1 reference picture. In this case, the encoder may derive motion information to be used as the final L1 temporal motion information of the current block based on the derived region. For example, the encoder may derive a motion vector to be used as the final L1 temporal motion information based on the position of the current block and the position of the block corresponding to the derived region, and based on the block corresponding to the derived region, the final A reference picture index (and/or reference picture number) to be used as the L1 temporal motion information may be derived. The derived motion information may be included in the bitstream and transmitted from the encoder to the decoder. In this case, the decoder may reset the L1 input temporal motion information based on the transmitted motion information.

L1 참조 픽쳐에서 도출된 참조 픽쳐 인덱스(및/또는 참조 픽쳐 번호)는 L1 입력 참조 픽쳐 인덱스(및/또는 L1 입력 참조 픽쳐 번호)와 다를 수도 있다. 이 경우, 부호화기 및 복호화기는 L1 참조 픽쳐에서 도출된 참조 픽쳐 인덱스(및/또는 참조 픽쳐 번호)를 현재 블록의 최종 L1 시간적 움직임 정보로 사용할 수 있다.The reference picture index (and/or reference picture number) derived from the L1 reference picture may be different from the L1 input reference picture index (and/or the L1 input reference picture number). In this case, the encoder and the decoder may use the reference picture index (and/or reference picture number) derived from the L1 reference picture as the final L1 temporal motion information of the current block.

L1 참조 픽쳐를 기반으로 최종 L1 시간적 움직임 정보로 사용될 움직임 정보를 도출하는 방법은 상술한 실시예에 한정되지 않으며, 부호화기 및 복호화기는 구현 및/또는 필요에 따라 다른 방식으로 움직임 정보를 도출할 수도 있다.A method of deriving motion information to be used as the final L1 temporal motion information based on the L1 reference picture is not limited to the above-described embodiment, and the encoder and the decoder may derive the motion information in other ways according to implementation and/or necessity. .

한편, 상술한 실시예에서는 L0 입력 시간적 움직임 정보와 L1 입력 시간적 움직임 정보의 동일성을 기반으로 S1420 내지 S1430 과정의 수행 여부가 결정되지만, 부호화기 및 복호화기는 다른 조건을 기반으로 S1420 내지 S1430 과정의 수행 여부를 결정할 수도 있다.Meanwhile, in the above-described embodiment, it is determined whether to perform the processes S1420 to S1430 based on the sameness of the L0 input temporal motion information and the L1 input temporal motion information, but the encoder and the decoder perform the processes S1420 to S1430 based on different conditions. may decide

일 실시예로, 부호화기 및 복호화기는 콜 블록의 예측 방향을 기반으로 S1420 내지 S1430 과정의 수행 여부를 결정할 수 있다. 상술한 바와 같이, 예측 방향 정보는 예측이 수행되는 블록에 대해 단방향 예측이 적용되는지 또는 양방향 예측이 적용되는지 여부를 지시하는 정보를 의미할 수 있다. 따라서, 상기 예측 방향은 단방향 예측 또는 양방향 예측에 해당될 수 있다. 일례로, 부호화기 및 복호화기는 콜 블록의 움직임 정보(예측 방향)가 양방향 예측이 아닌 단방향 예측인 경우에 S1420 내지 S1430 과정을 수행할 수 있다. 이는 제1 콜 블록의 예측 방향이 단방향 예측인 경우, 결과적으로 제1 콜 블록으로부터 도출되는 입력 시간적 움직임 정보에서, L0 입력 시간적 움직임 정보와 L1 입력 시간적 움직임 정보가 동일할 수 있기 때문이다.As an embodiment, the encoder and the decoder may determine whether to perform steps S1420 to S1430 based on the prediction direction of the collocated block. As described above, the prediction direction information may refer to information indicating whether unidirectional prediction or bidirectional prediction is applied to a block on which prediction is performed. Accordingly, the prediction direction may correspond to unidirectional prediction or bidirectional prediction. For example, when the motion information (prediction direction) of the collocated block is unidirectional prediction rather than bidirectional prediction, the encoder and the decoder may perform processes S1420 to S1430. This is because, in the case where the prediction direction of the first collocated block is unidirectional prediction, as a result, in the input temporal motion information derived from the first collocated block, the L0 input temporal motion information and the L1 input temporal motion information may be the same.

다른 실시예로, 부호화기 및 복호화기는 콜 블록에 움직임 정보가 존재하는지 여부에 관한 정보를 기반으로 S1420 내지 S1430 과정의 수행 여부를 결정할 수도 있다. 일례로, 부호화기 및 복호화기는 콜 블록에 움직임 정보가 존재하지 않는 경우에 S1420 내지 S1430 과정을 수행할 수 있다. 이 경우, 상술한 S1430 단계에서는 L1 입력 시간적 움직임 정보가 아닌 L0 입력 시간적 움직임 정보가 재설정될 수 있다. 즉, 부호화기 및 복호화기는 L0 입력 시간적 움직임 정보를 L1 참조 픽쳐의 움직임 정보로 재설정할 수 있으며, 현재 블록에 대해 양방향 예측이 아닌 단방향 예측을 수행할 수 있다. 또한, 콜 블록에 움직임 정보가 존재하지 않는 경우, 상술한 S1430 단계에서 부호화기 및 복호화기는 L0 입력 시간적 움직임 정보와 L1 입력 시간적 움직임 정보를 모두 재설정할 수도 있다. 즉, 부호화기 및 복호화기는 L0 입력 시간적 움직임 정보 및 L1 입력 시간적 움직임 정보를 모두 L1 참조 픽쳐의 움직임 정보로 재설정할 수 있으며, 현재 블록에 대해 양방향 예측을 수행할 수도 있다.As another embodiment, the encoder and the decoder may determine whether to perform steps S1420 to S1430 based on information on whether motion information exists in the collocated block. For example, the encoder and the decoder may perform operations S1420 to S1430 when motion information does not exist in the collocated block. In this case, in step S1430 described above, the L0 input temporal motion information, not the L1 input temporal motion information, may be reset. That is, the encoder and the decoder may reset the L0 input temporal motion information to the motion information of the L1 reference picture, and may perform unidirectional prediction instead of bidirectional prediction on the current block. Also, when there is no motion information in the collocated block, the encoder and the decoder may reset both the L0 input temporal motion information and the L1 input temporal motion information in step S1430. That is, the encoder and the decoder may reset both the L0 input temporal motion information and the L1 input temporal motion information to the motion information of the L1 reference picture, and may perform bidirectional prediction on the current block.

또 다른 실시예로, 부호화기 및 복호화기는 콜 블록의 움직임 정보에서 L0 움직임 벡터 및/또는 L1 움직임 벡터가 영 벡터(0,0)에 해당되는 경우에 S1420 내지 S1430 과정을 수행할 수도 있다. 이 경우, 상술한 S1430 단계에서 부호화기 및 복호화기는 영 벡터(0,0)에 해당되는 움직임 벡터(들)를 재설정할 수 있다. 일례로, 상기 영 벡터(0,0)에 해당되는 움직임 벡터(들)는 L1 참조 픽쳐의 움직임 벡터로 설정될 수 있고, 다른 예로, 상기 영 벡터(0,0)에 해당되는 움직임 벡터(들)는 복원된 주변 블록의 움직임 벡터로 설정될 수도 있으며, 또 다른 예로, 상기 영 벡터(0,0)에 해당되는 움직임 벡터(들)는 콜 블록의 주변에 위치한 블록의 움직임 벡터로 설정될 수도 있다. 또 다른 실시예로, 부호화기 및 복호화기는 콜 블록의 움직임 정보에서 L0 움직임 벡터 및/또는 L1 움직임 벡터가 영 벡터(0,0)에 해당되지 않는 경우에 S1420 내지 S1430 과정을 수행할 수도 있다. 이 경우, 상술한 S1430 단계에서 부호화기 및 복호화기는 영 벡터(0,0)에 해당되지 않는 움직임 벡터(들)을 재설정할 수 있으며, 상기 영 벡터(0,0)에 해당되지 않는 움직임 벡터(들)은 L1 참조 픽쳐의 움직임 벡터로 재설정될 수 있다.As another embodiment, the encoder and the decoder may perform steps S1420 to S1430 when the L0 motion vector and/or the L1 motion vector in the motion information of the collocated block corresponds to a zero vector (0,0). In this case, in step S1430 described above, the encoder and the decoder may reset the motion vector(s) corresponding to the zero vector (0,0). As an example, the motion vector(s) corresponding to the zero vector (0,0) may be set as the motion vector of the L1 reference picture, and as another example, the motion vector(s) corresponding to the zero vector (0,0) ) may be set as a motion vector of a reconstructed neighboring block, and as another example, the motion vector(s) corresponding to the zero vector (0,0) may be set as a motion vector of a block located near the collocated block. have. As another embodiment, the encoder and the decoder may perform steps S1420 to S1430 when the L0 motion vector and/or the L1 motion vector in the motion information of the collocated block do not correspond to the zero vector (0,0). In this case, in step S1430, the encoder and the decoder may reset motion vector(s) that do not correspond to the zero vector (0,0), and the motion vector(s) that do not correspond to the zero vector (0,0) ) may be reset to the motion vector of the L1 reference picture.

S1420 내지 S1430 과정의 수행 여부가 결정되는 조건은 상술한 실시예에 한정되지 않으며, 조건 및/또는 필요에 따라 다양한 조건이 적용될 수 있다.Conditions for determining whether to perform processes S1420 to S1430 are not limited to the above-described embodiments, and various conditions may be applied according to conditions and/or needs.

한편, L1 참조 픽쳐에서 도출되는 움직임 정보는 현재 블록의 L0 입력 시간적 움직임 정보와 동일할 수도 있다. 따라서, 부호화기 및 복호화기는 L1 참조 픽쳐에서 현재 블록의 최종 L1 시간적 움직임 정보로 사용될 움직임 정보를 탐색할 때, L0 입력 시간적 움직임 정보와 동일하지 않은 움직임 정보만을 찾을 수도 있다. 예를 들어, S1430에서와 같이, L1 참조 픽쳐를 기반으로 현재 블록의 최종 L1 시간적 움직임 정보를 도출하는 경우, 부호화기 및 복호화기는 현재 블록의 L0 입력 시간적 움직임 정보와 다른 움직임 정보만을 최종 L1 시간적 움직임 정보로 사용할 수 있다. 이 때, 부호화기 및 복호화기는 현재 블록의 L0 입력 시간적 움직임 정보와의 차이가 소정의 임계값(threshold) 이하인 움직임 정보만을, 최종 L1 시간적 움직임 정보로 사용될 움직임 정보로 선택할 수도 있다. 여기서, 상기 소정의 임계값은 현재 블록의 모드 정보, 현재 블록의 움직임 정보, 주변 블록의 모드 정보 및/또는 주변 블록의 움직임 정보 등을 기반으로 정해질 수 있으며, 다양한 방식으로 결정될 수 있다.Meanwhile, the motion information derived from the L1 reference picture may be the same as the L0 input temporal motion information of the current block. Accordingly, when searching for motion information to be used as the final L1 temporal motion information of the current block in the L1 reference picture, the encoder and the decoder may find only motion information that is not the same as the L0 input temporal motion information. For example, as in S1430, when the final L1 temporal motion information of the current block is derived based on the L1 reference picture, the encoder and the decoder only use motion information different from the L0 input temporal motion information of the current block. The final L1 temporal motion information can be used as In this case, the encoder and the decoder may select only motion information whose difference from the L0 input temporal motion information of the current block is less than or equal to a predetermined threshold as motion information to be used as the final L1 temporal motion information. Here, the predetermined threshold value may be determined based on mode information of the current block, motion information of the current block, mode information of the neighboring block, and/or motion information of the neighboring block, and may be determined in various ways.

상술한 실시예에서 S1410 단계로 입력되는 입력 시간적 움직임 정보는 입력 움직임 벡터뿐만 아니라 입력 참조 픽쳐 인덱스도 포함할 수 있다. 여기서, L0 입력 움직임 벡터 및 L1 입력 움직임 벡터는 상술한 바와 같이 콜 블록을 기반으로 시간적으로 도출된 움직임 벡터일 수 있고, L0 입력 참조 픽쳐 인덱스 및 L1 입력 참조 픽쳐 인덱스는 복원된 주변 블록으로부터 공간적으로 도출된 참조 픽쳐 인덱스일 수 있다. 이 때, L0 입력 참조 픽쳐 인덱스 및 L1 입력 참조 픽쳐 인덱스는, 복원된 주변 블록의 참조 픽쳐 인덱스 중에서 음수가 아닌 가장 작은 값으로 설정될 수 있다. 한편, 다른 예로 L0 입력 참조 픽쳐 인덱스 및 L1 입력 참조 픽쳐 인덱스는 복원된 주변 블록의 움직임 정보에 관계 없이 0으로 설정될 수도 있다.In the above-described embodiment, the input temporal motion information input in step S1410 may include not only the input motion vector but also the input reference picture index. Here, the L0 input motion vector and the L1 input motion vector may be motion vectors temporally derived based on the collocated block as described above, and the L0 input reference picture index and the L1 input reference picture index are spatially derived from the reconstructed neighboring block. It may be a derived reference picture index. In this case, the L0 input reference picture index and the L1 input reference picture index may be set to the smallest non-negative value among the reference picture indexes of the reconstructed neighboring blocks. Meanwhile, as another example, the L0 input reference picture index and the L1 input reference picture index may be set to 0 regardless of the motion information of the reconstructed neighboring blocks.

L1 입력 움직임 벡터가 L1 참조 픽쳐를 기반으로 재설정되는 경우, 입력 참조 픽쳐 인덱스에 대해서도 재설정 과정이 수행될 수 있다. 일례로, 입력 참조 픽쳐 인덱스는 상술한 바와 같이 L1 참조 픽쳐로부터 도출된 참조 픽쳐 인덱스를 기반으로 재설정될 수 있다. 다른 예로, L0 입력 시간적 움직임 정보(예를 들어, L0 입력 움직임 벡터, L0 입력 참조 픽쳐 인덱스 등) 와 L1 입력 시간적 움직임 정보(예를 들어, L1 입력 움직임 벡터, L1 입력 참조 픽쳐 인덱스 등)가 동일한 경우, 부호화기 및 복호화기는 L0 입력 참조 픽쳐 인덱스 및 L1 입력 참조 픽쳐 인덱스를 모두 0의 값으로 재설정하여 최종 시간적 움직임 정보로 사용할 수도 있다. 이는, L0 입력 시간적 움직임 정보와 L1 입력 시간적 움직임 정보가 동일한 경우, L0 참조 픽쳐 인덱스 및 L1 참조 픽쳐 인덱스가 모두 0일 확률이 높기 때문이다.When the L1 input motion vector is reset based on the L1 reference picture, a reset process may also be performed on the input reference picture index. As an example, the input reference picture index may be reset based on the reference picture index derived from the L1 reference picture as described above. As another example, L0 input temporal motion information (eg, L0 input motion vector, L0 input reference picture index, etc.) and L1 input temporal motion information (eg, L1 input motion vector, L1 input reference picture index, etc.) are the same In this case, the encoder and the decoder may reset both the L0 input reference picture index and the L1 input reference picture index to a value of 0 to use as final temporal motion information. This is because, when the L0 input temporal motion information and the L1 input temporal motion information are the same, there is a high probability that both the L0 reference picture index and the L1 reference picture index are 0.

한편, 상술한 바와 같이 부호화기 및 복호화기는 L1 입력 움직임 벡터 값을 L1 참조 픽쳐의 움직임 벡터와 동일한 값으로 재설정함으로써 최종 L1 시간적 움직임 벡터를 도출할 수 있다. 이 때, 상기 L1 참조 픽쳐의 움직임 벡터는 L1 입력 참조 픽쳐 인덱스 및/또는 재설정된 L1 참조 픽쳐 인덱스에 따라 스케일링되어 사용될 수도 있다. L1 입력 참조 픽쳐 인덱스는 재설정 과정 없이 그대로 최종 L1 참조 픽쳐 인덱스로 사용될 수도 있고, 상술한 실시예에서와 같이 재설정 과정을 거쳐 최종 L1 참조 픽쳐 인덱스로 사용될 수도 있다. 이 때, L1 참조 픽쳐의 움직임 벡터에 대응하는 참조 픽쳐, 및 최종 L1 참조 픽쳐 인덱스가 지시하는 참조 픽쳐는 서로 다를 수 있다. 이 경우, 부호화기 및 복호화기는 L1 참조 픽쳐의 움직임 벡터에 대한 스케일링을 수행하고 상기 스케일링된 움직임 벡터를 현재 블록의 최종 L1 시간적 움직임 벡터로 사용할 수 있다.Meanwhile, as described above, the encoder and the decoder may derive the final L1 temporal motion vector by resetting the L1 input motion vector value to the same value as the motion vector of the L1 reference picture. In this case, the motion vector of the L1 reference picture may be scaled and used according to the L1 input reference picture index and/or the reset L1 reference picture index. The L1 input reference picture index may be used as the final L1 reference picture index as it is without a reset process, or may be used as the final L1 reference picture index through the reset process as in the above-described embodiment. In this case, the reference picture corresponding to the motion vector of the L1 reference picture and the reference picture indicated by the final L1 reference picture index may be different from each other. In this case, the encoder and the decoder may perform scaling on the motion vector of the L1 reference picture and use the scaled motion vector as the final L1 temporal motion vector of the current block.

또한 상술한 실시예들에서, 재설정된 L1 시간적 움직임 정보는 현재 블록의 L0 시간적 움직임 정보와 동일할 수 있다. 따라서, 재설정된 L1 시간적 움직임 정보가 현재 블록의 L0 시간적 움직임 정보와 동일한 경우, 부호화기 및 복호화기는 현재 블록의 예측 방향 정보를 단방향 예측으로 다시 설정할 수도 있다. 이 때, 부호화기 및 복호화기는 L0 시간적 움직임 정보만을 현재 블록의 시간적 움직임 정보로 사용할 수 있다. 이러한 방법은 상술한 실시예들과 결합된 조합으로서 본 발명에 적용될 수 있다.Also, in the above-described embodiments, the reset L1 temporal motion information may be the same as the L0 temporal motion information of the current block. Accordingly, when the reset L1 temporal motion information is the same as the L0 temporal motion information of the current block, the encoder and the decoder may reset the prediction direction information of the current block to unidirectional prediction. In this case, the encoder and the decoder may use only the L0 temporal motion information as the temporal motion information of the current block. This method can be applied to the present invention in combination with the above-described embodiments.

*도 15는 도 14의 실시예에 따른 시간적 움직임 정보 도출 과정을 수행할 수 있는 인터 예측 장치의 일 실시예를 개략적으로 나타내는 블록도이다. 도 15의 실시예에 따른 인터 예측 장치는 시간적 움직임 정보 판단부(1510), 움직임 예측부(1520) 및 L1 시간적 움직임 정보 재설정부(1530)를 포함할 수 있다.* FIG. 15 is a block diagram schematically illustrating an embodiment of an inter prediction apparatus capable of performing a process of deriving temporal motion information according to the embodiment of FIG. 14 . The inter prediction apparatus according to the embodiment of FIG. 15 may include a temporal motion information determiner 1510 , a motion predictor 1520 , and an L1 temporal motion information resetter 1530 .

상술한 바와 같이, 시간적 움직임 정보는 이미 복원된 콜 픽쳐 내에서 현재 블록에 대응하는 콜 블록의 움직임 정보를 기반으로 도출될 수 있다. 여기서, 상기 콜 픽쳐는 일례로 참조 픽쳐 리스트에 포함된 참조 픽쳐 중에서 하나의 픽쳐에 해당될 수 있다. 부호화기 및 복호화기는, 콜 픽쳐 내에서 현재 블록과 공간적으로 동일한 위치에 존재하는 블록을 기준으로 소정의 상대적인 위치를 결정할 수 있고, 상기 결정된 소정의 상대적인 위치(예를 들어, 상기 현재 블록과 공간적으로 동일한 위치에 존재하는 블록의 내부 및/또는 외부의 위치)를 기반으로 상기 콜 블록을 도출할 수 있다. 콜 블록을 기반으로 도출되는 시간적 움직임 정보는 예측 방향 정보, L0 참조 픽쳐 번호, L1 참조 픽쳐 번호, L0 움직임 벡터 및 L1 움직임 벡터 등을 포함할 수 있다.As described above, the temporal motion information may be derived based on the motion information of the collocated block corresponding to the current block in the already reconstructed collocated picture. Here, the collocated picture may correspond to, for example, one picture among reference pictures included in the reference picture list. The encoder and the decoder may determine a predetermined relative position based on a block existing at the same spatial position as the current block in the collocated picture, and the determined relative position (eg, spatially identical to the current block). The collocated block may be derived based on the position inside and/or outside the block existing in the position). The temporal motion information derived based on the collocated block may include prediction direction information, L0 reference picture number, L1 reference picture number, L0 motion vector, L1 motion vector, and the like.

도 15를 참조하면, 도 11을 참조하면, 시간적 움직임 정보 판단부(1510)는 입력 시간적 움직임 정보에서 L0 입력 시간적 움직임 정보와 L1 입력 시간적 움직임 정보가 동일한지 여부, 즉 L0 입력 참조 픽쳐 번호와 L1 입력 참조 픽쳐 번호가 동일하고 L0 입력 움직임 벡터와 L1 입력 움직임 벡터가 동일한지 여부를 판단할 수 있다. Referring to FIG. 15 , referring to FIG. 11 , the temporal motion information determining unit 1510 determines whether the L0 input temporal motion information and the L1 input temporal motion information are the same in the input temporal motion information, that is, the L0 input reference picture number and L1. It may be determined whether the input reference picture numbers are the same and the L0 input motion vector and the L1 input motion vector are the same.

L0 입력 시간적 움직임 정보와 L1 입력 시간적 움직임 정보가 동일하지 않은 경우, 인터 예측 장치는 입력 시간적 움직임 정보를 그대로 현재 블록의 시간적 움직임 정보로 사용할 수 있다. AMVP가 적용되는 경우, 상기 현재 블록의 시간적 움직임 정보는 현재 블록에 대한 예측 움직임 벡터 후보로 결정되거나 등록될 수 있다. 또한, 머지가 적용되는 경우, 상기 현재 블록의 시간적 움직임 정보는 현재 블록에 대한 머지 후보로 결정되거나 등록될 수 있다. L0 입력 시간적 움직임 정보와 L1 입력 시간적 움직임 정보가 동일한 경우에는 움직임 예측부(1520)에 의한 프로세스가 수행될 수 있다. When the L0 input temporal motion information and the L1 input temporal motion information are not the same, the inter prediction apparatus may use the input temporal motion information as the temporal motion information of the current block as it is. When AMVP is applied, the temporal motion information of the current block may be determined or registered as a prediction motion vector candidate for the current block. Also, when the merge is applied, the temporal motion information of the current block may be determined or registered as a merge candidate for the current block. When the L0 input temporal motion information and the L1 input temporal motion information are the same, a process by the motion predictor 1520 may be performed.

한편, 시간적 움직임 정보 판단부(1510)는 L0 입력 시간적 움직임 정보와 L1 입력 시간적 움직임 정보의 동일성 여부가 아닌, L0 입력 참조 픽쳐 번호 및 L1 입력 참조 픽쳐 번호의 동일성 여부 또는 콜 블록의 예측 방향을 판단할 수도 있다. 예를 들어, L0 입력 참조 픽쳐 번호 및 L1 입력 참조 픽쳐 번호가 동일하지 않은 경우, 입력 시간적 움직임 정보가 그대로 현재 블록의 시간적 움직임 정보로 사용될 수 있고, L0 입력 참조 픽쳐 번호 및 L1 입력 참조 픽쳐 번호가 동일한 경우 움직임 예측부(1520)에 의한 프로세스가 수행될 수 있다. 다른 예로, 콜 블록의 예측 방향이 양방향 예측인 경우, 입력 시간적 움직임 정보가 그대로 현재 블록의 시간적 움직임 정보로 사용될 수 있고, 콜 블록의 예측 방향이 단방향 예측인 경우 움직임 예측부(1520)에 의한 프로세스가 수행될 수도 있다.Meanwhile, the temporal motion information determining unit 1510 determines whether the L0 input reference picture number and the L1 input reference picture number are identical or the prediction direction of the collocated block, not whether the L0 input temporal motion information and the L1 input temporal motion information are identical. You may. For example, if the L0 input reference picture number and the L1 input reference picture number are not the same, the input temporal motion information may be used as the temporal motion information of the current block as it is, and the L0 input reference picture number and the L1 input reference picture number are In the same case, the process by the motion predictor 1520 may be performed. As another example, when the prediction direction of the collocated block is bidirectional prediction, the input temporal motion information may be used as the temporal motion information of the current block as it is, and when the prediction direction of the collocated block is unidirectional prediction, the process by the motion prediction unit 1520 may be performed.

다시 도 15를 참조하면, L0 입력 시간적 움직임 정보와 L1 입력 시간적 움직임 정보가 동일한 경우, 움직임 예측부(1520)는 L1 참조 픽쳐에서 최종 L1 시간적 움직임 정보로 사용될 움직임 정보를 탐색하거나 도출할 수 있다. Referring back to FIG. 15 , when the L0 input temporal motion information and the L1 input temporal motion information are the same, the motion predictor 1520 may search for or derive motion information to be used as the final L1 temporal motion information in the L1 reference picture.

일 실시예로, 움직임 예측부(1520)는 L1 참조 픽쳐 내에서, 현재 블록에 대응하는 입력 블록(원본 블록)과 가장 잘 매칭되거나 유사한 영역을 도출할 수 있다. 이 때, 움직임 예측부(1520)는 상기 도출된 영역을 기반으로 현재 블록의 최종 L1 시간적 움직임 정보로 사용될 움직임 정보를 도출할 수 있다. 일례로, 움직임 예측부(1520)는 상기 도출된 영역에 해당되는 블록의 위치 및 현재 블록의 위치를 기반으로 최종 L1 시간적 움직임 정보로 사용될 움직임 벡터를 도출할 수 있고, 상기 도출된 영역에 해당되는 블록을 기반으로 최종 L1 시간적 움직임 정보로 사용될 참조 픽쳐 인덱스(및/또는 참조 픽쳐 번호)를 도출할 수 있다.As an embodiment, the motion predictor 1520 may derive a region that best matches or is similar to an input block (original block) corresponding to the current block in the L1 reference picture. In this case, the motion predictor 1520 may derive motion information to be used as the final L1 temporal motion information of the current block based on the derived region. For example, the motion predictor 1520 may derive a motion vector to be used as the final L1 temporal motion information based on the position of the block corresponding to the derived region and the position of the current block, and the motion vector corresponding to the derived region may be A reference picture index (and/or reference picture number) to be used as the final L1 temporal motion information may be derived based on the block.

한편, 움직임 예측부(1520)가 부호화기측의 구성 요소에 해당되는 경우, 부호화기는 상기 방법에 의해 L1 참조 픽쳐에서 도출된 움직임 정보를 비트스트림에 포함시켜 복호화기로 전송할 수도 있다. L1 참조 픽쳐에서 도출된 움직임 정보는 참조 픽쳐 인덱스 및 움직임 벡터 등을 포함할 수 있고, 부호화기는 상기 참조 픽쳐 인덱스와 움직임 벡터를 각각 독립적으로 복호화기로 전송할 수 있다. 이 때, 부호화기는 현재 블록의 실제 움직임 벡터 및 L1 참조 픽쳐로부터 도출된 움직임 벡터의 차분 값을 구한 후, 그 차분 값을 복호화기로 전송할 수도 있다. Meanwhile, when the motion predictor 1520 corresponds to a component of the encoder, the encoder may include the motion information derived from the L1 reference picture by the above method in the bitstream and transmit it to the decoder. The motion information derived from the L1 reference picture may include a reference picture index and a motion vector, and the encoder may independently transmit the reference picture index and the motion vector to the decoder. In this case, the encoder may obtain a difference value between the actual motion vector of the current block and the motion vector derived from the L1 reference picture, and then transmit the difference value to the decoder.

이 경우, 복호화기는 전송된 움직임 정보를 기반으로 최종 L1 시간적 움직임 정보로 사용될 움직임 정보를 결정할 수 있다. 즉, 움직임 예측부(1520)가 복호화기측의 구성 요소에 해당되는 경우, 상기 움직임 예측부(1520)는 외부로부터 입력된 움직임 정보(예를 들어, 부호화기로부터 전송된 움직임 정보)를 기반으로, 최종 L1 시간적 움직임 정보로 사용될 움직임 정보를 결정할 수 있다. In this case, the decoder may determine motion information to be used as the final L1 temporal motion information based on the transmitted motion information. That is, when the motion prediction unit 1520 corresponds to a component on the decoder side, the motion prediction unit 1520 determines the final result based on the motion information input from the outside (eg, motion information transmitted from the encoder). Motion information to be used as the L1 temporal motion information may be determined.

다시 도 15를 참조하면, L1 시간적 움직임 정보 재설정부(1530)는 L1 참조 픽쳐에서 도출된 움직임 정보를 현재 블록의 최종 L1 시간적 움직임 정보로 사용할 수 있다. 즉, 이 때 L1 시간적 움직임 정보 재설정부(1530)는 L1 입력 시간적 움직임 정보 값을 움직임 예측부(1520)에 의해 도출된 움직임 정보(L1 참조 픽쳐에서 도출된 움직임 정보)의 값으로 재설정할 수 있다.Referring back to FIG. 15 , the L1 temporal motion information resetter 1530 may use the motion information derived from the L1 reference picture as the final L1 temporal motion information of the current block. That is, at this time, the L1 temporal motion information resetting unit 1530 may reset the L1 input temporal motion information value to the value of the motion information (motion information derived from the L1 reference picture) derived by the motion prediction unit 1520 . .

상술한 도 6 내지 도 15의 실시예들은, 각각 개별적으로 적용될 수도 있으나, 각 블록의 부호화 모드에 따라 다양한 방법으로 조합되어 적용될 수도 있다. 이하, 후술되는 실시예들에서 부호화 모드가 머지 모드인 블록은 머지 블록이라 한다. 머지 블록이 아닌 블록에는, 예를 들어 부호화 모드가 AMVP 모드인 블록 등이 있을 수 있다. 또한, 후술되는 실시예들에서 현재 블록은 경우에 따라 머지 블록 또는 머지 블록이 아닌 블록 중 하나에 해당될 수 있다.The above-described embodiments of FIGS. 6 to 15 may be applied individually, or may be applied in combination in various ways according to the encoding mode of each block. Hereinafter, in embodiments to be described below, a block in which the encoding mode is a merge mode is referred to as a merge block. A block other than the merge block may include, for example, a block in which the encoding mode is the AMVP mode. Also, in embodiments to be described later, the current block may correspond to one of a merge block or a non-merged block in some cases.

일 실시예로, 머지 블록에는 도 6 내지 도 8의 실시예에 따른 시간적 움직임 정보 도출 방법이 적용되고, 머지 블록이 아닌 블록에는 도 12 및 도 13에 따른 움직임 정보 도출 방법이 적용될 수 있다. 이 때, 머지 블록에서는 L0 입력 시간적 움직임 정보와 L1 입력 시간적 움직임 정보가 동일한 경우, 복원된 주변 블록의 움직임 정보가 현재 블록의 최종 L1 시간적 움직임 정보로 사용될 수 있다. 또한, 머지 블록이 아닌 블록에서는, 현재 블록의 L0 움직임 정보 및 현재 블록의 L1 움직임 정보가 각각 독립적으로 설정될 수 있다. 일례로, 현재 블록의 L0 움직임 정보 및 현재 블록의 L1 움직임 정보 중에서 하나는 복원된 주변 블록을 기반으로 공간적으로 도출되고 다른 하나는 콜 블록을 기반으로 시간적으로 도출될 수 있다.As an embodiment, the method for deriving temporal motion information according to the embodiments of FIGS. 6 to 8 may be applied to the merge block, and the method for deriving the motion information according to FIGS. 12 and 13 may be applied to blocks other than the merge block. In this case, when the L0 input temporal motion information and the L1 input temporal motion information are the same in the merge block, the motion information of the reconstructed neighboring block may be used as the final L1 temporal motion information of the current block. Also, in a block other than the merge block, L0 motion information of the current block and L1 motion information of the current block may be independently set. For example, one of the L0 motion information of the current block and the L1 motion information of the current block may be spatially derived based on the reconstructed neighboring block, and the other may be derived temporally based on the collocated block.

다른 실시예로, 머지 블록에는 도 9 내지 도 11의 실시예에 따른 시간적 움직임 정보 도출 방법이 적용되고, 머지 블록이 아닌 블록에는 도 14 및 도 15에 따른 시간적 움직임 정보 도출 방법이 적용될 수 있다. 이 때, 머지 블록에서는 L0 입력 시간적 움직임 정보와 L1 입력 시간적 움직임 정보가 동일한 경우, 입력 시간적 움직임 정보 도출에 사용된 콜 블록이 아닌 새로이 도출된 콜 블록의 움직임 정보가 현재 블록의 최종 L1 시간적 움직임 정보로 사용될 수 있다. 또한, 머지 블록이 아닌 블록에서는, L0 입력 시간적 움직임 정보와 L1 입력 시간적 움직임 정보가 동일한 경우, L1 참조 픽쳐의 움직임 정보가 현재 블록의 최종 L1 시간적 움직임 정보로 사용될 수 있다.In another embodiment, the method for deriving temporal motion information according to the embodiment of FIGS. 9 to 11 may be applied to the merge block, and the method for deriving the temporal motion information according to FIGS. 14 and 15 may be applied to a block other than the merge block. At this time, in the merge block, when the L0 input temporal motion information and the L1 input temporal motion information are the same, the motion information of the newly derived collocated block, not the collocated block used to derive the input temporal motion information, is the final L1 temporal motion information of the current block. can be used as Also, in a block other than the merge block, when the L0 input temporal motion information and the L1 input temporal motion information are the same, the motion information of the L1 reference picture may be used as the final L1 temporal motion information of the current block.

또 다른 실시예로, 머지 블록에는 도 6 내지 8의 실시예에 따른 시간적 움직임 정보 도출 방법이 적용되고, 머지 블록이 아닌 블록에는 도 14 및 도 15에 따른 시간적 움직임 정보 도출 방법이 적용될 수 있다. 이 때, 머지 블록에서는 L0 입력 시간적 움직임 정보와 L1 입력 시간적 움직임 정보가 동일한 경우, 복원된 주변 블록의 움직임 정보가 현재 블록의 최종 L1 시간적 움직임 정보로 사용될 수 있다. 또한, 머지 블록이 아닌 블록에서는, L0 입력 시간적 움직임 정보와 L1 입력 시간적 움직임 정보가 동일한 경우, L1 참조 픽쳐의 움직임 정보가 현재 블록의 최종 L1 시간적 움직임 정보로 사용될 수 있다.As another embodiment, the method for deriving temporal motion information according to the embodiments of FIGS. 6 to 8 may be applied to the merge block, and the method for deriving the temporal motion information according to FIGS. 14 and 15 may be applied to blocks other than the merge block. In this case, when the L0 input temporal motion information and the L1 input temporal motion information are the same in the merge block, the motion information of the reconstructed neighboring block may be used as the final L1 temporal motion information of the current block. Also, in a block other than the merge block, when the L0 input temporal motion information and the L1 input temporal motion information are the same, the motion information of the L1 reference picture may be used as the final L1 temporal motion information of the current block.

도 6 내지 도 15의 실시예들의 조합은 상술한 실시예에 한정되는 것이 아니며, 구현 및/또는 필요에 따라 상술한 실시예들 뿐만 아니라 다양한 형태의 조합이 제공될 수 있다.The combination of the embodiments of FIGS. 6 to 15 is not limited to the above-described embodiment, and various types of combinations may be provided as well as the above-described embodiments according to implementation and/or necessity.

상술한 실시예들에서, 방법들은 일련의 단계 또는 블록으로서 순서도를 기초로 설명되고 있으나, 본 발명은 단계들의 순서에 한정되는 것은 아니며, 어떤 단계는 상술한 바와 다른 단계와 다른 순서로 또는 동시에 발생할 수 있다. 또한, 당해 기술 분야에서 통상의 지식을 가진 자라면 순서도에 나타난 단계들이 배타적이지 않고, 다른 단계가 포함되거나, 순서도의 하나 또는 그 이상의 단계가 본 발명의 범위에 영향을 미치지 않고 삭제될 수 있음을 이해할 수 있을 것이다.In the above-described embodiments, the methods are described on the basis of a flowchart as a series of steps or blocks, but the present invention is not limited to the order of the steps, and some steps may occur in a different order or at the same time as other steps as described above. can In addition, those of ordinary skill in the art will recognize that the steps shown in the flowchart are not exclusive, other steps may be included, or that one or more steps in the flowchart may be deleted without affecting the scope of the present invention. You will understand.

상술한 실시예는 다양한 양태의 예시들을 포함한다. 다양한 양태들을 나타내기 위한 모든 가능한 조합을 기술할 수는 없지만, 해당 기술 분야의 통상의 지식을 가진 자는 다른 조합이 가능함을 인식할 수 있을 것이다. 따라서, 본 발명은 이하의 특허청구범위 내에 속하는 모든 다른 교체, 수정 및 변경을 포함한다고 할 것이다.The above-described embodiments include examples of various aspects. It is not possible to describe every possible combination for representing the various aspects, but one of ordinary skill in the art will recognize that other combinations are possible. Accordingly, it is intended that the present invention cover all other substitutions, modifications and variations falling within the scope of the following claims.

Claims (3)

영상 복호화 방법에 있어서,
현재 블록의 예측 모드를 화면간 예측 모드로 결정하는 단계;
상기 현재 블록의 공간적 주변 블록을 이용하여, 현재 블록의 공간적 움직임 벡터를 도출하는 단계;
콜 픽쳐 정보를 기반으로, 상기 현재 블록의 콜 픽쳐를 결정하는 단계; 여기서, 상기 콜 픽쳐 정보는 참조 픽쳐 리스트 내의 참조 픽쳐들 중에서 상기 현재 블록의 콜 픽쳐로 결정되는 픽쳐를 특정하는 정보임,
상기 콜 픽쳐 내에서 상기 현재 블록에 대응하는 콜 블록의 움직임 벡터를 기반으로 시간적 움직임 벡터를 도출하는 단계; 여기서, 상기 콜 블록은 현재 블록의 우측-하단 픽셀의 위치를 포함하는 제1 블록 또는 상기 현재 블록의 중앙 위치를 포함하는 제2 블록 중 어느 하나에 따라 결정되며,
상기 공간적 움직임 벡터 및 상기 시간적 움직임 벡터를 이용하여 상기 현재 블록에 대한 예측 움직임 벡터 후보 리스트를 생성하는 단계;
상기 예측 움직임 벡터 후보 리스트에 기반하여 상기 현재 블록의 움직임 벡터를 도출하는 단계; 및
상기 도출된 움직임 벡터에 기반하여 상기 현재 블록에 대한 예측 샘플을 획득하는 단계;
상기 현재 블록에 대한 잔차 샘플을 획득하는 단계; 및
상기 현재 블록에 대한 상기 예측 샘플 및 상기 잔차 샘플을 이용하여 상기 현재 블록에 대한 복원 샘플을 획득하는 단계를 포함하되,
상기 콜 픽쳐 정보는 비트스트림을 통해 부호화기로부터 전송되는 것을 특징으로 하는, 영상 복호화 방법.
In the video decoding method,
determining a prediction mode of the current block as an inter prediction mode;
deriving a spatial motion vector of the current block by using the spatially neighboring blocks of the current block;
determining a collocated picture of the current block based on collocated picture information; Here, the collocated picture information is information specifying a picture determined as the collocated picture of the current block from among the reference pictures in the reference picture list,
deriving a temporal motion vector based on a motion vector of a collocated block corresponding to the current block in the collocated picture; Here, the collocated block is determined according to either a first block including the position of the lower right-bottom pixel of the current block or a second block including the center position of the current block,
generating a predicted motion vector candidate list for the current block using the spatial motion vector and the temporal motion vector;
deriving a motion vector of the current block based on the predicted motion vector candidate list; and
obtaining a prediction sample for the current block based on the derived motion vector;
obtaining a residual sample for the current block; and
Comprising the step of obtaining a reconstructed sample for the current block by using the prediction sample and the residual sample for the current block,
The video decoding method, characterized in that the collocated picture information is transmitted from an encoder through a bitstream.
영상 부호화 방법에 있어서,
현재 블록의 예측 모드를 화면간 예측 모드로 결정하는 단계;
상기 현재 블록의 움직임 벡터를 도출하는 단계;
상기 도출된 움직임 벡터에 기반하여 상기 현재 블록에 대해 움직임 보상을 수행함으로써, 상기 현재 블록에 대응하는 예측 샘플을 획득하는 단계;
상기 예측 샘플에 기반하여, 상기 현재 블록에 대한 잔차 샘플을 획득하는 단계;
상기 현재 블록의 공간적 주변 블록을 이용하여, 현재 블록의 공간적 움직임 벡터를 도출하는 단계;
상기 현재 블록의 콜 픽쳐를 결정하는 단계;
상기 콜 픽쳐 내에서 상기 현재 블록에 대응하는 콜 블록의 움직임 벡터를 기반으로 시간적 움직임 벡터를 도출하는 단계; 여기서, 상기 콜 블록은 현재 블록의 우측-하단 픽셀의 위치를 포함하는 제1 블록 또는 상기 현재 블록의 중앙 위치를 포함하는 제2 블록 중 어느 하나에 따라 결정되며,
상기 공간적 움직임 벡터 및 상기 시간적 움직임 벡터를 이용하여 상기 현재 블록에 대한 예측 움직임 벡터 후보 리스트를 생성하는 단계;
상기 예측 샘플과 상기 잔차 샘플을 이용하여 상기 현재 블록에 대한 복원 샘플을 획득하는 단계; 및
상기 콜 픽쳐에 대한 콜 픽쳐 정보를 비트스트림에 부호화하는 단계를 포함하되,
상기 콜 픽쳐 정보는 참조 픽쳐 리스트 내의 참조 픽쳐들 중에서 상기 현재 블록의 콜 픽쳐로 결정되는 픽쳐를 특정하는 정보이며, 상기 비트스트림을 통해 복호화기로 전송되는 것을 특징으로 하는, 영상 부호화 방법.
In the video encoding method,
determining a prediction mode of the current block as an inter prediction mode;
deriving a motion vector of the current block;
obtaining a prediction sample corresponding to the current block by performing motion compensation on the current block based on the derived motion vector;
obtaining a residual sample for the current block based on the prediction sample;
deriving a spatial motion vector of the current block by using the spatially neighboring blocks of the current block;
determining a collocated picture of the current block;
deriving a temporal motion vector based on a motion vector of a collocated block corresponding to the current block in the collocated picture; Here, the collocated block is determined according to either a first block including the position of the lower right-bottom pixel of the current block or a second block including the center position of the current block,
generating a predicted motion vector candidate list for the current block using the spatial motion vector and the temporal motion vector;
obtaining a reconstructed sample for the current block using the prediction sample and the residual sample; and
Coding the collocated picture information for the collocated picture into a bitstream,
The collocated picture information is information specifying a picture determined as the collocated picture of the current block from among reference pictures in a reference picture list, and is transmitted to a decoder through the bitstream.
영상 복호화 방법에 의해 복호화되는 비트스트림을 포함하는 기록 매체에 있어서,
상기 비트스트림은 콜 픽처에 대한 콜 픽처 정보를 포함하고,
상기 비트스트림에 포함된 정보에 기초하여 현재 블록의 예측 모드를 화면간 예측 모드로 결정하는 단계;
상기 현재 블록의 움직임 벡터를 도출하는 단계;
상기 도출된 움직임 벡터에 기반하여 상기 현재 블록에 대해 움직임 보상을 수행함으로써, 상기 현재 블록에 대응하는 예측 샘플을 획득하는 단계;
상기 예측 샘플에 기반하여, 상기 현재 블록에 대한 잔차 샘플을 획득하는 단계;
상기 현재 블록의 공간적 주변 블록을 이용하여, 현재 블록의 공간적 움직임 벡터를 도출하는 단계;
상기 현재 블록의 상기 콜 픽쳐를 결정하는 단계;
상기 콜 픽쳐 내에서 상기 현재 블록에 대응하는 콜 블록의 움직임 벡터를 기반으로 시간적 움직임 벡터를 도출하는 단계; 여기서, 상기 콜 블록은 현재 블록의 우측-하단 픽셀의 위치를 포함하는 제1 블록 또는 상기 현재 블록의 중앙 위치를 포함하는 제2 블록 중 어느 하나에 따라 결정되며,
상기 공간적 움직임 벡터 및 상기 시간적 움직임 벡터를 이용하여 상기 현재 블록에 대한 예측 움직임 벡터 후보 리스트를 생성하는 단계;
상기 예측 샘플과 상기 잔차 샘플을 이용하여 상기 현재 블록에 대한 복원 샘플을 획득하는 단계; 및
상기 콜 픽쳐에 대한 상기 콜 픽쳐 정보를 상기 비트스트림에 부호화하는 단계를 포함하되,
상기 콜 픽쳐 정보는 참조 픽쳐 리스트 내의 참조 픽쳐들 중에서 상기 현재 블록의 콜 픽쳐로 결정되는 픽쳐를 특정하는 정보이며, 상기 비트스트림을 통해 복호화기로 시그널링되는 것을 특징으로 하는 영상 부호화 방법에 의해 생성된 비트스트림을 저장하는 기록 매체.
A recording medium comprising a bitstream decoded by an image decoding method, the recording medium comprising:
The bitstream includes collocated picture information for a collocated picture,
determining a prediction mode of the current block as an inter prediction mode based on information included in the bitstream;
deriving a motion vector of the current block;
obtaining a prediction sample corresponding to the current block by performing motion compensation on the current block based on the derived motion vector;
obtaining a residual sample for the current block based on the prediction sample;
deriving a spatial motion vector of the current block by using the spatially neighboring blocks of the current block;
determining the collocated picture of the current block;
deriving a temporal motion vector based on a motion vector of a collocated block corresponding to the current block in the collocated picture; Here, the collocated block is determined according to either a first block including the position of the lower right-bottom pixel of the current block or a second block including the center position of the current block,
generating a predicted motion vector candidate list for the current block using the spatial motion vector and the temporal motion vector;
obtaining a reconstructed sample for the current block using the prediction sample and the residual sample; and
encoding the collocated picture information for the collocated picture into the bitstream;
The collocated picture information is information specifying a picture determined as a collocated picture of the current block among reference pictures in a reference picture list, and is signaled to a decoder through the bitstream. Bit generated by the video encoding method A recording medium for storing streams.
KR1020210144396A 2011-07-12 2021-10-27 Method for inter prediction and apparatus thereof KR102420426B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020220084353A KR102515824B1 (en) 2011-07-12 2022-07-08 Method for inter prediction and apparatus thereof

Applications Claiming Priority (9)

Application Number Priority Date Filing Date Title
KR1020110069166 2011-07-12
KR20110069166 2011-07-12
KR20110071171 2011-07-18
KR1020110071171 2011-07-18
KR20110071658 2011-07-19
KR1020110071658 2011-07-19
KR20110082395 2011-08-18
KR1020110082395 2011-08-18
KR1020210018003A KR102320585B1 (en) 2011-07-12 2021-02-09 Method for inter prediction and apparatus thereof

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
KR1020210018003A Division KR102320585B1 (en) 2011-07-12 2021-02-09 Method for inter prediction and apparatus thereof

Related Child Applications (1)

Application Number Title Priority Date Filing Date
KR1020220084353A Division KR102515824B1 (en) 2011-07-12 2022-07-08 Method for inter prediction and apparatus thereof

Publications (2)

Publication Number Publication Date
KR20210131299A true KR20210131299A (en) 2021-11-02
KR102420426B1 KR102420426B1 (en) 2022-07-14

Family

ID=47838553

Family Applications (15)

Application Number Title Priority Date Filing Date
KR1020120075901A KR101769576B1 (en) 2011-07-12 2012-07-12 Method for inter prediction and apparatus thereof
KR1020160070892A KR101801256B1 (en) 2011-07-12 2016-06-08 Method for inter prediction and apparatus thereof
KR1020170154780A KR101891656B1 (en) 2011-07-12 2017-11-20 Method for inter prediction and apparatus thereof
KR1020180096648A KR101990425B1 (en) 2011-07-12 2018-08-20 Method for inter prediction and apparatus thereof
KR1020180096647A KR101990424B1 (en) 2011-07-12 2018-08-20 Method for inter prediction and apparatus thereof
KR1020180096645A KR101990423B1 (en) 2011-07-12 2018-08-20 Method for inter prediction and apparatus thereof
KR1020180096644A KR101990422B1 (en) 2011-07-12 2018-08-20 Method for inter prediction and apparatus thereof
KR1020180096646A KR101965287B1 (en) 2011-07-12 2018-08-20 Method for inter prediction and apparatus thereof
KR1020190069185A KR102094436B1 (en) 2011-07-12 2019-06-12 Method for inter prediction and apparatus thereof
KR1020200035119A KR102216320B1 (en) 2011-07-12 2020-03-23 Method for inter prediction and apparatus thereof
KR1020210018003A KR102320585B1 (en) 2011-07-12 2021-02-09 Method for inter prediction and apparatus thereof
KR1020210144396A KR102420426B1 (en) 2011-07-12 2021-10-27 Method for inter prediction and apparatus thereof
KR1020220084353A KR102515824B1 (en) 2011-07-12 2022-07-08 Method for inter prediction and apparatus thereof
KR1020230039525A KR102626368B1 (en) 2011-07-12 2023-03-27 Method for inter prediction and apparatus thereof
KR1020240005610A KR20240010747A (en) 2011-07-12 2024-01-12 Method for inter prediction and apparatus thereof

Family Applications Before (11)

Application Number Title Priority Date Filing Date
KR1020120075901A KR101769576B1 (en) 2011-07-12 2012-07-12 Method for inter prediction and apparatus thereof
KR1020160070892A KR101801256B1 (en) 2011-07-12 2016-06-08 Method for inter prediction and apparatus thereof
KR1020170154780A KR101891656B1 (en) 2011-07-12 2017-11-20 Method for inter prediction and apparatus thereof
KR1020180096648A KR101990425B1 (en) 2011-07-12 2018-08-20 Method for inter prediction and apparatus thereof
KR1020180096647A KR101990424B1 (en) 2011-07-12 2018-08-20 Method for inter prediction and apparatus thereof
KR1020180096645A KR101990423B1 (en) 2011-07-12 2018-08-20 Method for inter prediction and apparatus thereof
KR1020180096644A KR101990422B1 (en) 2011-07-12 2018-08-20 Method for inter prediction and apparatus thereof
KR1020180096646A KR101965287B1 (en) 2011-07-12 2018-08-20 Method for inter prediction and apparatus thereof
KR1020190069185A KR102094436B1 (en) 2011-07-12 2019-06-12 Method for inter prediction and apparatus thereof
KR1020200035119A KR102216320B1 (en) 2011-07-12 2020-03-23 Method for inter prediction and apparatus thereof
KR1020210018003A KR102320585B1 (en) 2011-07-12 2021-02-09 Method for inter prediction and apparatus thereof

Family Applications After (3)

Application Number Title Priority Date Filing Date
KR1020220084353A KR102515824B1 (en) 2011-07-12 2022-07-08 Method for inter prediction and apparatus thereof
KR1020230039525A KR102626368B1 (en) 2011-07-12 2023-03-27 Method for inter prediction and apparatus thereof
KR1020240005610A KR20240010747A (en) 2011-07-12 2024-01-12 Method for inter prediction and apparatus thereof

Country Status (1)

Country Link
KR (15) KR101769576B1 (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10742971B2 (en) 2016-10-05 2020-08-11 Lg Electronics Inc. Inter prediction method and device that performs prediction by applying weights to motion information of a current block
WO2018128228A1 (en) * 2017-01-03 2018-07-12 엘지전자 주식회사 Image decoding method and device in image coding system
CN107370807B (en) * 2017-07-12 2020-05-08 中南大学 Server based on transparent service platform data access and cache optimization method thereof
US11425390B2 (en) 2018-01-26 2022-08-23 Electronics And Telecommunications Research Institute Method and apparatus for image encoding and image decoding using temporal motion information
WO2019147067A1 (en) * 2018-01-26 2019-08-01 한국전자통신연구원 Method and apparatus for image encoding and image decoding using temporal motion information
JP2021516006A (en) 2018-07-02 2021-06-24 エルジー エレクトロニクス インコーポレイティド Video processing method based on inter-prediction mode and equipment for that
EP3833020A4 (en) 2018-07-27 2022-04-27 Samsung Electronics Co., Ltd. Method and device for encoding image and method and device for decoding image on basis of sub-block

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20090012986A (en) * 2007-07-30 2009-02-04 한국정보통신대학교 산학협력단 A fast inter-layer prediction mode decision method in scalable video coding
JP2012191513A (en) * 2011-03-11 2012-10-04 Sony Corp Image processing apparatus and method

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20090012986A (en) * 2007-07-30 2009-02-04 한국정보통신대학교 산학협력단 A fast inter-layer prediction mode decision method in scalable video coding
JP2012191513A (en) * 2011-03-11 2012-10-04 Sony Corp Image processing apparatus and method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Benjamin Bross et al., "WD5: Working draft 5 of High-Efficiency Video Coding", Joint Collaborative Team on Video Coding of ITU-T SG16 WP3 and ISO/IEC JTC1/SC29/WG11 7nd meeting , Geneva, 21-30, Nov.,* *

Also Published As

Publication number Publication date
KR101965287B1 (en) 2019-08-08
KR20210019047A (en) 2021-02-19
KR20180095487A (en) 2018-08-27
KR20170131321A (en) 2017-11-29
KR20180095486A (en) 2018-08-27
KR20190070313A (en) 2019-06-20
KR20160072836A (en) 2016-06-23
KR101801256B1 (en) 2017-11-27
KR102515824B1 (en) 2023-03-30
KR102094436B1 (en) 2020-03-30
KR102216320B1 (en) 2021-02-18
KR102420426B1 (en) 2022-07-14
KR20180095489A (en) 2018-08-27
KR20200034701A (en) 2020-03-31
KR20240010747A (en) 2024-01-24
KR20180095488A (en) 2018-08-27
KR20130008481A (en) 2013-01-22
KR101990424B1 (en) 2019-06-19
KR20220100847A (en) 2022-07-18
KR102626368B1 (en) 2024-01-17
KR101769576B1 (en) 2017-08-18
KR101990423B1 (en) 2019-06-19
KR102320585B1 (en) 2021-11-02
KR20180095490A (en) 2018-08-27
KR101891656B1 (en) 2018-08-27
KR101990422B1 (en) 2019-06-19
KR20230043818A (en) 2023-03-31
KR101990425B1 (en) 2019-06-19

Similar Documents

Publication Publication Date Title
KR102386766B1 (en) Method and apparatus for picture encoding/decoding
KR102320585B1 (en) Method for inter prediction and apparatus thereof
WO2013009104A2 (en) Inter prediction method and apparatus for same
KR20200027487A (en) Method for inter prediction and apparatus thereof
KR102399001B1 (en) Method for inter prediction and apparatus thereof
KR102398997B1 (en) Method for inter prediction and apparatus thereof

Legal Events

Date Code Title Description
A107 Divisional application of patent
E902 Notification of reason for refusal
E701 Decision to grant or registration of patent right