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

Method for inter prediction and apparatus thereof Download PDF

Info

Publication number
KR20230043818A
KR20230043818A KR1020230039525A KR20230039525A KR20230043818A KR 20230043818 A KR20230043818 A KR 20230043818A KR 1020230039525 A KR1020230039525 A KR 1020230039525A KR 20230039525 A KR20230039525 A KR 20230039525A KR 20230043818 A KR20230043818 A KR 20230043818A
Authority
KR
South Korea
Prior art keywords
motion information
block
reference picture
current block
decoder
Prior art date
Application number
KR1020230039525A
Other languages
Korean (ko)
Other versions
KR102626368B1 (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 KR20230043818A publication Critical patent/KR20230043818A/en
Priority to KR1020240005610A priority Critical patent/KR20240010747A/en
Application granted granted Critical
Publication of KR102626368B1 publication Critical patent/KR102626368B1/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/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/129Scanning of coding units, e.g. zig-zag scan of transform coefficients or flexible macroblock ordering [FMO]
    • 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/132Sampling, masking or truncation of coding units, e.g. adaptive resampling, frame skipping, frame interpolation or high-frequency transform coefficient masking
    • 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/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/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/573Motion compensation with multiple frame prediction using two or more reference frames in a given prediction direction
    • 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/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 includes: a motion estimation part for deriving motion information of a current block as motion information including L0 motion information and L1 motion information; a motion compensation part for generating a prediction 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 restoration block generation part for generating a restoration block corresponding to the current block based on the prediction block. According to the present invention, the efficiency of encoding the image can be improved.

Description

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

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

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

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

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

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

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

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

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

본 발명의 일 실시 형태는 영상 복호화 장치이다. 상기 장치는, L0 움직임 정보 및 L1 움직임 정보를 포함하는 움직임 정보로서 현재 블록의 움직임 정보를 도출하는 움직임 예측부, 상기 L0 움직임 정보 및 상기 L1 움직임 정보 중에서 적어도 하나를 기반으로 상기 현재 블록에 대해 움직임 보상을 수행함으로써, 상기 현재 블록에 대응하는 예측 블록을 생성하는 움직임 보상부 및 상기 예측 블록을 기반으로 상기 현재 블록에 대응하는 복원 블록을 생성하는 복원 블록 생성부를 포함하되, 상기 움직임 보상부는, 상기 L0 움직임 정보 및 상기 L1 움직임 정보의 동일성 여부를 기반으로 상기 움직임 보상을 수행한다.One embodiment of the present invention is a video decoding device. The apparatus may include a motion prediction unit for deriving motion information of a current block as motion information including L0 motion information and L1 motion information, and motion for the current block based on at least one of the L0 motion information and the L1 motion information. By performing compensation, a motion compensation unit for generating a prediction block corresponding to the current block and a restoration block generation unit for generating a restoration block corresponding to the current block based on the prediction block, wherein the motion compensation unit 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) allocated to the L0 reference picture, and the L1 motion information includes an L1 motion vector and an L1 reference picture. 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 compensation unit determines, based on the L0 motion information among the L0 motion information and the L1 motion information, You can perform uni prediction.

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

본 발명의 다른 실시 형태는 영상 복호화 장치이다. 상기 장치는, L0 움직임 정보 및 L1 움직임 정보를 포함하는 움직임 정보로서 현재 블록의 움직임 정보를 도출하는 움직임 예측부, 상기 L0 움직임 정보 및 상기 L1 움직임 정보 중에서 적어도 하나를 기반으로 상기 현재 블록에 대해 움직임 보상을 수행함으로써, 상기 현재 블록에 대응하는 예측 블록을 생성하는 움직임 보상부 및 상기 예측 블록을 기반으로 상기 현재 블록에 대응하는 복원 블록을 생성하는 복원 블록 생성부를 포함하되, 상기 움직임 보상부는, 상기 현재 블록의 크기를 기반으로 상기 움직임 보상을 수행한다.Another embodiment of the present invention is a video decoding device. The apparatus may include a motion prediction unit for deriving motion information of a current block as motion information including L0 motion information and L1 motion information, and motion for the current block based on at least one of the L0 motion information and the L1 motion information. By performing compensation, a motion compensation unit for generating a prediction block corresponding to the current block and a restoration block generation unit for generating a restoration block corresponding to the current block based on the prediction block, wherein the motion compensation unit 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 compensation unit 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 a video decoding device. The apparatus includes a motion estimation unit for deriving motion information from an already reconstructed picture, a motion compensation unit for generating a prediction block corresponding to a current block based on the derived motion information, and a motion compensation unit for generating the current block based on the prediction block. A reconstruction block generation unit for generating a corresponding reconstruction block, wherein the motion information includes a motion vector and a reference picture index, and the motion estimation unit sets the reference picture index to 0, and the image The motion vector is derived based on a col block corresponding to the current block in the reconstructed picture.

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

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

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

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

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

본 발명에 따른 시간적 움직임 정보 도출 방법에 의하면, 영상 부호화 효율이 향상될 수 있다.According to the temporal motion information derivation method according to the present invention, video 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 showing a configuration according to an embodiment of an image encoding apparatus to which the present invention is applied.
2 is a block diagram showing a configuration according to an embodiment of a video decoding apparatus to which the present invention is applied.
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 bi-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 of 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.
FIG. 8 is a block diagram schematically illustrating an embodiment of an inter-prediction apparatus capable 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 deriving temporal motion information according to the embodiment of FIG. 9 .
12 is a diagram schematically illustrating an embodiment of a method of deriving motion information of a current block according to the present invention.
FIG. 13 is a block diagram schematically illustrating an embodiment of an inter-prediction apparatus capable 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.
FIG. 15 is a block diagram schematically illustrating an embodiment of an inter-prediction device capable of deriving temporal motion information according to the embodiment of FIG. 14 .

이하, 도면을 참조하여 본 발명의 실시 형태에 대하여 구체적으로 설명한다. 본 명세서의 실시예를 설명함에 있어, 관련된 공지 구성 또는 기능에 대한 구체적인 설명이 본 명세서의 요지를 흐릴 수 있다고 판단되는 경우에는 그 상세한 설명은 생략한다.EMBODIMENT OF THE INVENTION Hereinafter, embodiment of this invention is described concretely 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.

어떤 구성 요소가 다른 구성 요소에 “연결되어” 있다거나 “접속되어” 있다고 언급된 때에는, 그 다른 구성 요소에 직접적으로 연결되어 있거나 또는 접속되어 있을 수도 있으나, 중간에 다른 구성 요소가 존재할 수도 있다고 이해되어야 할 것이다. 아울러, 본 발명에서 특정 구성을 “포함”한다고 기술하는 내용은 해당 구성 이외의 구성을 배제하는 것이 아니며, 추가적인 구성이 본 발명의 실시 또는 본 발명의 기술적 사상의 범위에 포함될 수 있음을 의미한다. It is understood that when a component is referred to as “connected” or “connected” to another component, it may be directly connected or connected to the other component, but other components may exist in the middle. It should be. In addition, the description of "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 and second may be used to describe various components, but the components should not be limited by the terms. These terms are only used for the purpose of distinguishing one component from another. For example, a first element may be termed a second element, and similarly, a second element may be termed a first element, without departing from the scope of the present invention.

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

또한, 일부의 구성 요소는 본 발명에서 본질적인 기능을 수행하는 필수적인 구성 요소는 아니고 단지 성능을 향상시키기 위한 선택적 구성 요소일 수 있다. 본 발명은 단지 성능 향상을 위해 사용되는 구성 요소를 제외한 본 발명의 본질을 구현하는데 필수적인 구성부만을 포함하여 구현될 수 있고, 단지 성능 향상을 위해 사용되는 선택적 구성 요소를 제외한 필수 구성 요소만을 포함한 구조도 본 발명의 권리범위에 포함된다.In addition, some of the components may be optional components for improving performance rather than essential components that perform essential functions in the present invention. The present invention can be implemented by including only components essential to implement the essence of the present invention, excluding 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 showing a configuration according to an embodiment of an image encoding apparatus to which the present invention is applied.

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

영상 부호화 장치(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 means prediction within a picture, and inter prediction means prediction between pictures. In the case of the intra mode, the switch 115 may be switched to the intra mode, and in the case of the inter mode, the switch 115 may be switched to the inter mode. After generating a prediction block for an input block of an input image, the image encoding apparatus 100 may encode a residual between the input block and the prediction block.

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

인터 모드인 경우, 움직임 예측부(motion estimator)(111)는, 움직임 예측 과정에서 참조 픽쳐 버퍼(190)에 저장되어 있는 참조 영상에서 입력 블록과 가장 매치가 잘 되는 영역을 찾아 움직임 벡터를 구할 수 있다. 움직임 보상부(112)는 움직임 벡터를 이용하여 움직임 보상을 수행함으로써 예측 블록을 생성할 수 있다. In the case of 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 picture stored in the reference picture buffer 190 during the motion estimation process. there is. 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 a difference between the input block and the generated prediction block. The transform unit 130 may output a transform coefficient by performing transform on the residual block. The quantization unit 140 may quantize the input transform coefficient according to a quantization parameter and output a quantized coefficient.

엔트로피 부호화부(150)는, 양자화부(140)에서 산출된 값(예를 들어, 양자화된 계수)들 및/또는 부호화 과정에서 산출된 부호화 파라미터 값 등을 기초로 엔트로피 부호화를 수행하여 비트스트림(bit stream)을 출력할 수 있다. The entropy encoding unit 150 performs entropy encoding based on the values (eg, quantized coefficients) calculated by the quantization unit 140 and/or the encoding parameter values calculated in the encoding process to generate a 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 with a high probability of occurrence and a large number of bits are allocated to a symbol with a low probability of occurrence to represent the symbol, thereby reducing the number of bits for symbols to be coded. The size of the column may be reduced. Therefore, compression performance of image encoding can be improved through entropy encoding. The entropy encoding unit 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 video encoding apparatus according to the embodiment of FIG. 1 performs inter-prediction encoding, that is, inter-frame prediction encoding, a currently encoded video needs to be decoded and stored to be used as a reference video. Therefore, the quantized coefficient is inversely quantized in the inverse quantization unit 160 and inversely transformed in the inverse transformation unit 170. The inverse quantized and inverse transformed coefficients are added to the prediction block through an 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 a 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 also be called an adaptive in-loop filter. The deblocking filter may remove block distortion and/or blocking artifacts generated at the boundary between blocks. SAO may add an appropriate offset value to a pixel value to compensate for a coding error. ALF may perform filtering based on a value obtained by comparing a reconstructed image with an original image, and may be performed only when high efficiency is applied. A reconstructed block that has passed through the filter unit 180 may be stored in the reference picture buffer 190 .

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

*도 2를 참조하면, 상기 영상 복호화 장치(200)는 엔트로피 복호화부(210), 역양자화부(220), 역변환부(230), 인트라 예측부(240), 움직임 보상부(250), 가산기(255), 필터부(260) 및 참조 픽쳐 버퍼(270)를 포함한다.* Referring to FIG. 2, the video 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, an adder 255, a filter unit 260, and a reference picture buffer 270.

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

엔트로피 복호화부(210)는, 입력된 비트스트림을 확률 분포에 따라 엔트로피 복호화하여, 양자화된 계수(quantized coefficient) 형태의 심볼을 포함한 심볼들을 생성할 수 있다. 엔트로피 복호화 방법은 상술한 엔트로피 부호화 방법과 유사하다.The entropy decoding unit 210 may generate symbols including symbols in the form of quantized coefficients by entropy decoding the input bitstream according to a probability distribution. 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 with a high probability of occurrence and a large number of bits are allocated to a symbol with a low probability of occurrence to express the symbol, thereby increasing the size of the bit stream for each symbol. can be reduced Therefore, compression performance of image decoding may be improved through the entropy decoding method.

양자화된 계수는 역양자화부(220)에서 역양자화되고 역변환부(230)에서 역변환되며, 양자화된 계수가 역양자화/역변환 된 결과, 잔차 블록(residual block)이 생성될 수 있다. The quantized coefficient is inversely quantized in the inverse quantization unit 220 and inversely transformed in 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 previously decoded blocks adjacent to the current block. In the case of the inter mode, the motion compensation unit 250 may generate a prediction block by performing motion compensation using a motion vector and a reference image stored in the reference picture buffer 270 .

잔차 블록과 예측 블록은 가산기(255)를 통해 더해지고, 더해진 블록은 필터부(260)를 거칠 수 있다. 필터부(260)는 디블록킹 필터, SAO, ALF 중 적어도 하나 이상을 복원 블록 또는 복원 픽쳐에 적용할 수 있다. 필터부(260)는 재구성된 영상, 즉 복원 영상을 출력할 수 있다. 복원 영상은 참조 픽쳐 버퍼(270)에 저장되어 인터 예측에 사용될 수 있다.The residual block and the prediction block are 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 restored 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 video encoding and decoding. When encoding and decoding an image, the encoding or decoding unit refers to the divided unit when encoding or decoding an image by dividing it, such as a coding unit (CU), a prediction unit (PU), and a transform unit (TU). : Transform Unit), a transform block, and the like. One block may be further divided into smaller sub-blocks. In addition, in this specification, “picture” may be replaced with “frame”, “field” and/or “slice” depending on the context, and such distinction can be easily made by those skilled in the art. There will be. For example, P picture, B picture, and forward B picture described later may be replaced with P slice, B slice, and forward B slice, respectively, depending on the context.

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

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

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

한편, 움직임 정보 도출 방식은 현재 블록의 예측 모드에 따라 달라질 수 있다. 인터 예측을 위해 적용되는 예측 모드에는 AMVP(Advanced Motion Vector Predictor), 머지(merge) 등이 있을 수 있다.Meanwhile, the motion information derivation method may vary according to 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 predicted motion vector candidate list using a motion vector of a reconstructed neighboring block and/or a motion vector of a collocated block. That is, a motion vector of a reconstructed neighboring block and/or a motion vector of a collocated block may be used as a predicted 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 a motion vector predictor of the current block from among motion vector predictor candidates included in the predictor motion vector candidate list by using the predictor 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, and may encode and transmit the motion vector difference (MVD) to the decoder. At this time, the decoder may decode the received motion vector difference and derive a 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 using motion information of a reconstructed neighboring block and/or motion information of a collocated block. That is, the encoder and the decoder may use motion information of the reconstructed neighboring block and/or collocated block as a merge candidate for the current block, if present.

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

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

다시 도 3을 참조하면, 부호화기 및 복호화기는 상기 도출된 움직임 정보에 기반하여 현재 블록에 대한 움직임 보상을 수행함으로써, 현재 블록의 예측 블록을 생성할 수 있다(S320). 여기서, 예측 블록은 현재 블록에 대한 움직임 보상 수행 결과 생성된, 움직임 보상된 블록을 의미할 수 있다. 또한, 복수의 움직임 보상된 블록은 하나의 움직임 보상된 영상을 구성할 수 있다. 따라서, 후술되는 실시예들에서 예측 블록은 문맥에 따라 ‘움직임 보상된 블록’ 및/또는 ‘움직임 보상된 영상’으로 지칭될 수 있으며, 이러한 구분은 해당 기술 분야에서 통상의 지식을 가진 자라면 용이하게 할 수 있을 것이다.Referring back to FIG. 3 , the encoder and 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 refer to 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. Therefore, in the embodiments described below, a prediction block may be referred to as a 'motion compensated block' and/or a 'motion compensated image' depending on the context, and such classification is easy for those skilled in the art. will be able to do

한편, 인터 예측이 수행되는 픽쳐에는 P 픽쳐 및 B 픽쳐가 있을 수 있다. P 픽쳐는 하나의 참조 픽쳐를 이용한 단방향 예측이 수행되는 픽쳐를 의미할 수 있고, B 픽쳐는 하나 이상, 예를 들어 두 개의 참조 픽쳐를 이용한 순방향, 역방향 또는 양방향 예측이 수행될 수 있는 픽쳐를 의미할 수 있다. 예를 들어, B 픽쳐에서는 1개의 순방향 참조 픽쳐(과거 픽쳐) 및 1개의 역방향 참조 픽쳐(미래 픽쳐)를 이용하여 인터 예측이 수행될 수 있다. 또한, B 픽쳐에서는 2개의 순방향 참조 픽쳐를 이용하여 예측이 수행되거나, 2개의 역방향 참조 픽쳐를 이용하여 예측이 수행될 수도 있다.Meanwhile, pictures for which inter prediction is performed may include P pictures and B pictures. A P picture can mean a picture for which unidirectional prediction is performed using one reference picture, and a B picture means a picture for which forward, backward, or bidirectional prediction is performed using one or more, for example, two reference pictures. can do. For example, in a B picture, inter prediction may be performed using one forward reference picture (past picture) and one backward reference picture (future picture). Also, for a 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, reference pictures may be managed by a reference picture list. One reference picture is used in the P picture, and the reference picture can be assigned to reference picture list 0 (L0 or List0). Two reference pictures are used in the B picture, and the two reference pictures can be assigned to reference picture list 0 and 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, a forward reference picture may be assigned to reference picture list 0, and a backward reference picture may be assigned to reference picture list 1. However, the reference picture allocation method is not limited thereto, and a forward reference picture may be allocated to reference picture list 1, and a backward reference picture may be allocated to reference picture list 0. Hereinafter, the reference picture allocated to reference picture list 0 is referred to as an L0 reference picture, and the reference picture allocated to 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) 명령에 의해 재배열될 수 있다. Reference pictures can generally be assigned to a reference picture list in descending order according to reference picture numbers. Here, the reference picture number may refer to a number assigned to each reference picture in the order of POC (Picture Order Count), and the POC order may mean a display order and/or a time order of pictures. For example, two reference pictures having the same reference picture number may correspond to the same reference picture. Reference pictures assigned to the reference picture list may be rearranged by a Reference Picture List Reordering (RPLR) or 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 can be performed on a P picture, and forward, backward, or bidirectional prediction using one L0 reference picture and one L1 reference picture, that is, two reference pictures, on a B picture. predictions can be made. 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 that includes all of forward prediction, backward prediction, and bi-prediction, but in the embodiments described later, for convenience, prediction using two reference pictures (L0 reference picture and L1 reference picture) is referred to as bi-prediction. That is, bi-prediction in embodiments to be described later may mean bi-prediction, and can be understood as a concept including all forward, backward, and bi-directional predictions using two reference pictures (L0 reference picture and L1 reference picture). . In addition, even when bi-prediction is performed, forward prediction or backward prediction may be performed. However, in embodiments described later, for convenience, prediction using only one reference picture is referred to as uni-directional prediction. That is, in the embodiments to be described later, uni-prediction may mean uni-prediction, and should be understood as a concept including prediction using only one reference picture. In addition, 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 bi-prediction is applied.

상술한 바와 같이, 부호화기 및 복호화기는 인터 예측시 단방향 예측뿐만 아니라 양방향 예측을 수행할 수 있다. 양방향 예측이 적용되는 경우, 예측이 수행되는 각각의 블록은 두 개의 참조 픽쳐(L0 참조 픽쳐 및 L1 참조 픽쳐)를 가질 수 있다. 또한 이 때, 양방향 예측이 수행되는 각각의 블록은 두 개의 움직임 정보를 가질 수 있다. 여기서, 움직임 정보는 참조 픽쳐 번호 및 움직임 벡터 등을 포함할 수 있다.As described above, the encoder and decoder can perform bidirectional prediction as well as unidirectional prediction in inter prediction. When bi-prediction is applied, each block on which prediction is performed may have two reference pictures (an L0 reference picture and an L1 reference picture). Also, at this time, each block on which bi-directional 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 reference picture list 0 and reference picture list 1 and use it for prediction. That is, two reference pictures including an L0 reference picture and an L1 reference picture may be used for bidirectional prediction. Hereinafter, motion information corresponding to an L0 reference picture is referred to as L0 motion information, and motion information corresponding to an L1 reference picture is referred to as L1 motion information. Also, motion compensation using L0 motion information is referred to as L0 motion compensation, and motion compensation using L1 motion information is referred to as L1 motion compensation.

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

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

이하, 양방향 예측시에 적용되는 움직임 보상은 양방향 움직임 보상이라 한다. 이에 대응하여, 단방향 예측시에 적용되는 움직임 보상은 단방향 움직임 보상으로 불릴 수 있다.Hereinafter, motion compensation applied in bi-directional prediction is referred to as bi-directional 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 video encoded in FIG. 5 corresponds to BasketballDrill. Here, BasketballDrill represents the name of a test sequence used in video encoding/decoding experiments. The size of the encoded image is 832x480, and the POC (Picture Order Count) is 2. Also, the value of a quantization parameter (QP) applied to the image of FIG. 5 is 32.

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

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

도 5에 도시된 영상은 순방향 B 픽쳐를 사용하여 부호화된 영상이다. 따라서, 부호화된 영상 내의 각각의 블록은 최대 두 개의 움직임 정보를 가질 수 있다. 여기서, 움직임 정보는 참조 픽쳐 번호, 움직임 벡터 등을 포함할 수 있다. 도 5을 참조하면, 두 개의 움직임 정보를 갖는 블록들 중에서 L0 움직임 정보(예를 들어, 참조 픽쳐 번호, 움직임 벡터)와 L1 움직임 정보(예를 들어, 참조 픽쳐 번호, 움직임 벡터)가 동일한 블록이 다수 존재할 수 있다. The image shown in FIG. 5 is coded using forward B pictures. Accordingly, each block in an encoded 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 , among blocks having two pieces of motion information, a block having the same L0 motion information (eg, reference picture number and motion vector) and L1 motion information (eg, reference picture number and motion vector) is 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 be generated due to the temporal motion information derivation method. there is. As described above, temporal motion information may be derived from motion information of a collocated block corresponding to a current block in an already reconstructed collocated picture. For example, when deriving L0 temporal motion information of a current block, an encoder and a decoder may use L0 motion information of a collocated block corresponding to the current block within a collocated picture. However, when L0 motion information does not exist in the collocated block, the encoder and decoder may use L1 motion information of the collocated block as 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 within the collocated picture. However, when L1 motion information does not exist in the collocated block, the encoder and decoder may use L0 motion information of the collocated block as L1 temporal motion information of the current block. As a result of performing the above process, a phenomenon in which the L0 motion information and the L1 motion information of the current block become the same may occur. Therefore, in this 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 motion vector) and L1 temporal motion information (eg, reference picture number and motion vector) are the same, the motion information of the collocated block corresponding to the current block in the previously reconstructed collocated picture is L0 A case of having only one of motion information and L1 motion information may be included.

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

L0 움직임 정보와 L1 움직임 정보가 동일한 블록에 대해 움직임 보상이 수행되는 경우에는, 하나의 블록에서 동일한 프로세스가 두 번 반복하여 수행될 수 있다. 이는 부호화 관점에서 매우 비효율적이므로, 상술한 문제점을 해결하여 계산 복잡도를 감소시키고 부호화 효율을 향상시킬 수 있는 인터 예측 방법 및/또는 움직임 보상 방법이 제공될 수 있다. 일례로, L0 움직임 정보(예를 들어, 참조 픽쳐 번호 및 움직임 벡터)와 L1 움직임 정보(예를 들어, 참조 픽쳐 번호 및 움직임 벡터)가 동일한 경우, 부호화기 및 복호화기는 움직임 보상 과정을 한 번만 수행함으로써 계산 복잡도를 감소시킬 수 있다. 다른 예로, L0 움직임 정보(예를 들어, 참조 픽쳐 번호 및 움직임 벡터)와 L1 움직임 정보(예를 들어, 참조 픽쳐 번호 및 움직임 벡터)가 동일한 경우, 부호화기 및 복호화기는 L0 움직임 정보 및/또는 L1 움직임 정보를 다시 설정함으로써 부호화 효율을 증가시킬 수도 있다.When motion compensation is performed for 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 from the point of view of encoding, an inter prediction method and/or a motion compensation method capable of reducing computational complexity and improving encoding efficiency can be provided by solving the above problems. 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 decoder perform the motion compensation process only once. The computational complexity can be reduced. As another 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 decoder use the L0 motion information and/or the L1 motion information. Encoding efficiency may be increased by resetting information.

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

후술되는 실시예들은 시간적 움직임 정보를 중심으로 서술되지만 본 발명은 이에 한정되는 것은 아니다. 예를 들어, 도 6의 실시예에 따른 방법들은 머지 모드 및/또는 AMVP 모드에서의 시간적 움직임 정보뿐만 아니라, 머지 모드에서 머지 후보 리스트를 기반으로 도출된 현재 블록의 움직임 정보 및/또는 AMVP 모드에서 예측 움직임 벡터 후보 리스트를 기반으로 도출된 현재 블록의 움직임 정보에도 동일하거나 유사한 방식으로 적용될 수 있다.Embodiments to be described later are 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 merge mode and/or AMVP mode, but also motion information of a current block derived based on a merge candidate list in merge mode and/or AMVP mode. The same or similar method can be applied to motion information of the current block derived based on the predicted motion vector candidate list.

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

도 6을 참조하면, 부호화기 및 복호화기는 콜 블록을 기반으로 도출된 시간적 움직임 정보에서 L0 시간적 움직임 정보와 L1 시간적 움직임 정보가 동일한지 여부, 즉 L0 참조 픽쳐 번호와 L1 참조 픽쳐 번호가 동일하고 L0 움직임 벡터와 L1 움직임 벡터가 동일한지 여부를 판단할 수 있다(S610).Referring to FIG. 6, an encoder and a decoder determine whether L0 temporal motion information and L1 temporal motion information are the same in temporal motion information derived based on a collocated block, that is, the L0 reference picture number and the L1 reference picture number are the same and the L0 motion 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 identical, that is, when the L0 reference picture number and the L1 reference picture number are not identical and/or the L0 motion vector and the L1 motion vector are not identical, the encoder and decoder call Temporal motion information derived based on the block may be used as 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 predicted motion vector candidate for the current block. Also, when merge is applied, 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 the reconstructed neighboring block exists (S620). For example, at this time, the encoder and 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 current picture that has already been encoded and/or decoded and reconstructed, 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 (for example, 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), an encoder and a decoder The machine may reset the prediction direction information of the current block to unidirectional prediction (S630). Also, at this time, the encoder and decoder may use only L0 temporal motion information as 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 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 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. At this time, 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 decoder may use only L0 temporal motion information as temporal motion information of the current block.

한편, 상술한 실시예에서는 L0 시간적 움직임 정보와 L1 시간적 움직임 정보의 동일성을 기반으로 S620 내지 S640 과정의 수행 여부가 결정되지만, 부호화기 및 복호화기는 다른 조건을 기반으로 S620 내지 S640 과정의 수행 여부를 결정할 수도 있다. Meanwhile, in the above-described embodiment, whether or not to perform processes S620 to S640 is determined based on the equality of L0 temporal motion information and L1 temporal motion information, but the encoder and decoder determine whether to perform 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 processes 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, the encoder and decoder may perform steps S620 to S640 when the L0 reference picture number and the L1 reference picture number are the same.

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

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

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

또 다른 실시예로, 부호화기 및 복호화기는 콜 블록의 움직임 정보에서 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 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 the zero vector (0,0). In this case, in step S640 described above, the encoder and decoder may reset the motion vector(s) corresponding to the zero vector (0,0). For 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) s) may be set as motion vectors of blocks located around the collocated block. As another embodiment, the encoder and 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 does not correspond to the zero vector (0,0). In this case, in step S640 described above, the encoder and decoder may reset the motion vector(s) that do not correspond to the zero vector (0,0), and the motion vector(s) that does not correspond to the zero vector (0,0). ) may be reset to the motion vector of the reconstructed neighboring block.

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

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

또 다른 실시예로, 부호화기 및 복호화기는 움직임 정보 후보 리스트 내에서 가용한 첫 번째 움직임 정보 후보를 현재 블록의 L1 시간적 움직임 정보로 사용할 수 있다. 이 경우, L1 시간적 움직임 정보의 L1 참조 픽쳐 번호는 상기 첫 번째 움직임 정보 후보의 참조 픽쳐 번호로 변경되거나 설정되고, L1 시간적 움직임 정보의 L1 움직임 벡터는 상기 첫 번째 움직임 정보 후보의 움직임 벡터로 변경되거나 설정될 수 있다. 이 때, 부호화기 및 복호화기는 상기 첫 번째 움직임 정보 후보의 L0 움직임 정보를 사용할 수도 있고, 상기 첫 번째 움직임 정보 후보의 L1 움직임 정보를 사용할 수도 있다.As another embodiment, the encoder and decoder may use the first available motion information candidate 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. can be set. In this case, the encoder and decoder may use L0 motion information of the first motion information candidate or 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, for example, the encoder and 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 decoder may add the motion information of the reconstructed neighboring block to the motion information candidate list and may add the zero vector (0,0) to the motion information candidate list. At this time, the encoder and 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. there is.

상술한 실시예들에서 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, they are highly likely to correspond to motion information caused by movement of an object. Therefore, when the encoder and decoder search for motion information to be used as the L1 temporal motion information of the current block in the reconstructed neighboring block and/or motion information candidate list, the motion information having the zero vector (0,0) is not selected and is zero. Motion information that does not have a vector (0,0) may be selected. This is because a block having motion information corresponding to the 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 blocks and/or the motion information candidate list. For example, as in the above-described S640, when the L1 temporal motion information of the current block is derived based on the reconstructed neighboring block, the encoder and the decoder recall blocks 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 having a difference between the L0 temporal motion information of the current block and a predetermined threshold or less as the motion information to be used as the L1 temporal motion information of the current block. Here, the predetermined threshold may be determined based on mode information of the current block, motion information of the current block, mode information of neighboring blocks, and/or motion information of neighboring blocks, and the like, 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 decoder may determine one of the L0 motion information and the L1 motion information as the motion information to be used as the L1 temporal motion information of the current block. For example, the encoder and decoder may use L0 motion information as L1 temporal motion information of the current block in the motion information of the reconstructed neighboring block and/or the motion information selected from the motion information candidate list. At this time, if 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 decoder may use the L1 motion information as the L1 temporal motion information of the current block. . As another example, the encoder and decoder may use L1 motion information from the motion information of the reconstructed neighboring block and/or motion information selected from the motion information candidate list as the L1 temporal motion information of the current block. At this time, if 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 decoder may use the L0 motion information as the L1 temporal motion information of the current block. .

한편, 부호화기 및 복호화기는 상술한 S640 단계에서 현재 블록의 L1 시간적 움직임 정보(예를 들어, L1 움직임 벡터)를 재설정하기 위해, 복원된 주변 블록의 움직임 정보 및/또는 움직임 정보 후보 리스트를 사용하지 않을 수도 있다. 이 때, 부호화기 및 복호화기는 현재 블록의 L0 시간적 움직임 정보(예를 들어, L0 움직임 벡터)를 기반으로 현재 블록의 L1 시간적 움직임 정보(예를 들어, L1 움직임 벡터)를 재설정할 수 있다. 이하, 이와 관련된 실시예들이 서술되며 이는 움직임 벡터를 기준으로 서술하기로 한다.Meanwhile, the encoder and decoder may 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, L1 motion vector) of the current block in the above-described step S640. may be At this time, the encoder and decoder may reset 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. Hereinafter, embodiments related to this will be described, which will be described based on motion vectors.

일 실시예로, 부호화기 및 복호화기는 현재 블록의 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 픽셀 크기만큼 이동, 정수 픽셀 크기만큼 이동)은 수평 방향 성분 및 수직 방향 성분에 대해 각각 독립적으로 적용될 수도 있다. 이 때, 수평 방향의 이동 거리 및 수직 방향의 이동 거리는 서로 다를 수도 있다.As 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 L0 temporal motion information (L0 motion vector) of the current block to L1 of the current block. It can be used as temporal motion information (L1 motion vector). As an example, the encoder and decoder have a 1/4 pixel size in the vertical and/or horizontal direction (eg, (-1,0), (1,0), ( 0,-1), (0,1), (-1,-1), (-1,1), (1,-1), (1,1) etc. Here, 1/4 pixel unit is 1 corresponds to.) may be used as L1 temporal motion information of the current block. As another example, the encoder and decoder have a 1/2 pixel size in the vertical and/or horizontal direction (eg, (-2,0), (2,0), ( 0,-2), (0,2), (-2,-2), (-2,2), (2,-2), (2,2) etc. Here, 1/4 pixel unit is 1 corresponds to.) may be used as L1 temporal motion information of the current block. As another example, the encoder and decoder have integer pixel sizes (eg, (-4,0), (4,0), (0) in the vertical and/or horizontal directions 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 units equals 1 corresponding.) may be used as the L1 temporal motion information of the current block. Meanwhile, since a motion vector includes a vertical component and a horizontal component, the above-described methods (movement by 1/4 pixel size, movement by 1/2 pixel size, and movement by integer pixel size) Each component may be applied independently. In this case, the movement distance in the horizontal direction and the movement 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 decoder change the value of the L0 temporal motion information (L0 motion vector) of the current block to another pixel-unit value and then use the changed value as the L1 temporal motion information (L1 motion vector) of the current block. can For example, when the value of the L0 temporal motion information of the current block is a value in 1/4 pixel units, the encoder and decoder may change the value of the L0 temporal motion information to a value in 1/2 pixel units based on a shift operation or the like. , and the changed value can be used as L1 temporal motion information of the current block. As another example, when the value of the L0 temporal motion information of the current block is a value in 1/2 pixel units, the encoder and the decoder may change the value of the L0 temporal motion information to a value in units of integer pixels 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 / 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 in step S610 before resetting the temporal motion information may include a reference picture index as well as a motion vector. Here, the L0 motion vector and the L1 motion vector may be motion vectors derived temporally based on the collocated block as described above, and the L0 reference picture index and the L1 reference picture index may be reference pictures spatially derived from the reconstructed neighboring blocks. 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 motion information of a reconstructed neighboring block.

L1 시간적 움직임 정보의 L1 움직임 벡터가 복원된 주변 블록을 기반으로 재설정되는 경우, L1 시간적 움직임 정보의 L1 참조 픽쳐 인덱스에 대해서도 재설정 과정이 수행될 수 있다. When the L1 motion vector of the L1 temporal motion information is reset based on the reconstructed neighboring block, a reset 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 described later, for convenience of description, the temporal motion information input in step S610 before resetting the temporal motion information is referred to as 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 the input motion vector (L0 input motion vector, L1 input motion vector), and the reference picture index included in the input temporal motion information is the input reference picture index (L0 input reference picture index, L1 input reference picture index) and reference picture numbers included in the input temporal motion information are referred to as input reference picture numbers (L0 input reference picture numbers, L1 input reference picture numbers).

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

일 실시예로, 부호화기 및 복호화기는 복원된 주변 블록을 기반으로 L1 입력 참조 픽쳐 인덱스를 재설정할 수 있다. 상술한 바와 같이, 부호화기 및 복호화기는 복원된 주변 블록의 움직임 정보를 현재 블록의 L1 시간적 움직임 정보로 사용할 수 있다. 이 때, 부호화기 및 복호화기는 L1 입력 참조 픽쳐 인덱스를 상기 복원된 주변 블록의 참조 픽쳐 인덱스로 재설정함으로써 최종 L1 참조 픽쳐 인덱스를 도출할 수 있다. 다른 실시예로, 부호화기 및 복호화기는 L1 입력 참조 픽쳐 인덱스 값을 소정의 고정된 참조 픽쳐 인덱스 값으로 재설정함으로써 최종 L1 참조 픽쳐 인덱스를 도출할 수도 있다. As an embodiment, the encoder and decoder may reset the L1 input reference picture index based on the reconstructed neighboring block. As described above, the encoder and decoder may use the motion information of the reconstructed neighboring block as the L1 temporal motion information of the current block. At this time, the encoder and 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 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일 확률이 높기 때문이다.As 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 and use them 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 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 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 value. For example, among the reference picture indices of the reconstructed neighboring block, a reference picture index that is not the same as the L0 input reference picture index may exist. In this case, for example, the encoder and decoder may use the most frequently used reference picture index among reference picture indices 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 decoder may use a reference picture index having the smallest non-negative value among 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 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 final L1 temporal motion information without a resetting process, or may be used as 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 decoder may perform scaling on motion vectors of the reconstructed neighboring blocks and use the scaled motion vectors as 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 process of resetting a motion vector and a process of resetting a reference picture index (eg, RefIdxLX, X=0,1). In the following embodiments, it is assumed that the L1 input motion vector is reset based on the reconstructed neighboring block. That is, it is assumed that the encoder and decoder reset the L1 input motion vector to one value among the motion vectors of the reconstructed neighboring blocks.

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

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

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

한편, 상술한 바와 같이 재설정된 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 decoder may reset the prediction direction information of the current block to unidirectional prediction. At this time, the encoder and decoder may use only L0 temporal motion information as temporal motion information of the current block. This method can be applied to the present invention as a combined 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. Block 710 in FIG. 7 represents the current block (X).

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

도 6의 실시예에서 상술한 바와 같이, 부호화기 및 복호화기는 소정의 조건에 따라 복원된 주변 블록의 움직임 정보를 현재 블록의 L1 시간적 움직임 정보로 사용할 수 있다. 즉, 부호화기 및 복호화기는 현재 블록의 L1 시간적 움직임 정보 값을 복원된 주변 블록의 움직임 정보 값으로 재설정할 수 있다. 이 때, 현재 블록의 L1 시간적 움직임 정보로 사용되는 움직임 정보는 다양한 방법으로 도출될 수 있다.As described above in the embodiment of FIG. 6, the encoder and decoder may use motion information of neighboring blocks reconstructed according to a predetermined condition as L1 temporal motion information of the current block. That is, the encoder and 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, 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 decoder may derive motion information used as L1 temporal motion information from one block existing at a predetermined position among reconstructed neighboring blocks. At this time, the blocks at the predetermined location are the lower left block (A), the upper rightmost 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 located at predetermined positions among reconstructed neighboring blocks in a predetermined order. In this case, the encoder and decoder may use motion information of a first block having motion information in the scan order as the L1 temporal motion information of the current block. A scan target block and scan order may be determined in various forms. For example, the encoder and decoder may scan neighboring blocks in the order of a leftmost block (F), an upper leftmost block (B), and an uppermost rightmost block (B). As another example, the encoder and decoder select neighboring blocks in the order of the top left block (F), the top left block (G), the top right corner block (C), the bottom left corner block (D), and the top left corner block (E). can also be scanned. As another example, the encoder and decoder may scan 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 bottom left block (A), the top right block (B), the top right corner block (C), the bottom left corner block (D), the top left corner block (E), the top left block ( Neighboring blocks may be scanned in order of F) and the top leftmost block (G).

또 다른 실시예로, 부호화기 및 복호화기는 복원된 주변 블록 중에서 소정의 위치에 존재하는 복수 개의 블록의 움직임 정보에 대해 중간 값을 도출할 수 있고, 상기 도출된 중간 값을 현재 블록의 L1 시간적 움직임 정보로 사용할 수 있다. 예를 들어, 상기 복수 개의 블록은 좌측 최상단 블록(F), 상단 최좌측 블록(G), 우측 상단 코너 블록(C), 좌측 하단 코너 블록(D) 및 좌측 상단 코너 블록(E)일 수 있다. As another embodiment, the encoder and decoder may derive a median value for motion information of a plurality of blocks existing at predetermined positions among the reconstructed neighboring blocks, and use the derived median value as 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 시간적 움직임 정보는 구현 및/또는 필요에 따라 다양한 방법으로 도출될 수 있다.A method of deriving the L1 temporal motion information of the current block from the reconstructed neighboring blocks 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 needs.

이하, 복호화기 입장에서 도 6 및 도 7의 실시예에 따른 시간적 움직임 정보 도출 과정의 실시예가 서술된다.Hereinafter, an embodiment of a temporal motion information derivation process according to the embodiment of FIGS. 6 and 7 from the standpoint of the decoder 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인 경우, 부호화기 및 복호화기는 예측 블록 생성시에 움직임 보상을 수행할 수 있다.Inputs for the temporal motion information derivation process may include the position of the top-left sample of the current block (xP, yP), an input motion vector (mvLXCol), and an input reference picture number (RefPicOrder (currPic, refIdxLX, LX)). there is. Here, currPic may mean the current picture. Outputs of the process may be a motion vector (mvLXCol) used as the final temporal motion information and information indicating whether the final temporal motion information exists (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 can represent a motion vector, mvLX[0] can mean a motion vector of an x component, and mvLX[1] can mean a motion vector of a y component. refIdxLX may indicate an LX reference picture index indicating a reference picture in an LX reference picture list in which reference pictures are stored. If the refIdxLX value is 0, refIdxLX may indicate the first reference picture in the LX reference picture list, and if the refIdxLX value is -1, refIdxLX may indicate that no reference picture exists 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 value of predFlagLX is 1, an encoder and a decoder may perform motion compensation when generating a 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 (ie, the L0 reference picture number and the L1 reference picture number are the same), the encoder and The decryptor may perform the following process.

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

mvL1Col = mvL0AmvL1Col = mvL0A

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

mvL1Col = mvL0EmvL1Col = mvL0E

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

avilableFlagL1Col = 0 availableFlagL1Col = 0

그리고, 부호화기 및 복호화기는 다음 과정을 수행할 수 있다. Then, the encoder and 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 or not final temporal motion information for each of the L0 temporal motion information and the L1 temporal motion information exists.

도 8은 도 6의 실시예에 따른 시간적 움직임 정보 도출 과정을 수행할 수 있는 인터 예측 장치의 일 실시예를 개략적으로 나타내는 블록도이다. 도 8의 실시예에 따른 인터 예측 장치는 시간적 움직임 정보 판단부(810), 복원된 주변 블록 움직임 정보 판단부(820), 예측 방향 정보 재설정 및 L0 움직임 정보 설정부(830) 및 L1 시간적 움직임 정보 재설정부(840)를 포함할 수 있다.FIG. 8 is a block diagram schematically illustrating an embodiment of an inter-prediction apparatus capable 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 restored 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 identical and the L0 motion vector It may be determined whether the L1 motion vector and L1 are the same.

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

한편, 도 6에서 상술한 바와 같이 시간적 움직임 정보 판단부(810)는 L0 시간적 움직임 정보와 L1 시간적 움직임 정보의 동일성 여부가 아닌, L0 참조 픽쳐 번호 및 L1 참조 픽쳐 번호의 동일성 여부 또는 콜 블록의 예측 방향을 판단할 수도 있다. 예를 들어, L0 참조 픽쳐 번호 및 L1 참조 픽쳐 번호가 동일하지 않은 경우, 인터 예측 장치는 입력 시간적 움직임 정보를 그대로 현재 블록의 시간적 움직임 정보로 사용할 수 있고, L0 참조 픽쳐 번호 및 L1 참조 픽쳐 번호가 동일한 경우 복원된 주변 블록 움직임 정보 판단부(820)에 의한 판단 과정이 수행될 수 있다. 다른 예로, 콜 블록의 예측 방향이 양방향 예측인 경우, 인터 예측 장치는 입력 시간적 움직임 정보를 그대로 현재 블록의 시간적 움직임 정보로 사용할 수 있고, 콜 블록의 예측 방향이 단방향 예측인 경우 복원된 주변 블록 움직임 정보 판단부(820)에 의한 판단 과정이 수행될 수도 있다.Meanwhile, as described above with reference to FIG. 6 , the temporal motion information determining unit 810 determines whether the L0 temporal motion information and the L1 temporal motion information are identical, but whether the L0 reference picture number and the L1 reference picture number are identical or predicts a collocated block. direction can be determined. For example, when the L0 reference picture number and the L1 reference picture number are not the same, the inter-prediction device 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 In the same case, a determination process by the restored neighboring block motion information determining unit 820 may be performed. As another example, when the prediction direction of the collocated block is bidirectional prediction, the inter-prediction device may use input temporal motion information as it is as temporal motion information of the current block, and if the prediction direction of the collocated block is unidirectional prediction, the motion of the reconstructed neighboring blocks A judgment 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 (for example, 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 A process of resetting prediction direction information and setting L0 motion information by the resetting and L0 motion information setting unit 830 may be performed. In addition, when motion information of a reconstructed neighboring block exists (for example, when a block having motion information among reconstructed neighboring blocks at a predetermined position and/or a position selected by a predetermined method exists), L1 temporal motion A resetting 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 restored 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 restored neighboring blocks, it does not select the motion information having the zero vector (0,0). It is also possible to select only motion information that does not have zero vectors (0,0). Meanwhile, the L1 temporal motion information resetter 840 may reset the L1 temporal motion information of the current block based on the motion information candidate list of the current block. Since specific embodiments of each of the above-described methods have been described above with reference to FIGS. 6 and 7, they 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 later are 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 provide motion information of a current block derived based on a merge candidate list in merge mode and/or AMVP mode in addition to temporal motion information in merge mode and/or AMVP mode. The same or similar method can be applied to motion information of the current block derived based on the predicted motion vector candidate list.

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

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

L0 입력 시간적 움직임 정보와 L1 입력 시간적 움직임 정보가 동일하지 않은 경우, 즉 L0 입력 참조 픽쳐 번호와 L1 입력 참조 픽쳐 번호가 동일하지 않거나 및/또는 L0 입력 움직임 벡터와 L1 입력 움직임 벡터가 동일하지 않은 경우, 부호화기 및 복호화기는 콜 블록을 기반으로 도출된 입력 시간적 움직임 정보를 그대로 현재 블록의 시간적 움직임 정보로 사용할 수 있다. AMVP가 적용되는 경우, 상기 현재 블록의 시간적 움직임 정보는 현재 블록의 예측 움직임 벡터 후보로 결정되거나 등록될 수 있다. 또한, 머지가 적용되는 경우, 상기 현재 블록의 시간적 움직임 정보는 현재 블록의 머지 후보로 결정되거나 등록될 수 있다. When the L0 input temporal motion information and the L1 input temporal motion information are not identical, that is, when the L0 input reference picture number and the L1 input reference picture number are not identical and/or the L0 input motion vector and the L1 input motion vector are not identical , the encoder and decoder can use the input temporal motion information derived based on the collocated block as the temporal motion information of the current block. When AMVP is applied, the temporal motion information of the current block may be determined or registered as a predicted motion vector candidate of the current block. Also, when merge is applied, 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 other than a collocated block used for deriving input temporal motion information. For example, the encoder and 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 for the embodiments of FIGS. 9 to 11, for convenience of description, 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 subject to determination of 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 the second collocated block. Also, a collocated picture including a first collocated block is referred to as a first collocated picture, and a collocated picture including a second collocated block is referred to as a second collocated picture. Here, as an example, each of the first collocated picture and the second collocated picture may correspond to one picture among reference pictures included in the reference picture list.

제2 콜 블록의 움직임 정보가 존재하지 않는 경우(예를 들어, 소정의 위치 및/또는 소정의 방법으로 선택된 위치의 제2 콜 블록 중에서 움직임 정보를 갖는 블록이 존재하지 않는 경우), 부호화기 및 복호화기는 현재 블록의 예측 방향 정보를 단방향 예측으로 다시 설정할 수 있다(S930). 또한 이 때, 부호화기 및 복호화기는 L0 입력 시간적 움직임 정보만을 현재 블록의 시간적 움직임 정보로 사용할 수 있다.When motion information of the second collocated block does not exist (for example, 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), an encoder and a decoder The machine may reset the prediction direction information of the current block to unidirectional prediction (S930). Also, at this time, the encoder and decoder may use only L0 input temporal motion information as 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 decoder Motion information of the second collocated block may be used as final L1 temporal motion information of the current block (S940). That is, at this time, the encoder and 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. At this time, 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 unidirectional prediction (S930). Also, at this time, the encoder and decoder may use only L0 input temporal motion information as final temporal motion information of the current block.

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

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

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

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

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

또 다른 실시예로, 부호화기 및 복호화기는 제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 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 the zero vector (0,0). In this case, in step S940 described above, the encoder and decoder may reset the motion vector(s) corresponding to the zero vector (0,0). For example, the motion vector(s) corresponding to the zero vector (0,0) may be set as a motion vector of the second collocated block, and as another example, the motion vector (s) corresponding to the zero vector (0,0) s) 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 around the first collocated block. may be set. As another embodiment, the encoder and 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 does not correspond to the zero vector (0,0). . In this case, in step S940 described above, the encoder and decoder may reset the 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 condition for determining whether to perform the steps S920 to S940 is not limited to the above-described embodiment, 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, they are highly likely to correspond to motion information caused by movement of an object. Therefore, when the encoder and decoder search motion information to be used as the final L1 temporal motion information of the current block in the second collocated block, motion information having zero vector (0,0) is not selected and zero vector (0,0) Motion information that does not have may be selected. This is because a block having motion information corresponding to the 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, the encoder and decoder may select motion information that is not the same as the L0 input temporal motion information when searching for motion information to be used as final L1 temporal motion information of the current block in the second collocated block. 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 decoder recall blocks having motion information different from the L0 input temporal motion information of the current block. It may be determined as a block used for deriving final L1 temporal motion information. In this case, the encoder and decoder may select only motion information having a difference of less than a predetermined threshold with the L0 input temporal motion information of the current block as the motion information to be used as the final L1 temporal motion information. Here, the predetermined threshold may be determined based on mode information of the current block, motion information of the current block, mode information of neighboring blocks, and/or motion information of neighboring blocks, and the like, 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 decoder may determine one of the L0 motion information and the L1 motion information as motion information to be used as final L1 temporal motion information of the current block. For example, the encoder and decoder may use L0 motion information of the second collocated block as final L1 temporal motion information for the current block. At this time, when L0 motion information does not exist in the second collocated block, the encoder and decoder may use the L1 motion information of the second collocated block as final L1 temporal motion information for the current block. As another example, the encoder and decoder may use the L1 motion information of the second collocated block as final L1 temporal motion information for the current block. At this time, when L1 motion information does not exist in the second collocated block, the encoder and decoder may use the L0 motion information of the second collocated block as final L1 temporal motion information for the current block.

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

일 실시예로, 부호화기 및 복호화기는 제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 픽셀 크기만큼 이동, 정수 픽셀 크기만큼 이동)은 수평 방향 성분 및 수직 방향 성분에 대해 각각 독립적으로 적용될 수도 있다. 이 때, 수평 방향의 이동 거리 및 수직 방향의 이동 거리는 서로 다를 수도 있다.As an embodiment, the encoder and the decoder move 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 can be used as final L1 temporal motion information (L1 motion vector) of the current block. For 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. Here, 1/4 pixel unit is 1 corresponds to.) may be used as the final L1 temporal motion information of the current block. As another example, the encoder and 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. Here, 1/4 pixel unit is 1 corresponds to.) may be used as the final L1 temporal motion information of the current block. As another example, the encoder and the decoder have an integer pixel size (eg, (-4,0), (4,0), (0) in the vertical and/or horizontal direction at a 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 units equals 1 corresponding.) may be used as the final L1 temporal motion information of the current block. Meanwhile, since a motion vector includes a vertical component and a horizontal component, the above-described methods (movement by 1/4 pixel size, movement by 1/2 pixel size, and movement by integer pixel size) Each component may be applied independently. In this case, the movement distance in the horizontal direction and the movement 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 decoder may change the value of the motion information (motion vector) of the first collocated block to a value in another pixel unit and then use the changed value as the final L1 temporal motion information (L1 motion vector) of the current block. there is. For example, when the motion information value of the first collocated block is a value in 1/4 pixel units, the encoder and decoder change the motion information value of the first collocated block to a value in 1/2 pixel units based on a shift operation or the like. and the changed value may be used as 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 1/2 pixel units, the encoder and decoder may change the motion information value of the first collocated block to a value in integer pixel units based on a shift operation, , the changed value may be used as 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 depending on implementation and/or needs. In addition, the methods according to the above-described embodiment can 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 indices 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 motion information of a reconstructed neighboring block.

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 a reset process for the L1 input reference picture index are described.

일 실시예로, 부호화기 및 복호화기는 제2 콜 블록을 기반으로 L1 입력 참조 픽쳐 인덱스를 재설정할 수 있다. 상술한 바와 같이, 부호화기 및 복호화기는 제2 콜 블록의 움직임 정보를 현재 블록의 최종 L1 시간적 움직임 정보로 사용할 수 있다. 이 때, 부호화기 및 복호화기는 L1 입력 참조 픽쳐 인덱스를 상기 제2 콜 블록의 참조 픽쳐 인덱스로 재설정함으로써 최종 L1 참조 픽쳐 인덱스를 도출할 수 있다. 다른 실시예로, 부호화기 및 복호화기는 L1 입력 참조 픽쳐 인덱스 값을 소정의 고정된 참조 픽쳐 인덱스 값으로 재설정함으로써 최종 L1 참조 픽쳐 인덱스를 도출할 수도 있다.As an embodiment, the encoder and decoder may reset the L1 input reference picture index based on the second collocated block. As described above, the encoder and decoder may use motion information of the second collocated block as final L1 temporal motion information of the current block. At this time, the encoder and 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 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일 확률이 높기 때문이다.As 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 and use them 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 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 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 value. Among the reference picture indices of the reconstructed neighboring block, a reference picture index that is not the same as the L0 input reference picture index may exist. In this case, for example, the encoder and decoder may use the most frequently used reference picture index among reference picture indices 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 decoder may use a reference picture index having the smallest non-negative value among 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 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 without a reset process, or may be used as the final L1 reference picture index after a 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 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 process of resetting a motion vector and a process of resetting a reference picture index (eg, RefIdxLX, X=0,1). In the following embodiments, it is assumed that the L1 input motion vector is reset based on the second collocated block. That is, it is assumed that the encoder and 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 decoder may use the first collocated picture used for deriving the L0 input temporal motion information as a second collocated picture, and the second collocated block may be derived from the second collocated picture. In this case, the encoder and 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 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 without a resetting process. That is, the encoder and the decoder can directly allocate the L1 input reference picture index to the L1 temporal motion information of the current block. 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 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 to derive the L0 input temporal motion information as a second collocated picture as it is, as in the above-described embodiment, and the second collocated block is the second collocated picture can be derived from At this time, the encoder and the decoder derive a motion vector having a difference between the L0 input motion vector and the L0 input motion vector equal to or less than a predetermined threshold among the motion vectors of the second collocated block in order to reset the L1 input motion vector. can do. The encoder and 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 without a resetting process. That is, the encoder and the decoder can directly allocate the L1 input reference picture index to the L1 temporal motion information of the current block. 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 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 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 the same as the first collocated picture. As another example, the encoder and decoder may select a reference picture most frequently used as the second collocate picture based on reference picture indices of the reconstructed neighboring blocks. The second collocated block may be derived from the second collocated picture, and in this case, the encoder and 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 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 without a resetting process. That is, the encoder and the decoder can directly allocate the L1 input reference picture index to the L1 temporal motion information of the current block. 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 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 decoder may use a reference picture that is not the same as the first collocated picture used for deriving L0 input temporal motion information as the second collocated picture, as in the above-described embodiment, and the second collocated block. may be derived from the second call 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 the same as the first collocated picture. As another example, the encoder and decoder may select a reference picture most frequently used as the second collocate picture based on reference picture indices of the reconstructed neighboring blocks. At this time, the encoder and the decoder derive a motion vector having a difference between the L0 input motion vector and the L0 input motion vector equal to or less than a predetermined threshold among the motion vectors of the second collocated block in order to reset the L1 input motion vector. can do. The encoder and 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 without a resetting process. That is, the encoder and the decoder can directly allocate the L1 input reference picture index to the L1 temporal motion information of the current block. 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 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 needs. there is.

한편, 재설정된 L1 시간적 움직임 정보는 현재 블록의 L0 시간적 움직임 정보와 동일할 수 있다. 따라서, 재설정된 L1 시간적 움직임 정보가 현재 블록의 L0 시간적 움직임 정보와 동일한 경우, 부호화기 및 복호화기는 현재 블록의 예측 방향 정보를 단방향 예측으로 다시 설정할 수도 있다. 이 때, 부호화기 및 복호화기는 L0 시간적 움직임 정보만을 현재 블록의 시간적 움직임 정보로 사용할 수 있다. 이러한 방법은 상술한 실시예들과 결합된 조합으로서 본 발명에 적용될 수도 있다.Meanwhile, the reset L1 temporal motion information may be identical to 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 decoder may reset the prediction direction information of the current block to unidirectional prediction. At this time, the encoder and decoder may use only L0 temporal motion information as temporal motion information of the current block. This method may be applied to the present invention as a combined combination 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 existing in the spatially co-located position of the current block in the second collocated picture. In FIG. 10, block 1010 represents a current block, and block 1020 represents a co-located block in a second collocated picture. Here, the second call picture may be determined in various ways.

일 실시예로, 부호화기 및 복호화기는 L0 참조 픽쳐 리스트에 포함된 참조 픽쳐 중에서 하나의 참조 픽쳐를 제2 콜 픽쳐로 결정할 수 있다. 일례로, 부호화기 및 복호화기는 L0 참조 픽쳐 리스트 내의 첫 번째 참조 픽쳐를 제2 콜 픽쳐로 결정할 수 있다. 다른 예로, 부호화기 및 복호화기는 L0 참조 픽쳐 리스트 내의 두 번째 참조 픽쳐를 제2 콜 픽쳐로 결정할 수 있다. 또 다른 예로, 부호화기 및 복호화기는 L0 참조 픽쳐 리스트 내의 세 번째 참조 픽쳐를 제2 콜 픽쳐로 결정할 수 있다. 또 다른 예로, 부호화기 및 복호화기는 L0 참조 픽쳐 리스트 내의 네 번째 참조 픽쳐를 제2 콜 픽쳐로 결정할 수도 있다.As an embodiment, the encoder and decoder may determine one reference picture from among reference pictures included in the L0 reference picture list as the second collocated picture. For example, the encoder and decoder may determine the first reference picture in the L0 reference picture list as the second collocated picture. As another example, the encoder and decoder may determine the second reference picture in the L0 reference picture list as the second collocated picture. As another example, the encoder and decoder may determine the third reference picture in the L0 reference picture list as the second collocated picture. As another example, the encoder and 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 decoder may determine one reference picture from among reference pictures included in the L1 reference picture list as the second collocated picture. For example, the encoder and decoder may determine the first reference picture in the L1 reference picture list as the second collocated picture. As another example, the encoder and decoder may determine the second reference picture in the L1 reference picture list as the second collocated picture. As another example, the encoder and decoder may determine the third reference picture in the L1 reference picture list as the second collocated picture. As another example, the encoder and 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 the decoder selects a 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 a second call picture. Here, the coding 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. At this time, the encoder may derive a second collocated picture based on the coding efficiency, and may transmit second collic picture information indicating the second collocated picture to the decoder. The decoder may determine a second collocated picture based on the transmitted second collocated picture information.

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

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

한편, 도 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라 한다.Meanwhile, in the embodiment of FIG. 10 , a block located at the center inside the co-located block 1020 is block D, and a block located at the upper left corner inside the co-located block 1020 is block S, and the inside of the co-located block 1020 The block located at the lower left corner of is called block Q, the block located at the upper right corner inside the co-located block 1020 is called block R, and the block located at the lower right corner inside the co-located block 1020 is called block C. In addition, among blocks adjacent to the left side of the co-located block 1020, the uppermost block is block F, and among the blocks adjacent to the left side of the co-located block 1020, the lowermost block is block J, co-located block 1020. Among the blocks adjacent to the top of, the leftmost block is block G, and among the blocks adjacent to the top of the same position block 1020, the rightmost block is block M, and the topmost block among the blocks adjacent to the right of the same position block 1020 The block located at is block N, the block located at the bottom among the blocks adjacent to the right of the co-located block 1020 is block B, the block located at the leftmost among the blocks adjacent to the bottom of the co-located 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 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 upper right corner outside the co-located block 1020 The located block is referred to as block L, and the block located at the lower right corner outside the co-located 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 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 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 in various ways.

일 실시예로, 부호화기 및 복호화기는 동일 위치 블록의 내부 및/또는 외부에 위치한 블록 중에서 동일 위치 블록을 기준으로 소정의 위치에 존재하는 한 개의 블록으로부터 최종 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 co-located block among blocks located inside and/or outside the co-located block. can do. At this time, one block existing at the predetermined location may correspond to the second collocated block. Here, the blocks at the predetermined positions are Block A, Block B, Block C, Block D, Block E, Block F, Block G, Block H, Block I, Block J, Block K, Block L, Block M, and 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 decoder may scan a plurality of blocks located at a predetermined position among blocks located inside and/or outside the block at the same position in a predetermined order. In this case, the encoder and decoder may use motion information of a first block having motion information in the scan order as final L1 temporal motion information of the current block. Here, the first block in which the motion information exists may correspond to a second collocated block. A scan target block and scan order may be determined in various forms. For example, the encoder and decoder may scan 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 a median value for motion information of a plurality of blocks existing at predetermined positions among blocks located inside and/or outside the block at the same location, and the derived median 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 시간적 움직임 정보는 구현 및/또는 필요에 따라 다양한 방법으로 도출될 수 있다.The 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 needs.

도 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 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 determining unit 1110, a second collocated block motion information determining unit 1120, a prediction direction 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 determination unit 1110 determines whether or not 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 determine whether the L0 input motion vector and the L1 input motion vector are the same.

L0 입력 시간적 움직임 정보와 L1 입력 시간적 움직임 정보가 동일하지 않은 경우, 인터 예측 장치는 입력 시간적 움직임 정보를 그대로 현재 블록의 시간적 움직임 정보로 사용할 수 있다. AMVP가 적용되는 경우, 상기 현재 블록의 시간적 움직임 정보는 현재 블록에 대한 예측 움직임 벡터 후보로 결정되거나 등록될 수 있다. 또한, 머지가 적용되는 경우, 상기 현재 블록의 시간적 움직임 정보는 현재 블록에 대한 머지 후보로 결정되거나 등록될 수 있다. L0 입력 시간적 움직임 정보와 L1 입력 시간적 움직임 정보가 동일한 경우에는 제2 콜 블록 움직임 정보 판단부(1120)에 의한 판단 과정이 수행될 수 있다. If the L0 input temporal motion information and the L1 input temporal motion information are not the same, the inter prediction device may use the input temporal motion information as it is as the temporal motion information of the current block. When AMVP is applied, the temporal motion information of the current block may be determined or registered as a predicted motion vector candidate for the current block. Also, when merge is applied, 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 determining unit 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 with reference to 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, if the L0 input reference picture number and the L1 input reference picture number are not the same, the inter prediction device 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 the L1 input reference picture number When the reference picture numbers are the same, a decision process by the second collocated block motion information determiner 1120 may be performed. As another example, when the prediction direction of the first collocated block is bidirectional prediction, the inter-prediction device may use the input temporal motion information as it is as the temporal motion information of the current block, and if the prediction direction of the first collocated block is unidirectional prediction, the inter-prediction device may use the input temporal motion information as it is. 2 A decision process by the collocated block motion information determining unit 1120 may be performed.

제2 콜 블록 움직임 정보 판단부(1120)는 제2 콜 블록의 움직임 정보가 존재하는지 여부를 판단할 수 있다. 제2 콜 블록의 움직임 정보가 존재하지 않는 경우(예를 들어, 소정의 위치 및/또는 소정의 방법으로 선택된 위치의 제2 콜 블록 중에서 움직임 정보를 갖는 블록이 존재하지 않는 경우), 예측 방향 정보 재설정 및 L0 움직임 정보 설정부(1130)에 의한 예측 방향 정보 재설정 및 L0 움직임 정보 설정 과정이 수행될 수 있다. 또한, 제2 콜 블록의 움직임 정보가 존재하는 경우(예를 들어, 소정의 위치 및/또는 소정의 방법으로 선택된 위치의 제2 콜 블록 중에서 움직임 정보를 갖는 블록이 존재하는 경우), L1 시간적 움직임 정보 재설정부(1140)에 의한 재설정 과정이 수행될 수 있다.The second collocated block motion information determining unit 1120 may determine whether motion information of the second collocated block exists. When motion information of the second collocated block does not exist (for example, 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 A process of resetting prediction direction information and setting L0 motion information by the resetting and L0 motion information setting unit 1130 may be performed. In addition, 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), L1 temporal motion 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 there is motion information of the second collocated block, the L1 temporal motion information resetter 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 motion information of the second collocated block as final L1 temporal motion information of the current block. At this time, when the motion information of the second collocated block includes the zero vector (0,0), the L1 temporal motion information resetter 1140 converts the motion information of blocks located around the second collocated block to the final block of the current block. It can also be used as L1 temporal motion information. Since specific embodiments of each of the above-described methods have been described above with reference to FIGS. 6 and 7, they will be omitted herein.

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

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

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

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

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

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

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

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

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

한편, 상기 도출된 현재 블록의 움직임 정보에서 L0 움직임 정보 및 L1 움직임 정보는 서로 동일할 수도 있다. 따라서, 상기 L0 움직임 정보와 상기 L1 움직임 정보가 동일한 경우, 부호화기 및 복호화기는 현재 블록의 예측 방향 정보를 단방향 예측으로 다시 설정할 수 있다. 이 때, 부호화기 및 복호화기는 L0 움직임 정보만을 현재 블록의 움직임 정보로 사용할 수 있다. Meanwhile, in the derived motion information of the current block, L0 motion information and 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. At this time, the encoder and decoder may use only L0 motion information as motion information of the current block.

도 13은 도 12의 실시예에 따른 움직임 정보 도출 과정을 수행할 수 있는 인터 예측 장치의 일 실시예를 개략적으로 나타내는 블록도이다. 도 13의 실시예에 따른 인터 예측 장치는 L0 움직임 정보 설정부(1310), L1 움직임 정보 설정부(1320) 및 움직임 정보 통합부(1330)를 포함할 수 있다.FIG. 13 is a block diagram schematically illustrating an embodiment of an inter-prediction apparatus capable of deriving motion information 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 integrating unit 1330.

도 12의 실시예에서 상술한 바와 같이, 부호화기 및 복호화기는 L0 움직임 정보 및 L1 움직임 정보를 각각 독립적으로 설정할 수 있다. 이 때, 부호화기 및 복호화기는 L0 움직임 정보 및 L1 움직임 정보 중에서 하나는 복원된 주변 블록을 기반으로 공간적으로 도출하고 다른 하나는 콜 블록을 기반으로 시간적으로 도출할 수 있다.As described above in the embodiment of FIG. 12, the encoder and decoder can independently set L0 motion information and L1 motion information. 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 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. At this time, the encoder and decoder use motion information (spatial motion information) derived spatially based on the reconstructed neighboring blocks as L0 motion information, or motion information temporally derived based on the collocated block (temporal motion information). can be used as L0 motion information. That is, the L0 motion information may be spatially derived based on a reconstructed neighboring block or temporally derived based on a 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) derived spatially based on the reconstructed neighboring block as L1 motion information or motion information derived temporally (temporal motion information) based on the collocated block. can be used as L1 motion information. That is, the L1 motion information may be spatially derived based on a reconstructed neighboring block or temporally derived based on a collocated block.

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

다시 도 13을 참조하면, 움직임 정보 통합부(1330)는 L0 움직임 정보 설정부(1310)에서 설정된 L0 움직임 정보 및 L1 움직임 정보 설정부(1320)에서 설정된 L1 움직임 정보를 통합함으로써, 현재 블록의 움직임 정보를 도출할 수 있다.Referring back to FIG. 13 , the motion information integration unit 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 integrating the motion of 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 later are 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 merge mode and/or AMVP mode, but also motion information of a current block derived based on a merge candidate list in merge mode and/or AMVP mode. The same or similar method can be applied to motion information of the current block derived based on the predicted motion vector candidate list.

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

도 14를 참조하면, 부호화기 및 복호화기는 콜 블록을 기반으로 도출된 시간적 움직임 정보에서 L0 시간적 움직임 정보와 L1 시간적 움직임 정보가 동일한지 여부, 즉 L0 참조 픽쳐 번호와 L1 참조 픽쳐 번호가 동일하고 L0 움직임 벡터와 L1 움직임 벡터가 동일한지 여부를 판단할 수 있다(S1410).Referring to FIG. 14, an encoder and a decoder determine whether L0 temporal motion information and L1 temporal motion information are the same in temporal motion information derived based on a collocated block, that is, if the L0 reference picture number and the L1 reference picture number are the same and the L0 motion 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 and 15 to be described later, for convenience of description, the temporal motion information input in 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 the input motion vector (L0 input motion vector, L1 input motion vector), and the reference picture index included in the input temporal motion information is the input reference picture index (L0 input reference picture index, L1 input reference picture index) and reference picture numbers included in the input temporal motion information are referred to as input reference picture numbers (L0 input reference picture numbers, L1 input reference picture numbers). Also, in an embodiment described later, a reference picture indicated by an L0 input reference picture index is referred to as an L0 reference picture, and a reference picture indicated by an L1 input reference picture index 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 identical, that is, when the L0 reference picture number and the L1 reference picture number are not identical and/or the L0 motion vector and the L1 input motion vector are not identical, the encoder and decoder Input temporal motion information derived based on the collocated block may be used as 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 predictive 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 L0 input temporal motion information and L1 input temporal motion information are the same, the L1 reference picture may correspond to the same picture as the L0 reference picture. Therefore, 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 for and derive motion information from the L1 reference picture in the same way. In this case, the encoder may not transmit 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, include the derived motion information in a bitstream, and transmit the motion information to the decoder. At this time, 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 by the encoder may include a reference picture index and motion vector, and the encoder may independently transmit the reference picture index and motion vector to the decoder. At this time, 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 decoder may use motion information derived from the L1 reference picture as final L1 temporal motion information of the current block (S1430). That is, at this time, the encoder and decoder may reset the L1 input temporal motion information value to the motion information value derived from the L1 reference picture.

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

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

다른 예로, 부호화기는 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 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 block corresponding to the derived region and the position of the current block, 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 L1 temporal motion information may be derived. The derived motion information may be included in a bitstream and transmitted from an encoder to a decoder. At this time, 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 decoder may use the reference picture index (and/or reference picture index) derived from the L1 reference picture as final L1 temporal motion information of the current block.

L1 참조 픽쳐를 기반으로 최종 L1 시간적 움직임 정보로 사용될 움직임 정보를 도출하는 방법은 상술한 실시예에 한정되지 않으며, 부호화기 및 복호화기는 구현 및/또는 필요에 따라 다른 방식으로 움직임 정보를 도출할 수도 있다.The method of deriving the 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 needs. .

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

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

다른 실시예로, 부호화기 및 복호화기는 콜 블록에 움직임 정보가 존재하는지 여부에 관한 정보를 기반으로 S1420 내지 S1430 과정의 수행 여부를 결정할 수도 있다. 일례로, 부호화기 및 복호화기는 콜 블록에 움직임 정보가 존재하지 않는 경우에 S1420 내지 S1430 과정을 수행할 수 있다. 이 경우, 상술한 S1430 단계에서는 L1 입력 시간적 움직임 정보가 아닌 L0 입력 시간적 움직임 정보가 재설정될 수 있다. 즉, 부호화기 및 복호화기는 L0 입력 시간적 움직임 정보를 L1 참조 픽쳐의 움직임 정보로 재설정할 수 있으며, 현재 블록에 대해 양방향 예측이 아닌 단방향 예측을 수행할 수 있다. 또한, 콜 블록에 움직임 정보가 존재하지 않는 경우, 상술한 S1430 단계에서 부호화기 및 복호화기는 L0 입력 시간적 움직임 정보와 L1 입력 시간적 움직임 정보를 모두 재설정할 수도 있다. 즉, 부호화기 및 복호화기는 L0 입력 시간적 움직임 정보 및 L1 입력 시간적 움직임 정보를 모두 L1 참조 픽쳐의 움직임 정보로 재설정할 수 있으며, 현재 블록에 대해 양방향 예측을 수행할 수도 있다.As another embodiment, the encoder and decoder may determine whether or not to perform processes S1420 to S1430 based on information on whether motion information exists in the collocated block. For example, the encoder and decoder may perform steps S1420 to S1430 when motion information does not exist in the collocated block. In this case, in step S1430 described above, L0 input temporal motion information instead of L1 input temporal motion information may be reset. That is, the encoder and decoder may reset the L0 input temporal motion information to the motion information of the L1 reference picture, and perform unidirectional prediction rather than bidirectional prediction on the current block. In addition, when motion information does not exist in the collocated block, the encoder and decoder may reset both the L0 input temporal motion information and the L1 input temporal motion information in step S1430 described above. That is, the encoder and 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 bi-directional 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 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 correspond to the zero vector (0,0). In this case, in step S1430 described above, the encoder and decoder may reset the motion vector(s) corresponding to the zero vector (0,0). For example, the motion vector(s) corresponding to the zero vector (0,0) may be set as a 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 around the collocated block. there is. As another embodiment, the encoder and 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 does not correspond to the zero vector (0,0). In this case, in step S1430 described above, the encoder and decoder may reset the motion vector(s) that do not correspond to the zero vector (0,0), and the motion vector(s) that does 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 embodiment, 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, motion information derived from the L1 reference picture may be the same as L0 input temporal motion information of the current block. Accordingly, 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 L1 reference picture, they may find only motion information that is not identical to 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 decoder only use motion information different from the L0 input temporal motion information of the current block as the final L1 temporal motion information. can be used as In this case, the encoder and decoder may select only motion information having a difference of less than a predetermined threshold with the L0 input temporal motion information of the current block as the motion information to be used as the final L1 temporal motion information. Here, the predetermined threshold may be determined based on mode information of the current block, motion information of the current block, mode information of neighboring blocks, and/or motion information of neighboring blocks, and the like, 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 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 collocated block as described above, and the L0 input reference picture index and the L1 input reference picture index may be 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 indices 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 motion information of a reconstructed neighboring block.

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 resetting 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 decoder may reset both the L0 input reference picture index and the L1 input reference picture index to a value of 0 and use them as the 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 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 input L1 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 without a reset process, or may be used as the final L1 reference picture index after a 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 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 identical to 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 decoder may reset the prediction direction information of the current block to unidirectional prediction. At this time, the encoder and decoder may use only L0 temporal motion information as temporal motion information of the current block. This method can be applied to the present invention as a combined 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 deriving temporal motion information according to the embodiment of FIG. 14 . The inter-prediction device according to the embodiment of FIG. 15 may include a temporal motion information determination unit 1510, a motion estimation unit 1520, and an L1 temporal motion information resetting unit 1530.

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

도 15를 참조하면, 도 11을 참조하면, 시간적 움직임 정보 판단부(1510)는 입력 시간적 움직임 정보에서 L0 입력 시간적 움직임 정보와 L1 입력 시간적 움직임 정보가 동일한지 여부, 즉 L0 입력 참조 픽쳐 번호와 L1 입력 참조 픽쳐 번호가 동일하고 L0 입력 움직임 벡터와 L1 입력 움직임 벡터가 동일한지 여부를 판단할 수 있다. Referring to FIG. 15 and FIG. 11 , the temporal motion information determination 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 the L1 input temporal motion information. 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)에 의한 프로세스가 수행될 수 있다. If the L0 input temporal motion information and the L1 input temporal motion information are not the same, the inter prediction device may use the input temporal motion information as it is as the temporal motion information of the current block. When AMVP is applied, the temporal motion information of the current block may be determined or registered as a predicted motion vector candidate for the current block. Also, when merge is applied, 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 determiner 1510 determines whether the L0 input temporal motion information and the L1 input temporal motion information are identical, but whether the L0 input reference picture number and the L1 input reference picture number are identical or the prediction direction of the collocated block. 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 can be used as the temporal motion information of the current block, and the L0 input reference picture number and the L1 input reference picture number In the same case, a 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 if the prediction direction of the collocated block is unidirectional prediction, the process by the motion predictor 1520 may be performed.

다시 도 15를 참조하면, L0 입력 시간적 움직임 정보와 L1 입력 시간적 움직임 정보가 동일한 경우, 움직임 예측부(1520)는 L1 참조 픽쳐에서 최종 L1 시간적 움직임 정보로 사용될 움직임 정보를 탐색하거나 도출할 수 있다. Referring back to FIG. 15 , when L0 input temporal motion information and L1 input temporal motion information are the same, the motion predictor 1520 searches for or derives 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 prediction unit 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. At this time, the motion predictor 1520 may derive motion information to be used as final L1 temporal motion information of the current block based on the derived region. For example, the motion estimation unit 1520 may derive a motion vector to be used as the final L1 temporal motion information based on the location of the block corresponding to the derived area and the location of the current block, and the motion vector corresponding to the derived area Based on the block, a reference picture index (and/or reference picture number) to be used as final L1 temporal motion information may be derived.

한편, 움직임 예측부(1520)가 부호화기측의 구성 요소에 해당되는 경우, 부호화기는 상기 방법에 의해 L1 참조 픽쳐에서 도출된 움직임 정보를 비트스트림에 포함시켜 복호화기로 전송할 수도 있다. L1 참조 픽쳐에서 도출된 움직임 정보는 참조 픽쳐 인덱스 및 움직임 벡터 등을 포함할 수 있고, 부호화기는 상기 참조 픽쳐 인덱스와 움직임 벡터를 각각 독립적으로 복호화기로 전송할 수 있다. 이 때, 부호화기는 현재 블록의 실제 움직임 벡터 및 L1 참조 픽쳐로부터 도출된 움직임 벡터의 차분 값을 구한 후, 그 차분 값을 복호화기로 전송할 수도 있다. Meanwhile, when the motion estimation unit 1520 corresponds to a component of the encoder, the encoder may include motion information derived from the L1 reference picture by the above method in a bitstream and transmit it to the decoder. 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 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 final L1 temporal motion information based on the transmitted motion information. That is, when the motion predictor 1520 corresponds to a decoder-side component, the motion predictor 1520 determines the final motion information based on 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 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 resetter 1530 may reset the L1 input temporal motion information value to the value of motion information derived by the motion predictor 1520 (motion information derived from the L1 reference picture). .

상술한 도 6 내지 도 15의 실시예들은, 각각 개별적으로 적용될 수도 있으나, 각 블록의 부호화 모드에 따라 다양한 방법으로 조합되어 적용될 수도 있다. 이하, 후술되는 실시예들에서 부호화 모드가 머지 모드인 블록은 머지 블록이라 한다. 머지 블록이 아닌 블록에는, 예를 들어 부호화 모드가 AMVP 모드인 블록 등이 있을 수 있다. 또한, 후술되는 실시예들에서 현재 블록은 경우에 따라 머지 블록 또는 머지 블록이 아닌 블록 중 하나에 해당될 수 있다.The above-described embodiments of FIGS. 6 to 15 may be applied individually, but may also be combined and applied in various ways according to the coding mode of each block. Hereinafter, in embodiments to be described later, a block whose coding mode is a merge mode is referred to as a merge block. Blocks that are not merge blocks may include, for example, blocks whose encoding mode is the AMVP mode. In addition, in embodiments to be described later, the current block may correspond to either a merge block or a non-merge block according to circumstances.

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

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

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

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

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

상술한 실시예는 다양한 양태의 예시들을 포함한다. 다양한 양태들을 나타내기 위한 모든 가능한 조합을 기술할 수는 없지만, 해당 기술 분야의 통상의 지식을 가진 자는 다른 조합이 가능함을 인식할 수 있을 것이다. 따라서, 본 발명은 이하의 특허청구범위 내에 속하는 모든 다른 교체, 수정 및 변경을 포함한다고 할 것이다.The foregoing embodiment includes examples of various aspects. It is not possible to describe all possible combinations to represent the various aspects, but those skilled 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 (2)

영상 부호화 방법에 있어서,
현재 블록의 예측 모드를 화면간 예측 모드로 결정하는 단계;
상기 현재 블록의 움직임 벡터를 도출하는 단계;
상기 도출된 움직임 벡터에 기반하여 상기 현재 블록에 대해 움직임 보상을 수행함으로써, 상기 현재 블록에 대응하는 예측 샘플을 획득하는 단계;
상기 예측 샘플에 기반하여, 상기 현재 블록에 대한 잔차 샘플을 획득하는 단계;
상기 현재 블록의 공간적 주변 블록을 이용하여, 현재 블록의 공간적 움직임 벡터를 도출하는 단계;
상기 현재 블록의 콜 픽쳐를 결정하는 단계;
상기 콜 픽쳐 내에서 상기 현재 블록에 대응하는 콜 블록의 움직임 벡터를 기반으로 시간적 움직임 벡터를 도출하는 단계; 여기서, 상기 콜 블록은 현재 블록의 우측-하단 픽셀의 위치를 포함하는 제1 블록 또는 상기 현재 블록의 중앙 위치를 포함하는 제2 블록 중 어느 하나에 따라 결정되며, 상기 콜 블록은 상기 제1 블록 및 상기 제2 블록을 기설정된 스캔 순서에 따라 스캐닝 하여 결정 됨
상기 공간적 움직임 벡터 및 상기 시간적 움직임 벡터를 이용하여 상기 현재 블록에 대한 예측 움직임 벡터 후보 리스트를 생성하는 단계; 및
상기 콜 픽쳐에 대한 콜 픽쳐 정보를 비트스트림에 부호화하는 단계를 포함하되,
상기 콜 픽쳐 정보는 참조 픽쳐 리스트 내의 참조 픽쳐들 중에서 상기 현재 블록의 콜 픽쳐로 결정되는 픽쳐를 특정하는 정보이며, 상기 비트스트림을 통해 복호화기로 전송되는 것을 특징으로 하는, 영상 부호화 방법.
In the video encoding method,
determining a prediction mode of a 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 using spatial 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 any one of a first block including the position of the lower-right pixel of the current block or a second block including the center position of the current block, and the collocated block is the first block and determined by scanning the second block according to a preset scan order.
generating a predicted motion vector candidate list for the current block using the spatial motion vector and the temporal motion vector; and
Encoding call picture information for the call picture into a bitstream,
The call picture information is information specifying a picture determined as the call picture of the current block among reference pictures in a reference picture list, and is transmitted to a decoder through the bitstream.
영상 부호화 방법에 의해 생성된 비트스트림을 포함하는 기록 매체에 있어서,
상기 비트스트림은 콜 픽처에 대한 콜 픽처 정보를 포함하고,
상기 비트스트림에 포함된 정보에 기초하여 현재 블록의 예측 모드를 화면간 예측 모드로 결정하는 단계;
상기 현재 블록의 움직임 벡터를 도출하는 단계;
상기 도출된 움직임 벡터에 기반하여 상기 현재 블록에 대해 움직임 보상을 수행함으로써, 상기 현재 블록에 대응하는 예측 샘플을 획득하는 단계;
상기 예측 샘플에 기반하여, 상기 현재 블록에 대한 잔차 샘플을 획득하는 단계;
상기 현재 블록의 공간적 주변 블록을 이용하여, 현재 블록의 공간적 움직임 벡터를 도출하는 단계;
상기 현재 블록의 상기 콜 픽쳐를 결정하는 단계;
상기 콜 픽쳐 내에서 상기 현재 블록에 대응하는 콜 블록의 움직임 벡터를 기반으로 시간적 움직임 벡터를 도출하는 단계; 여기서, 상기 콜 블록은 현재 블록의 우측-하단 픽셀의 위치를 포함하는 제1 블록 또는 상기 현재 블록의 중앙 위치를 포함하는 제2 블록 중 어느 하나에 따라 결정되며, 상기 콜 블록은 상기 제1 블록 및 상기 제2 블록을 기설정된 스캔 순서에 따라 스캐닝 하여 결정 됨,
상기 공간적 움직임 벡터 및 상기 시간적 움직임 벡터를 이용하여 상기 현재 블록에 대한 예측 움직임 벡터 후보 리스트를 생성하는 단계; 및
상기 콜 픽쳐에 대한 상기 콜 픽쳐 정보를 상기 비트스트림에 부호화하는 단계를 포함하되,
상기 콜 픽쳐 정보는 참조 픽쳐 리스트 내의 참조 픽쳐들 중에서 상기 현재 블록의 콜 픽쳐로 결정되는 픽쳐를 특정하는 정보이며, 상기 비트스트림을 통해 복호화기로 시그널링되는 것을 특징으로 하는 영상 부호화 방법에 의해 생성된 비트스트림을 저장하는 기록 매체.
In a recording medium containing a bitstream generated by an image encoding method,
The bitstream includes call picture information for a call picture,
determining a prediction mode of a 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 spatial 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 any one of a first block including the position of the lower-right pixel of the current block or a second block including the center position of the current block, and the collocated block is the first block and determined by scanning the second block according to a preset scan order;
generating a predicted motion vector candidate list for the current block using the spatial motion vector and the temporal motion vector; and
Encoding the call picture information for the call picture into the bitstream,
The collocated picture information is information specifying a picture determined as the collocated picture of the current block among reference pictures in a reference picture list, and is signaled to a decoder through the bitstream. A recording medium that stores streams.
KR1020230039525A 2011-07-12 2023-03-27 Method for inter prediction and apparatus thereof KR102626368B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020240005610A KR20240010747A (en) 2011-07-12 2024-01-12 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
KR1020220084353A KR102515824B1 (en) 2011-07-12 2022-07-08 Method for inter prediction and apparatus thereof

Related Parent 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

Related Child Applications (1)

Application Number Title Priority Date Filing Date
KR1020240005610A Division KR20240010747A (en) 2011-07-12 2024-01-12 Method for inter prediction and apparatus thereof

Publications (2)

Publication Number Publication Date
KR20230043818A true KR20230043818A (en) 2023-03-31
KR102626368B1 KR102626368B1 (en) 2024-01-17

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 (13)

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

Family Applications After (1)

Application Number Title Priority Date Filing Date
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
KR20210131299A (en) 2021-11-02
KR101990425B1 (en) 2019-06-19

Similar Documents

Publication Publication Date Title
KR102485745B1 (en) Method and apparatus for picture encoding/decoding
KR102515824B1 (en) Method for inter prediction and apparatus thereof
US10587893B2 (en) Inter prediction method and apparatus for same
KR20200027487A (en) Method for inter prediction and apparatus thereof
KR102503694B1 (en) Method for inter prediction and apparatus thereof
KR102638107B1 (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