KR20140136415A - Method and apparatus for encoding/decoding motion vector - Google Patents

Method and apparatus for encoding/decoding motion vector Download PDF

Info

Publication number
KR20140136415A
KR20140136415A KR1020140148724A KR20140148724A KR20140136415A KR 20140136415 A KR20140136415 A KR 20140136415A KR 1020140148724 A KR1020140148724 A KR 1020140148724A KR 20140148724 A KR20140148724 A KR 20140148724A KR 20140136415 A KR20140136415 A KR 20140136415A
Authority
KR
South Korea
Prior art keywords
motion vector
unit
current block
encoding
mode
Prior art date
Application number
KR1020140148724A
Other languages
Korean (ko)
Other versions
KR101617334B1 (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 삼성전자주식회사
Priority to KR1020140148724A priority Critical patent/KR101617334B1/en
Publication of KR20140136415A publication Critical patent/KR20140136415A/en
Application granted granted Critical
Publication of KR101617334B1 publication Critical patent/KR101617334B1/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/513Processing of motion vectors
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/103Selection of coding mode or of prediction mode
    • H04N19/105Selection of the reference unit for prediction within a chosen coding or prediction mode, e.g. adaptive choice of position and number of pixels used for prediction
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/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/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/184Methods 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 bits, e.g. of the compressed video stream

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The present invention relates to a method and an apparatus for encoding/decoding a motion vector. More particularly, the present invention relates to a method and an apparatus for encoding/decoding a motion vector to accurately estimate at least one motion vector predictor. A method and an apparatus for encoding/decoding a motion vector according to an embodiment of the present invention includes a step of selecting one of a specification mode and an implication mode as a mode of encoding the motion vector predictor of a present block and a step of encoding the motion vector predictor of the present block based on the motion vector predictor determined by the selected mode.

Description

움직임 벡터를 부호화, 복호화하는 방법 및 장치{Method and apparatus for encoding/decoding motion vector}[0001] The present invention relates to a method and apparatus for encoding and decoding a motion vector,

본 발명은 움직임 벡터 부호화 방법 및 장치에 관한 것으로 보다 상세히는 현재 블록의 움직임 벡터를 예측하여 부호화, 복호화하는 방법 및 장치에 관한 것이다.BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a motion vector coding method and apparatus, and more particularly, to a method and apparatus for predicting motion vector coding and decoding of a current block.

MPEG-4 H.264/MPEG-4 AVC(Advanced Video Coding)와 같은 코덱에서는 현재 블록의 움직임 벡터를 예측하기 위해 현재 블록에 인접한 이전에 부호화된 블록들의 움직임 벡터를 이용한다. 현재 블록에 좌측, 상부 및 우측 상부에 인접한 이전한 부호화된 블록들의 움직임 벡터들의 중앙값(median)을 현재 블록의 예측 움직임 벡터(Motion vector Predictor)로 이용한다.In a codec such as MPEG-4 H.264 / MPEG-4 Advanced Video Coding (AVC), a motion vector of a previously coded block adjacent to a current block is used to predict a motion vector of the current block. The median of the motion vectors of the previous coded blocks adjacent to the upper left, the upper and the upper right of the current block is used as a motion vector predictor of the current block.

본 발명이 해결하고자 하는 기술적 과제는 움직임 벡터를 부호화, 복호화하는 방법 및 장치를 제공하는데 있고, 상기 방법을 실행하기 위한 프로그램을 기록한 컴퓨터로 읽을 수 있는 기록 매체를 제공하는데 있다.SUMMARY OF THE INVENTION The present invention provides a method and apparatus for encoding and decoding motion vectors, and a computer-readable recording medium having recorded thereon a program for executing the method.

상기 기술적 과제를 해결하기 위한 본 발명의 일 실시예에 따른 움직임 벡터를 부호화하는 방법은 적어도 하나의 예측 움직임 벡터(motion vector predictor) 중 하나의 예측 움직임 벡터를 지시하는 정보를 부호화하는 제1 모드 및 현재 블록에 인접한 이전에 부호화된 영역에 포함된 픽셀들에 기초해 예측 움직임 벡터를 생성함을 지시하는 정보를 부호화하는 제2 모드 중 하나를 선택하는 단계; 상기 선택된 모드에 따라 현재 블록의 예측 움직임 벡터를 결정하고, 상기 현재 블록의 예측 움직임 벡터에 대한 정보를 부호화하는 단계; 및 상기 현재 블록의 움직임 벡터와 상기 현재 블록의 예측 움직임 벡터 사이의 차이 벡터를 부호화하는 단계를 포함하고, 상기 제2 모드는 상기 적어도 하나의 예측 움직임 벡터에 기초해 예측 움직임 벡터를 검색할 범위를 설정하고, 설정된 검색 범위를 상기 이전에 부호화된 영역에 포함된 픽셀들을 이용해 검색하여 상기 예측 움직임 벡터를 생성함을 지시하는 정보를 부호화하는 모드인 것을 특징으로 한다.According to an aspect of the present invention, there is provided a method of coding a motion vector, the method comprising: a first mode for coding information indicating one predicted motion vector of at least one predicted motion vector; Selecting one of a second mode for coding information indicating to generate a predictive motion vector based on pixels included in a previously coded region adjacent to the current block; Determining a predicted motion vector of a current block according to the selected mode, and encoding information on a predicted motion vector of the current block; And encoding a difference vector between a motion vector of the current block and a predictive motion vector of the current block, wherein the second mode includes a range for searching for a predictive motion vector based on the at least one predictive motion vector, And searching for a set search range using pixels included in the previously encoded region to generate information indicating that the predicted motion vector should be generated.

본 발명의 또 다른 실시예에 따르면, 상기 제1 모드 및 제2 모드 중 하나를 선택하는 단계는 현재 픽처 또는 현재 슬라이스의 최대 부호화 단위의 크기에서 현재 블록의 크기로 단계적으로 축소된 정도를 나타내는 심도에 기초해 상기 제1 모드 및 상기 제2 모드 중 하나를 선택하는 단계를 포함한다.According to still another embodiment of the present invention, the step of selecting one of the first mode and the second mode may further include the steps of: extracting a depth of a current picture or a current slice, And selecting one of the first mode and the second mode based on the first mode and the second mode.

본 발명의 또 다른 실시예에 따르면, 상기 제1 모드 및 제2 모드 중 하나를 선택하는 단계는 상기 현재 블록을 포함하는 현재 픽처 또는 현재 슬라이스 단위로 상기 제1 모드 및 상기 제2 모드 중 하나를 선택하는 단계를 포함한다.According to still another embodiment of the present invention, the step of selecting one of the first mode and the second mode includes selecting one of the first mode and the second mode in units of the current picture or the current slice including the current block .

본 발명의 또 다른 실시예에 따르면, 상기 제1 모드 및 제2 모드 중 하나를 선택하는 단계는 현재 블록이 스킵 모드로 부호화되는지 여부에 기초해 상기 제1 모드 및 상기 제2 모드 중 하나를 선택하는 단계를 포함한다.According to another embodiment of the present invention, the step of selecting one of the first mode and the second mode may include selecting one of the first mode and the second mode based on whether a current block is coded in a skip mode .

본 발명의 또 다른 실시예에 따르면, 상기 적어도 하나의 예측 움직임 벡터는 현재 블록의 좌측에 인접한 블록의 제1 움직임 벡터, 상부에 인접한 블록의 제2 움직임 벡터 및 우측 상부에 인접한 블록의 제3 움직임 벡터를 포함한다.According to another embodiment of the present invention, the at least one predictive motion vector includes a first motion vector of the block adjacent to the left of the current block, a second motion vector of the block adjacent to the upper block, and a third motion Vector.

본 발명의 또 다른 실시예에 따르면, 상기 적어도 하나의 예측 움직임 벡터는 상기 제1 움직임 벡터, 상기 제2 움직임 벡터 및 상기 제3 움직임 벡터의 중앙값(median value)을 더 포함한다.According to another embodiment of the present invention, the at least one predictive motion vector further includes a median value of the first motion vector, the second motion vector, and the third motion vector.

본 발명의 또 다른 실시예에 따르면, 상기 적어도 하나의 예측 움직임 벡터는 참조 픽처의 상기 현재 블록과 동일한 위치(colocated)의 블록의 움직임 벡터및 상기 참조 픽처와 상기 현재 픽처 사이의 시간적 거리에 기초해 생성된 예측 움직임 벡터를 더 포함한다.According to another embodiment of the present invention, the at least one predictive motion vector is calculated based on a motion vector of a block that is colocated with the current block of a reference picture and a temporal distance between the reference picture and the current picture And further includes the generated predicted motion vector.

본 발명의 또 다른 실시예에 따르면, 상기 예측 움직임 벡터에 대한 정보를 부호화하는 단계는 상기 동일한 위치의 블록이 상기 현재 픽처보다 시간적으로 선행하는 픽처의 블록인지 후행하는 픽처의 블록인지 지시하는 정보를 부호화하는 단계를 더 포함하는 것을 특징으로 한다. According to another embodiment of the present invention, the step of coding information on the predictive motion vector may comprise the step of coding information indicating whether the block of the same position is a block of a picture temporally preceding the current picture or a block of a following picture And encoding the encoded data.

본 발명의 또 다른 실시예에 따르면, 상기 동일한 위치의 블록이 상기 현재 픽처보다 시간적으로 선행하는 픽처의 블록인지 후행하는 픽처의 블록인지 지시하는 정보는 상기 현재 블록이 포함된 슬라이스의 헤더에 삽입되는 정보인 것을 특징으로 한다.According to another embodiment of the present invention, information indicating that the block at the same position is a block of a temporally preceding picture or a block of a following picture is inserted into a header of a slice including the current block Information.

상기 기술적 과제를 해결하기 위한 본 발명의 일 실시예에 따른, 움직임 벡터를 부호화하는 장치는 적어도 하나의 예측 움직임 벡터(motion vector predictor) 중 하나의 예측 움직임 벡터를 지시하는 정보를 부호화하는 제1 모드 및 현재 블록에 인접한 이전에 부호화된 영역에 포함된 픽셀들에 기초해 예측 움직임 벡터를 생성함을 지시하는 정보를 부호화하는 제2 모드 중 하나를 선택하고, 상기 선택된 모드에 기초해 현재 블록의 예측 움직임 벡터를 결정하는 예측부; 상기 선택된 모드에 기초해 상기 결정된 현재 블록의 예측 움직임 벡터에 대한 정보를 부호화하는 제1부호화부; 및 현재 블록의 움직임 벡터와 상기 현재 블록의 예측 움직임 벡터 사이의 차이 벡터를 부호화하는 제2부호화부를 포함하고, 상기 제2 모드는 상기 적어도 하나의 예측 움직임 벡터에 기초해 예측 움직임 벡터를 검색할 범위를 설정하고, 설정된 검색 범위를 상기 이전에 부호화된 영역에 포함된 픽셀들을 이용해 검색하여 상기 예측 움직임 벡터를 생성함을 지시하는 정보를 부호화하는 모드인 것을 특징으로 한다.According to an aspect of the present invention, there is provided an apparatus for encoding a motion vector, the apparatus comprising: a first mode for encoding information indicating one predictive motion vector of at least one predictive motion vector; And a second mode for encoding information indicating to generate a predictive motion vector based on pixels included in a previously encoded region adjacent to the current block, and selecting a prediction mode of the current block based on the selected mode A predictor for determining a motion vector; A first encoding unit encoding information on a predicted motion vector of the determined current block based on the selected mode; And a second encoding unit that encodes a difference vector between a motion vector of a current block and a predictive motion vector of the current block, and the second mode is a mode for encoding a predictive motion vector to be searched based on the at least one predictive motion vector And searching for a set search range using pixels included in the previously encoded region to generate information indicating that the predicted motion vector should be generated.

상기 기술적 과제를 해결하기 위한 본 발명의 일 실시예에 따른 움직임 벡터를 복호화하는 방법은 제1 모드 및 제2 모드 중 선택된 하나의 모드에 의해 부호화된 현재 블록의 예측 움직임 벡터에 대한 정보를 복호화하는 단계; 현재 블록의 움직임 벡터와 상기 현재 블록의 예측 움직임 벡터 사이의 차이 벡터를 복호화하는 단계; 상기 복호화된 현재 블록의 예측 움직임 벡터에 대한 정보에 기초해 현재 블록의 예측 움직임 벡터를 생성하는 단계; 및 상기 예측 움직임 벡터 및 상기 차이 벡터에 기초해 현재 블록의 움직임 벡터를 복원하는 단계를 포함하고, 상기 제1 모드는 적어도 하나의 예측 움직임 벡터(motion vector predictor) 중 하나의 예측 움직임 벡터를 지시하는 정보를 부호화하는 모드이고, 상기 제2 모드는 상기 적어도 하나의 예측 움직임 벡터에 기초해 예측 움직임 벡터를 검색할 범위를 설정하고, 설정된 검색 범위를 상기 현재 블록에 인접한 이전에 복호화된 영역에 포함된 픽셀들을 이용해 검색하여 상기 예측 움직임 벡터를 생성함을 지시하는 정보를 부호화하는 모드인 것을 특징으로 한다.According to an aspect of the present invention, there is provided a method of decoding a motion vector of a current block encoded by a selected one of a first mode and a second mode, step; Decoding a difference vector between a motion vector of a current block and a predicted motion vector of the current block; Generating a predicted motion vector of a current block based on information on a predicted motion vector of the decoded current block; And reconstructing a motion vector of a current block based on the predictive motion vector and the difference vector, wherein the first mode indicates one predictive motion vector of at least one predictive motion vector And the second mode sets a range for searching for a predicted motion vector based on the at least one predicted motion vector and sets a search range that is set in the previously decoded area adjacent to the current block And encoding the information indicating to generate the predictive motion vector by searching using pixels.

상기 기술적 과제를 해결하기 위한 본 발명의 일 실시예에 따른 움직임 벡터를 복호화하는 장치는 제1 모드 및 제2 모드 중 선택된 하나의 모드에 의해 부호화된 현재 블록의 예측 움직임 벡터에 대한 정보를 복호화하는 제1 복호화부; 현재 블록의 움직임 벡터와 상기 현재 블록의 예측 움직임 벡터 사이의 차이 벡터를 복호화하는 제2 복호화부; 상기 복호화된 현재 블록의 예측 움직임 벡터에 대한 정보에 기초해 현재 블록의 예측 움직임 벡터를 생성하는 예측부; 및 상기 예측 움직임 벡터 및 상기 차이 벡터에 기초해 현재 블록의 움직임 벡터를 복원하는 움직임벡터복원부를 포함하고, 상기 제1 모드는 적어도 하나의 예측 움직임 벡터(motion vector predictor) 중 현재 블록의 예측 움직임 벡터로 이용된 하나의 예측 움직임 벡터를 지시하는 정보를 부호화하는 모드이고, 상기 제2 모드는 상기 적어도 하나의 예측 움직임 벡터에 기초해 예측 움직임 벡터를 검색할 범위를 설정하고, 설정된 검색 범위를 상기 현재 블록에 인접한 이전에 복호화된 영역에 포함된 픽셀들을 이용해 검색하여 상기 예측 움직임 벡터를 생성함을 지시하는 정보를 부호화하는 모드인 것을 특징으로 한다.
According to an aspect of the present invention, there is provided an apparatus for decoding a motion vector, the apparatus comprising: a decoder for decoding information on a predictive motion vector of a current block encoded by a selected one of a first mode and a second mode; A first decoding unit; A second decoding unit for decoding a difference vector between a motion vector of a current block and a predicted motion vector of the current block; A predictor for generating a predictive motion vector of a current block based on information on a predictive motion vector of the decoded current block; And a motion vector restoration unit for restoring a motion vector of a current block based on the predictive motion vector and the difference vector, wherein the first mode includes a predicted motion vector of a current block among at least one predictive motion vector, And the second mode is a mode for setting a range for searching for a predicted motion vector based on the at least one predicted motion vector and setting the set search range to the current And coding information for indicating to generate the predictive motion vector by searching pixels included in a previously decoded area adjacent to the block.

*상기 기술적 과제를 해결하기 위해 본 발명의 일 실시예는 상기된 움직임 벡터 부호화, 복호화 방법을 실행하기 위한 프로그램을 기록한 컴퓨터로 읽을 수 있는 기록 매체를 제공한다.According to an aspect of the present invention, there is provided a computer-readable recording medium having recorded thereon a program for executing the motion vector coding and decoding method.

본원 발명에 따르면, 움직임 벡터에 대한 정보를 별도로 부호화하지 않는 모드 및 예측 움직임 벡터에 대한 정보를 부호화하는 모드를 모두 이용해 움직임 벡터를 보다 정확하게 예측할 수 있다.According to the present invention, a motion vector can be more accurately predicted using both a mode in which information on a motion vector is not separately encoded and a mode in which information on a predictive motion vector is encoded.

도 1은 본 발명의 일 실시예에 따른 영상 부호화 장치를 도시한다.
도 2는 본 발명의 일 실시예에 따른 영상 복호화 장치를 도시한다.
도 3은 본 발명의 일 실시예에 따른 계층적 부호화 단위를 도시한다.
도 4는 본 발명의 일 실시예에 따른 부호화 단위에 기초한 영상 부호화부를 도시한다.
도 5는 본 발명의 일 실시예에 따른 부호화 단위에 기초한 영상 복호화부를 도시한다.
도 6은 본 발명의 일 실시예에 따른 최대 부호화 단위, 서브 부호화 단위 및 예측 단위를 도시한다.
도 7은 본 발명의 일 실시예에 따른, 부호화 단위 및 변환 단위를 도시한다.
도 8a 및 8b는 본 발명의 일 실시예에 따른, 부호화 단위, 예측 단위 및 주파수 변환 단위의 분할 형태를 도시한다.
도 9는 본 발명의 일 실시예에 따른 움직임 벡터를 부호화하는 장치를 도시한다.
도 10a 및 10b는 본 발명의 일 실시예에 따른 명시 모드의 예측 움직임 벡터 후보들을 도시한다.
도 10c 내지 10e는 본 발명의 일 실시예에 따른 현재 블록에 인접한 다양한 크기의 블록들을 도시한다.
도 11a 내지 11c는 본 발명의 또 다른 실시예에 따른 명시 모드의 예측 움직임 벡터 후보들을 도시한다.
도 12a는 본 발명의 일 실시예에 따른 암시 모드의 예측 움직임 벡터를 생성하는 방법을 도시한다.
도 12b는 본 발명의 일 실시예에 따른 암시 모드의 예측 움직임 벡터를 검색하는 방법을 도시한다.
도 12c 및 12d는 본 발명의 일 실시예에 따른 예측 움직임 벡터를 생성하기 위해 이용되는 템플릿(template)을 도시한다.
도 13은 본 발명의 일 실시예에 따른 움직임 벡터를 복호화하는 장치를 도시한다.
도 14는 본 발명의 일 실시예에 따른 움직임 벡터를 부호화하는 방법을 설명하기 위한 흐름도이다.
도 15는 본 발명의 일 실시예에 따른 움직임 벡터를 복호화하는 방법을 설명하기 위한 흐름도이다.
1 illustrates an image encoding apparatus according to an embodiment of the present invention.
FIG. 2 illustrates an image decoding apparatus according to an embodiment of the present invention.
FIG. 3 illustrates a hierarchical encoding unit according to an embodiment of the present invention.
FIG. 4 illustrates an image encoding unit based on an encoding unit according to an embodiment of the present invention.
FIG. 5 illustrates an image decoding unit based on an encoding unit according to an embodiment of the present invention.
FIG. 6 illustrates a maximum encoding unit, a sub-encoding unit, and a prediction unit according to an embodiment of the present invention.
7 shows an encoding unit and a conversion unit according to an embodiment of the present invention.
FIGS. 8A and 8B show a division form of an encoding unit, a prediction unit, and a frequency conversion unit according to an embodiment of the present invention.
9 illustrates an apparatus for encoding a motion vector according to an embodiment of the present invention.
10A and 10B show predicted motion vector candidates in explicit mode according to an embodiment of the present invention.
Figures 10C-10E illustrate blocks of various sizes adjacent to a current block in accordance with an embodiment of the present invention.
Figures 11A-11C illustrate predicted motion vector candidates in explicit mode in accordance with another embodiment of the present invention.
12A illustrates a method of generating a predictive motion vector of an implicit mode according to an embodiment of the present invention.
FIG. 12B illustrates a method of searching for a predictive motion vector in an implicit mode according to an embodiment of the present invention.
Figures 12C and 12D show a template used to generate a predicted motion vector according to an embodiment of the present invention.
13 shows an apparatus for decoding a motion vector according to an embodiment of the present invention.
14 is a flowchart illustrating a method of coding a motion vector according to an embodiment of the present invention.
15 is a flowchart illustrating a method of decoding a motion vector according to an embodiment of the present invention.

이하에서는 도면을 참조하여 본 발명의 바람직한 실시예들을 상세히 설명한다. Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the drawings.

도 1 은 본 발명의 일 실시예에 따른 영상 부호화 장치를 도시한다.1 illustrates an image encoding apparatus according to an embodiment of the present invention.

도 1을 참조하면, 본 발명의 일 실시예에 따른 영상 부호화 장치(100)는 최대 부호화 단위 분할부(110), 부호화 심도 결정부(120), 영상 데이터 부호화부(130) 및 부호화 정보 부호화부(140)를 포함한다.1, an image encoding apparatus 100 according to an exemplary embodiment of the present invention includes a maximum encoding unit division unit 110, an encoding depth determination unit 120, an image data encoding unit 130, (140).

최대 부호화 단위 분할부(110)는 최대 크기의 부호화 단위인 최대 부호화 단위에 기반하여 현재 픽처 또는 현재 슬라이스를 분할할 수 있다. 현재 픽처 또는 현재 슬라이스를 적어도 하나의 최대 부호화 단위로 분할할 수 있다. The maximum coding unit division unit 110 may divide the current picture or the current slice based on the maximum coding unit which is the coding unit of the maximum size. The current picture or current slice can be divided into at least one maximum encoding unit.

본 발명의 일 실시예에 따르면, 최대 부호화 단위 및 심도를 이용해 부호화 단위가 표현될 수 있다. 전술한 바와 같이 최대 부호화 단위는 현재 픽처의 부호화 단위 중 크기가 가장 큰 부호화 단위를 나타내며, 심도는 부호화 단위가 계층적으로 축소된 서브 부호화 단위의 크기를 나타낸다. 심도가 커지면서, 부호화 단위는 최대 부호화 단위로부터 최소 부호화 단위까지 축소될 수 있으며, 최대 부호화 단위의 심도는 최소 심도로 정의되고, 최소 부호화 단위의 심도는 최대 심도로 정의될 수 있다. 최대 부호화 단위는 심도가 커짐에 따라 심도별 부호화 단위의 크기는 감소하므로, k 심도의 서브 부호화 단위는 복수 개의 k보다 큰 심도의 서브 부호화 단위를 포함할 수 있다.According to an embodiment of the present invention, an encoding unit can be expressed using a maximum encoding unit and a depth. As described above, the maximum coding unit indicates the largest coding unit among the coding units of the current picture, and the depth indicates the size of the sub-coding unit in which the coding units are hierarchically reduced. As the depth increases, the encoding unit can be reduced from the maximum encoding unit to the minimum encoding unit, the depth of the maximum encoding unit can be defined as the minimum depth, and the depth of the minimum encoding unit can be defined as the maximum depth. As the depth of the maximum encoding unit increases, the size of the depth-dependent encoding unit decreases. Thus, the sub-encoding unit of k depth may include a sub-encoding unit of depth greater than a plurality of k.

부호화되는 픽처의 크기가 커짐에 따라, 더 큰 단위로 영상을 부호화하면 더 높은 영상 압축률로 영상을 부호화할 수 있다. 그러나, 부호화 단위를 크게 하고, 그 크기를 고정시켜버리면, 계속해서 변하는 영상의 특성을 반영하여 효율적으로 영상을 부호화할 수 없다. As the size of a picture to be encoded increases, if an image is coded in a larger unit, the image can be encoded with a higher image compression rate. However, if the coding unit is enlarged and its size is fixed, the image can not be efficiently encoded reflecting the characteristics of the continuously changing image.

예를 들어, 바다 또는 하늘에 대한 평탄한 영역을 부호화할 때에는 부호화 단위를 크게 할수록 압축률이 향상될 수 있으나, 사람들 또는 빌딩에 대한 복잡한 영역을 부호화할 때에는 부호화 단위를 작게 할수록 압축률이 향상된다.For example, when coding a flat area with respect to the sea or sky, the compression rate can be improved by increasing the coding unit. However, when coding a complex area for people or buildings, the compression ratio is improved as the coding unit is decreased.

이를 위해 본 발명의 일 실시예는 픽처 또는 슬라이스마다 상이한 최대 영상 부호화 단위를 설정하고, 최대 심도를 설정한다. 최대 심도는 부호화 단위가 축소될 수 있는 최대 횟수를 의미하므로, 최대 심도에 따라 최대 영상 부호화 단위에 포함된 최소 부호화 단위 크기를 가변적으로 설정할 수 있게 된다.To this end, one embodiment of the present invention sets a different maximum picture encoding unit for each picture or slice, and sets a maximum depth. Since the maximum depth means the maximum number of times the encoding unit can be reduced, the minimum encoding unit size included in the maximum image encoding unit can be variably set according to the maximum depth.

부호화 심도 결정부(120)는 최대 심도를 결정한다. 최대 심도는 R-D 코스트(Rate-Distortion Cost) 계산에 기초해 결정될 수 있다. 최대 심도는 픽처 또는 슬라이스마다 상이하게 결정되거나, 각각의 최대 부호화 단위마다 상이하게 결정될 수도 있다. 결정된 최대 심도는 부호화 정보 부호화부(140)로 출력되고, 최대 부호화 단위별 영상 데이터는 영상 데이터 부호화부(130)로 출력된다. The encoding depth determination unit 120 determines the maximum depth. The maximum depth may be determined based on the Rate-Distortion Cost calculation. The maximum depth may be determined differently for each picture or slice, or may be determined differently for each maximum encoding unit. The determined maximum depth is output to the encoding information encoding unit 140, and the image data for each maximum encoding unit is output to the image data encoding unit 130.

최대 심도는 최대 부호화 단위에 포함될 수 있는 가장 작은 크기의 부호화 단위 즉, 최소 부호화 단위를 의미한다. 다시 말해, 최대 부호화 단위는 상이한 심도에 따라 상이한 크기의 서브 부호화 단위로 분할될 수 있다. 도 8a 및 8b를 참조하여 상세히 후술한다. 또한, 최대 부호화 단위에 포함된 상이한 크기의 서브 부호화 단위들은 상이한 크기의 처리 단위에 기초해 예측 또는 주파수 변환될 수 있다. 다시 말해, 영상 부호화 장치(100)는 영상 부호화를 위한 복수의 처리 단계들을 다양한 크기 및 다양한 형태의 처리 단위에 기초해 수행할 수 있다. 영상 데이터의 부호화를 위해서는 예측, 주파수 변환, 엔트로피 부호화 등의 처리 단계를 거치는데, 모든 단계에 걸쳐서 동일한 크기의 처리 단위가 이용될 수도 있으며, 단계별로 상이한 크기의 처리 단위를 이용할 수 있다.The maximum depth means the smallest encoding unit, that is, the minimum encoding unit, which can be included in the maximum encoding unit. In other words, the maximum encoding unit may be divided into sub-encoding units of different sizes according to different depths. Will be described later in detail with reference to Figs. 8A and 8B. Further, the sub-encoding units of different sizes included in the maximum encoding unit can be predicted or frequency-converted based on the processing units of different sizes. In other words, the image encoding apparatus 100 can perform a plurality of processing steps for image encoding based on various sizes and processing units of various types. In order to encode video data, processing steps such as prediction, frequency conversion, and entropy encoding are performed. Processing units of the same size may be used in all stages, and processing units of different sizes may be used in each step.

예를 들어 영상 부호화 장치(100)는 부호화 단위를 예측하기 위해, 부호화 단위와 다른 처리 단위를 선택할 수 있다. For example, in order to predict a coding unit, the image coding apparatus 100 may select a coding unit and a different processing unit.

부호화 단위의 크기가 2Nx2N(단, N은 양의 정수)인 경우, 예측을 위한 처리 단위는 2Nx2N, 2NxN, Nx2N, NxN 등일 수 있다. 다시 말해, 부호화 단위의 높이 또는 너비 중 적어도 하나를 반분하는 형태의 처리 단위를 기반으로 움직임 예측이 수행될 수도 있다. 이하, 예측의 기초가 되는 데이터 단위는 '예측 단위'라 한다.If the size of the encoding unit is 2Nx2N (where N is a positive integer), the processing unit for prediction may be 2Nx2N, 2NxN, Nx2N, NxN, and the like. In other words, motion prediction may be performed based on a processing unit of a type that halves at least one of a height or a width of an encoding unit. Hereinafter, a data unit serving as a basis of prediction is referred to as a 'prediction unit'.

예측 모드는 인트라 모드, 인터 모드 및 스킵 모드 중 적어도 하나일 수 있으며, 특정 예측 모드는 특정 크기 또는 형태의 예측 단위에 대해서만 수행될 수 있다. 예를 들어, 인트라 모드는 정방형인 2Nx2N, NxN 크기의 예측 단위에 대해서만 수행될 수 있다. 또한, 스킵 모드는 2Nx2N 크기의 예측 단위에 대해서만 수행될 수 있다. 부호화 단위 내부에 복수의 예측 단위가 있다면, 각각의 예측 단위에 대해 예측을 수행하여 부호화 오차가 가장 작은 예측 모드가 선택될 수 있다.The prediction mode may be at least one of an intra mode, an inter mode, and a skip mode, and the specific prediction mode may be performed only for a prediction unit of a specific size or type. For example, the intra mode can be performed only for a 2Nx2N, NxN sized prediction unit, which is a square. In addition, the skip mode can be performed only for a prediction unit of 2Nx2N size. If there are a plurality of prediction units in an encoding unit, a prediction mode having the smallest coding error can be selected by performing prediction for each prediction unit.

또한, 영상 부호화 장치(100)는 부호화 단위와 다른 크기의 처리 단위에 기초해 영상 데이터를 주파수 변환할 수 있다. 부호화 단위의 주파수 변환을 위해서 부호화 단위보다 작거나 같은 크기의 데이터 단위를 기반으로 주파수 변환이 수행될 수 있다. 이하, 주파수 변환의 기초가 되는 처리 단위를 '변환 단위'라 한다.Also, the image encoding apparatus 100 can frequency-convert image data based on a processing unit having a different size from the encoding unit. The frequency conversion may be performed based on a data unit having a size smaller than or equal to the encoding unit for frequency conversion of the encoding unit. Hereinafter, a processing unit serving as a basis of frequency conversion is referred to as a 'conversion unit'.

부호화 심도 결정부(120)는 라그랑지 곱(Lagrangian Multiplier) 기반의 율-왜곡 최적화 기법(Rate-Distortion Optimization)을 이용해 최대 부호화 단위에 포함된 서브 부호화 단위들을 결정할 수 있다. 다시 말해, 최대 부호화 단위가 어떠한 형태의 복수의 서브 부호화 단위로 분할되는지 결정할 수 있는데, 여기서 복수의 서브 부호화 단위는 심도에 따라 크기가 상이하다. 그런 다음, 영상 데이터 부호화부(130)는 부호화 심도 결정부(120)에서 결정된 분할 형태에 기초해 최대 부호화 단위를 부호화하여 비트스트림을 출력한다. The coding depth determiner 120 may determine sub-coding units included in the maximum coding unit using Rate-Distortion Optimization based on a Lagrangian Multiplier. In other words, it is possible to determine what type of sub-encoding unit the maximum encoding unit is divided into, wherein the plurality of sub-encoding units have different sizes depending on the depth. Then, the image data encoding unit 130 encodes the maximum encoding unit based on the division type determined by the encoding depth determination unit 120, and outputs the bit stream.

부호화 정보 부호화부(140)는 부호화 심도 결정부(120)에서 최대 부호화 단위의 부호화 모드에 대한 정보를 부호화한다. 최대 부호화 단위의 분할 형태에 대한 정보, 최대 심도에 대한 정보 및 심도별 서브 부호화 단위의 부호화 모드에 관한 정보를 부호화하여 비트스트림을 출력한다. 서브 부호화 단위의 부호화 모드에 관한 정보는 서브 부호화 단위의 예측 단위에 대한 정보, 예측 단위별 예측 모드 정보, 서브 부호화 단위의 변환 단위에 대한 정보 등을 포함할 수 있다.The encoding information encoding unit 140 encodes information on the encoding mode of the maximum encoding unit in the encoding depth determining unit 120. [ Information on the division type of the maximum encoding unit, information on the maximum depth, and information on the encoding mode of the sub-encoding unit by depth, and outputs the bit stream. The information on the encoding mode of the sub-encoding unit may include information on the prediction unit of the sub-encoding unit, prediction mode information per prediction unit, information on the conversion unit of the sub-encoding unit, and the like.

최대 부호화 단위마다 상이한 크기의 서브 부호화 단위가 존재하고, 각각의 서브 부호화 단위마다 부호화 모드에 관한 정보가 결정되어야 하므로, 하나의 최대 부호화 단위에 대해서는 적어도 하나의 부호화 모드에 관한 정보가 결정될 수 있다. There is a sub-encoding unit of a different size for each maximum encoding unit, and information on the encoding mode is determined for each sub-encoding unit, so that information on at least one encoding mode can be determined for one maximum encoding unit.

영상 부호화 장치(100)는 심도가 커짐에 따라 최대 부호화 단위를 높이 및 너비를 반분하여 서브 부호화 단위를 생성할 수 있다. 즉, k 심도의 부호화 단위의 크기가 2Nx2N이라면, k+1 심도의 부호화 단위의 크기는 NxN 이다. As the depth increases, the image encoding apparatus 100 may generate a sub-encoding unit by dividing the maximum encoding unit by half the height and the width. That is, if the size of the encoding unit of the kth depth is 2Nx2N, the size of the encoding unit of the k + 1th depth is NxN.

따라서, 일 실시예에 따른 영상 복호화 장치(100)는 영상의 특성을 고려한 최대 부호화 단위의 크기 및 최대 심도를 기반으로, 각각의 최대 부호화 단위마다 최적의 분할 형태를 결정할 수 있다. 영상 특성을 고려하여 가변적으로 최대 부호화 단위의 크기를 조절하고, 상이한 심도의 서브 부호화 단위로 최대 부호화 단위를 분할하여 영상을 부호화함으로써, 다양한 해상도의 영상을 보다 효율적으로 부호화할 수 있다.
Accordingly, the image decoding apparatus 100 according to an exemplary embodiment can determine an optimal division type for each maximum encoding unit based on the size and the maximum depth of a maximum encoding unit considering characteristics of an image. It is possible to more efficiently encode images of various resolutions by adjusting the size of the maximum encoding unit in consideration of the image characteristics and encoding the image by dividing the maximum encoding unit into sub-encoding units of different depths.

*도 2 는 본 발명의 일 실시예에 따른 영상 복호화 장치를 도시한다.2 shows an image decoding apparatus according to an embodiment of the present invention.

도 2를 참조하면, 본 발명의 일 실시예에 따른 영상 복호화 장치(200)는 영상 데이터 획득부(210), 부호화 정보 추출부(220) 및 영상 데이터 복호화부(230)를 포함한다. 2, an image decoding apparatus 200 according to an exemplary embodiment of the present invention includes an image data obtaining unit 210, an encoding information extracting unit 220, and an image data decoding unit 230.

영상 관련 데이터 획득부(210)는 영상 복호화 장치(200)가 수신한 비트스트림을 파싱하여, 최대 부호화 단위별로 영상 데이터를 획득하여 영상 데이터 복호화부(230)로 출력한다. 영상 데이터 획득부(210)는 현재 픽처 또는 슬라이스에 대한 헤더로부터 현재 픽처 또는 슬라이스의 최대 부호화 단위에 대한 정보를 추출할 수 있다. 다시 말해, 비트스트림을 최대 부호화 단위로 분할하여, 영상 데이터 복호화부(230)가 최대 부호화 단위마다 영상 데이터를 복호화하게 한다.The image-related data acquisition unit 210 parses the bit stream received by the image decoding apparatus 200, acquires image data for each maximum encoding unit, and outputs the image data to the image data decoding unit 230. The image data obtaining unit 210 may extract information on the maximum coding unit of the current picture or slice from the header of the current picture or slice. In other words, the bitstream is divided into a maximum encoding unit, and the video data decoding unit 230 decodes the video data per maximum encoding unit.

부호화 정보 추출부(220)는 영상 복호화 장치(200)가 수신한 비트열을 파싱하여, 현재 픽처에 대한 헤더로부터 최대 부호화 단위, 최대 심도, 최대 부호화 단위의 분할 형태, 서브 부호화 단위의 부호화 모드에 관한 정보를 추출한다. 분할 형태 및 부호화 모드에 관한 정보는 영상 데이터 복호화부(230)로 출력된다.The encoding information extracting unit 220 parses the bit stream received by the video decoding apparatus 200 and extracts a maximum encoding unit, a maximum depth, a division type of the maximum encoding unit, and a coding mode of the sub-encoding unit from the header for the current picture . The information on the division type and the encoding mode is output to the video data decoding unit 230. [

최대 부호화 단위의 분할 형태에 대한 정보는 최대 부호화 단위에 포함된 심도에 따라 상이한 크기의 서브 부호화 단위에 대한 정보를 포함할 수 있으며, 부호화 모드에 관한 정보는 서브 부호화 단위별 예측 단위에 대한 정보, 예측 모드에 대한 정보 및 변환 단위에 대한 정보 등을 포함할 수 있다. The information on the division type of the maximum encoding unit may include information on sub-encoding units of different sizes according to the depth included in the maximum encoding unit, the information on the encoding mode may include information on a prediction unit for each sub- Information on the prediction mode, information on the conversion unit, and the like.

영상 데이터 복호화부(230)는 부호화 정보 추출부에서 추출된 정보에 기초하여 각각의 최대 부호화 단위의 영상 데이터를 복호화하여 현재 픽처를 복원한다. 최대 부호화 단위의 분할 형태에 대한 정보에 기초하여, 영상 데이터 복호화부(230)는 최대 부호화 단위에 포함된 서브 부호화 단위를 복호화할 수 있다. 복호화 과정은 인트라 예측 및 움직임 보상을 포함하는 움직임 예측 과정, 및 주파수 역변환 과정을 포함할 수 있다.The image data decoding unit 230 decodes the image data of each maximum encoding unit based on the information extracted by the encoding information extracting unit to restore the current picture. The image data decoding unit 230 can decode the sub-encoding unit included in the maximum encoding unit based on the information on the division type of the maximum encoding unit. The decoding process may include a motion prediction process including intra prediction and motion compensation, and an inverse frequency conversion process.

영상 데이터 복호화부(230)는, 서브 부호화 단위의 예측을 위해, 서브 부호화 단위별 예측 단위에 대한 정보 및 예측 모드에 대한 정보에 기초해 인트라 예측 또는 인터 예측을 수행할 수 있다. 또한, 영상 데이터 복호화부(230)는, 서브 부호화 단위의 변환 단위에 대한 정보에 기초해 서브 부호화 단위마다 주파수 역변환을 수행할 수 있다.The image data decoding unit 230 may perform intra prediction or inter prediction based on information on a prediction unit for each sub-coding unit and prediction mode information for prediction of a sub-coding unit. In addition, the image data decoding unit 230 can perform frequency inverse transform for each sub-encoding unit on the basis of the information on the conversion unit of the sub-encoding unit.

도 3 은 본 발명의 일 실시예에 따른 계층적 부호화 단위를 도시한다.FIG. 3 illustrates a hierarchical encoding unit according to an embodiment of the present invention.

도 3을 참조하면, 본 발명에 따른 계층적 부호화 단위는 너비x높이가 64x64인 부호화 단위부터, 32x32, 16x16, 8x8, 및 4x4를 포함할 수 있다. 정사각형 형태의 부호화 단위 이외에도, 너비x높이가 64x32, 32x64, 32x16, 16x32, 16x8, 8x16, 8x4, 4x8인 부호화 단위들이 존재할 수 있다.Referring to FIG. 3, the hierarchical coding unit according to the present invention may include 32x32, 16x16, 8x8, and 4x4 from a coding unit having a width x height of 64x64. In addition to the square-shaped encoding units, there may be encoding units whose width x height is 64x32, 32x64, 32x16, 16x32, 16x8, 8x16, 8x4, 4x8.

도 3을 참조하면, 해상도가 1920x1080인 영상 데이터(310)에 대해서, 최대 부호화 단위의 크기는 64x64, 최대 심도가 2로 설정되어 있다. Referring to FIG. 3, the maximum encoding unit size is set to 64x64 and the maximum depth is set to 2 for the image data 310 having a resolution of 1920x1080.

또 다른 해상도가 1920x1080인 영상 데이터(320)에 대해서 최대 부호화 단위의 크기는 64x64, 최대 심도가 4로 설정되어 있다. 해상도가 352x288인 비디오 데이터(330)에 대해서 최대 부호화 단위의 크기는 16x16, 최대 심도가 2로 설정되어 있다.The size of the maximum encoding unit is set to 64x64 and the maximum depth is set to 4 for the image data 320 having another resolution of 1920x1080. For the video data 330 having a resolution of 352x288, the size of the maximum encoding unit is set to 16x16 and the maximum depth is set to 2. [

해상도가 높거나 데이터량이 많은 경우 압축률 향상뿐만 아니라 영상 특성을 정확히 반영하기 위해 부호화 사이즈의 최대 크기가 상대적으로 큰 것이 바람직하다. 따라서, 영상 데이터(330)에 비해, 해상도가 높은 영상 데이터(310 및 320)는 최대 부호화 단위의 크기가 64x64로 선택될 수 있다.It is desirable that the maximum size of the encoding size is relatively large in order to accurately reflect not only the compression ratio but also the image characteristic when the resolution is high or the data amount is large. Therefore, the size of the maximum encoding unit of the image data 310 and 320 having a higher resolution than the image data 330 can be selected to be 64x64.

최대 심도는 계층적 부호화 단위에서 총 계층수를 나타낸다. 영상 데이터(310)의 최대 심도는 2이므로, 영상 데이터(310)의 부호화 단위(315)는 장축 크기가 64인 최대 부호화 단위로부터, 심도가 증가함에 따라 장축 크기가 32, 16인 서브 부호화 단위들까지 포함할 수 있다. The maximum depth indicates the total number of layers in the hierarchical encoding unit. Since the maximum depth of the image data 310 is 2, the coding unit 315 of the image data 310 is divided into sub-coding units 315 having a major axis size of 32 and 16 as the depth increases, .

반면, 영상 데이터(330)의 최대 심도는 2이므로, 영상 데이터(330)의 부호화 단위(335)는 장축 크기가 16인 최대 부호화 단위들로부터, 심도가 증가함에 따라 장축 크기가 8, 4인 부호화 단위들까지 포함할 수 있다. On the other hand, since the maximum depth of the image data 330 is 2, the encoding unit 335 of the image data 330 is encoded from the maximum encoding units having the major axis size of 16 to the encoding units having the major axis size of 8 and 4 Units.

영상 데이터(320)의 최대 심도는 4이므로, 비디오 데이터(320)의 부호화 단위(325)는 장축 크기가 64인 최대 부호화 단위로부터, 심도가 증가함에 따라 장축 크기가 32, 16, 8, 4인 서브 부호화 단위들까지 포함할 수 있다. 심도가 증가할수록 더 작은 서브 부호화 단위에 기초해 영상을 부호화하므로 보다 세밀한 장면을 포함하고 있는 영상을 부호화하는데 적합해진다.Since the maximum depth of the video data 320 is 4, the encoding unit 325 of the video data 320 has a length of 32, 16, 8, and 4 as the depth increases, Sub-encoding units. As the depth increases, the image is encoded based on a smaller sub-encoding unit, which makes it suitable for encoding an image including a finer scene.

도 4 는 본 발명의 일 실시예에 따른 부호화 단위에 기초한 영상 부호화부를 도시한다.FIG. 4 illustrates an image encoding unit based on an encoding unit according to an embodiment of the present invention.

인트라 예측부(410)는 현재 프레임(405) 중 인트라 모드의 예측 단위에 대해 인트라 예측을 수행하고, 움직임 추정부(420) 및 움직임 보상부(425)는 인터 모드의 예측 단위에 대해 현재 프레임(405) 및 참조 프레임(495)을 이용해 인터 예측 및 움직임 보상을 수행한다.The intra prediction unit 410 performs intra prediction on a prediction unit of the intra mode of the current frame 405 and the motion estimation unit 420 and the motion compensation unit 425 perform intra prediction on the prediction unit of the intra mode, 405 and a reference frame 495. The inter-prediction and the motion compensation are performed using the reference frame 495 and inter-prediction.

인트라 예측부(410), 움직임 추정부(420) 및 움직임 보상부(425)로부터 출력된 예측 단위에 기초해 레지듀얼 값들이 생성되고, 생성된 레지듀얼 값들은 주파수 변환부(430) 및 양자화부(440)를 거쳐 양자화된 변환 계수로 출력된다. The residual values are generated based on the prediction unit output from the intra prediction unit 410, the motion estimation unit 420 and the motion compensation unit 425, and the generated residual values are input to the frequency conversion unit 430 and the quantization unit 420. [ (440) and output as quantized transform coefficients.

양자화된 변환 계수는 역양자화부(460), 주파수 역변환부(470)를 통해 다시 레지듀얼 값으로 복원되고, 복원된 레지듀얼 값들은 디블로킹부(480) 및 루프 필터링부(490)를 거쳐 후처리되어 참조 프레임(495)으로 출력된다. 양자화된 변환 계수는 엔트로피 부호화부(450)를 거쳐 비트스트림(455)으로 출력될 수 있다.The quantized transform coefficients are restored to a residual value through the inverse quantization unit 460 and the frequency inverse transform unit 470. The restored residual values are passed through the deblocking unit 480 and the loop filtering unit 490, And output to the reference frame 495. [ The quantized transform coefficient may be output to the bitstream 455 via the entropy encoding unit 450.

본 발명의 일 실시예에 따른 영상 부호화 방법에 따라 부호화하기 위해, 영상 부호화부(400)의 구성 요소들인 인트라 예측부(410), 움직임 추정부(420), 움직임 보상부(425), 주파수 변환부(430), 양자화부(440), 엔트로피 부호화부(450), 역양자화부(460), 주파수 역변환부(470), 디블로킹부(480) 및 루프 필터링부(490)는 모두 최대 부호화 단위, 심도에 따른 서브 부호화 단위, 예측 단위 및 변환 단위에 기초해 영상 부호화 과정들을 처리한다. In order to perform encoding according to the image encoding method according to an embodiment of the present invention, an intra prediction unit 410, a motion estimation unit 420, a motion compensation unit 425, The inverse quantization unit 460, the inverse quantization unit 470, the deblocking unit 480 and the loop filtering unit 490 of the quantization unit 430, the quantization unit 440, the entropy coding unit 450, the inverse quantization unit 460, , Sub-encoding units according to depth, prediction units, and conversion units.

도 5는 본 발명의 일 실시예에 따른 부호화 단위에 기초한 영상 복호화부를 도시한다.FIG. 5 illustrates an image decoding unit based on an encoding unit according to an embodiment of the present invention.

비트스트림(505)이 파싱부(510)를 거쳐 복호화 대상인 부호화된 영상 데이터 및 복호화를 위해 필요한 부호화 정보가 파싱된다. 부호화된 영상 데이터는 엔트로피 복호화부(520) 및 역양자화부(530)를 거쳐 역양자화된 데이터로 출력되고, 주파수 역변환부(540)를 거쳐 레지듀얼 값들로 복원된다. 레지듀얼 값들은 인트라 예측부(550)의 인트라 예측의 결과 또는 움직임 보상부(560)의 움직임 보상 결과와 가산되어 부호화 단위 별로 복원된다. 복원된 부호화 단위는 디블로킹부(570) 및 루프 필터링부(580)를 거쳐 다음 부호화 단위 또는 다음 픽처의 예측에 이용된다. The bitstream 505 passes through the parser 510 and the encoded image data to be decoded and the encoding information necessary for decoding are parsed. The encoded image data is output as inverse-quantized data through the entropy decoding unit 520 and the inverse quantization unit 530, and is restored to the residual values through the frequency inverse transform unit 540. [ The residual values are added to the intraprediction result of the intraprediction unit 550 or the motion compensation result of the motion compensation unit 560, and restored for each encoding unit. The reconstructed coding unit is used for predicting the next coding unit or the next picture through the deblocking unit 570 and the loop filtering unit 580.

본 발명의 일 실시예에 따른 영상 복호화 방법에 따라 복호화하기 위해 영상 복호화부(400)의 구성 요소들인 파싱부(510), 엔트로피 복호화부(520), 역양자화부(530), 주파수 역변환부(540), 인트라 예측부(550), 움직임 보상부(560), 디블로킹부(570) 및 루프 필터링부(580)가 모두 최대 부호화 단위, 심도에 따른 서브 부호화 단위, 예측 단위 및 변환 단위에 기초해 영상 복호화 과정들을 처리한다. A parsing unit 510, an entropy decoding unit 520, an inverse quantization unit 530, an inverse frequency transforming unit (hereinafter referred to as an inverse quantization unit) 530, The intra prediction unit 550, the motion compensation unit 560, the deblocking unit 570 and the loop filtering unit 580 are all based on the maximum encoding unit, the depth-dependent sub-encoding unit, the prediction unit, And processes the image decoding processes.

특히, 인트라 예측부(550), 움직임 보상부(560)는 최대 부호화 단위 및 심도를 고려하여 서브 부호화 단위 내의 예측 단위 및 예측 모드를 결정하며, 주파수 역변환부(540)는 변환 단위의 크기를 고려하여 주파수 역변환을 수행한다.In particular, the intra prediction unit 550 and the motion compensation unit 560 determine a prediction unit and a prediction mode in the sub-coding unit in consideration of the maximum coding unit and the depth, and the frequency inverse transform unit 540 considers the size of the conversion unit Thereby performing frequency inverse transform.

도 6는 본 발명의 일 실시예에 따른 최대 부호화 단위, 서브 부호화 단위 및 예측 단위를 도시한다.FIG. 6 illustrates a maximum encoding unit, a sub-encoding unit, and a prediction unit according to an embodiment of the present invention.

본 발명의 일 실시예에 따른 영상 부호화 장치(100) 및 영상 복호화 장치(200)는 영상 특성을 고려하여 부호화, 복호화를 수행하기 위해 계층적인 부호화 단위를 이용한다. 최대 부호화 단위 및 최대 심도는 영상의 특성에 따라 적응적으로 설정되거나, 사용자의 요구에 따라 다양하게 설정될 수 있다. The image encoding apparatus 100 and the image decoding apparatus 200 according to an embodiment of the present invention use a hierarchical encoding unit to perform encoding and decoding in consideration of image characteristics. The maximum encoding unit and the maximum depth may be adaptively set according to the characteristics of the image, or may be variously set according to the demand of the user.

본 발명의 일 실시예에 따른 부호화 단위의 계층 구조(600)는 최대 부호화 단위(610)의 높이 및 너비가 64이며, 최대 심도가 4인 경우를 도시한다. 부호화 단위의 계층 구조(600)의 세로축을 따라서 심도가 증가하고, 심도의 증가에 따라 서브 부호화 단위(620 내지 650)의 높이 및 너비가 축소된다. 또한, 부호화 단위의 계층 구조(600)의 가로축을 따라, 최대 부호화 단위(610) 및 서브 부호화 단위(620 내지 650)의 예측 단위가 도시되어 있다.The hierarchical structure 600 of the encoding unit according to an embodiment of the present invention shows a case where the height and the width of the maximum encoding unit 610 are 64 and the maximum depth is 4. The depth increases along the vertical axis of the hierarchical structure 600 of the encoding unit, and the height and width of the sub-encoding units 620 to 650 decrease as the depth increases. Prediction units of the maximum encoding unit 610 and the sub-encoding units 620 to 650 are shown along the horizontal axis of the hierarchical structure 600 of the encoding units.

최대 부호화 단위(610)는 심도가 0이며, 부호화 단위의 크기, 즉 높이 및 너비가 64x64이다. 세로축을 따라 심도가 증가하며, 크기 32x32인 심도 1의 서브 부호화 단위(620), 크기 16x16인 심도 2의 서브 부호화 단위(630), 크기 8x8인 심도 3의 서브 부호화 단위(640), 크기 4x4인 심도 4의 서브 부호화 단위(650)가 존재한다. 크기 4x4인 심도 4의 서브 부호화 단위(650)는 최소 부호화 단위이다.The maximum encoding unit 610 has a depth of 0, and the size of the encoding unit, i.e., the height and the width, is 64x64. A sub-encoding unit 620 having a depth 1 of 32x32 and a sub-encoding unit 630 having a depth 16x16 having a depth of 16x16, a sub-encoding unit 640 having a depth of 3x8 having a size 8x8, There is a sub-encoding unit 650 of depth 4. A sub-encoding unit 650 of depth 4 with a size of 4x4 is the minimum encoding unit.

도 6을 참조하면, 각각의 심도별로 가로축을 따라 예측 단위의 예시들이 도시되어 있다. 즉, 심도 0의 최대 부호화 단위(610)의 예측 단위는, 크기 64x64의 부호화 단위(610)와 동일하거나 작은 크기인 크기 64x64의 예측 단위(610), 크기 64x32의 예측 단위(612), 크기 32x64의 예측 단위(614), 크기 32x32의 예측 단위(616)일 수 있다.
Referring to FIG. 6, examples of prediction units along the horizontal axis are shown for each depth. That is, the prediction unit of the maximum coding unit 610 of depth 0 is a prediction unit 610 of size 64x64, a prediction unit 612 of size 64x32, and size 32x64, which are the same or smaller than the coding unit 610 of size 64x64, A prediction unit 614 of size 32x32, and a prediction unit 616 of size 32x32.

*심도 1의 크기 32x32의 부호화 단위(620)의 예측 단위는, 크기 32x32의 부호화 단위(620)와 동일하거나 작은 크기인 크기 32x32의 예측 단위(620), 크기 32x16의 예측 단위(622), 크기 16x32의 예측 단위(624), 크기 16x16의 예측 단위(626)일 수 있다. The prediction unit of the 32x32 coding unit 620 has a prediction unit 620 of size 32x32 which is equal to or smaller than the coding unit 620 of size 32x32, a prediction unit 622 of size 32x16, A prediction unit 624 of 16x32, and a prediction unit 626 of size 16x16.

심도 2의 크기 16x16의 부호화 단위(630)의 예측 단위는, 크기 16x16의 부호화 단위(630)와 동일하거나 작은 크기인 크기 16x16의 예측 단위(630), 크기 16x8의 예측 단위(632), 크기 8x16의 예측 단위(634), 크기 8x8의 예측 단위(636)일 수 있다. The prediction unit of the 16x16 encoding unit 630 of depth 2 has a prediction unit 630 of 16x16 size, a prediction unit 632 of size 16x8, and a size of 8x16, which are the same or smaller than the encoding unit 630 of size 16x16. A prediction unit 634 of size 8x8, and a prediction unit 636 of size 8x8.

심도 3의 크기 8x8의 부호화 단위(640)의 예측 단위는, 크기 8x8의 부호화 단위(640)와 동일하거나 작은 크기인 크기 8x8의 예측 단위(640), 크기 8x4의 예측 단위(642), 크기 4x8의 예측 단위(644), 크기 4x4의 예측 단위(646)일 수 있다. The prediction unit of the 8x8 encoding unit 640 of depth 3 has a prediction unit 640 of size 8x8, a prediction unit 642 of size 8x4, and a size of 4x8, which are the same or smaller than the encoding unit 640 of size 8x8. A prediction unit 644 of size 4x4, and a prediction unit 646 of size 4x4.

마지막으로, 심도 4의 크기 4x4의 부호화 단위(650)는 최소 부호화 단위이며 최대 심도의 부호화 단위이고, 예측 단위는 크기 4x4의 예측 단위(650)이다.Finally, the coding unit 650 of size 4x4 is the minimum coding unit and the coding unit of maximum depth, and the prediction unit is the prediction unit 650 of size 4x4.

도 7은 본 발명의 일 실시예에 따른, 부호화 단위 및 변환 단위를 도시한다.7 shows an encoding unit and a conversion unit according to an embodiment of the present invention.

본 발명의 일 실시예에 따른 영상 부호화 장치(100) 및 영상 복호화 장치(200)는, 최대 부호화 단위 그대로 부호화하거나, 최대 부호화 단위 보다 작거나 같은 서브 부호화 단위로 최대 부호화 단위를 분할하여 부호화한다. 부호화 과정 중 주파수 변환을 위한 변환 단위의 크기는 각각의 부호화 단위보다 크지 않은 변환 단위로 선택된다. 예를 들어, 현재 부호화 단위(710)가 64x64 크기일 때, 32x32 크기의 변환 단위(720)를 이용하여 주파수 변환이 수행될 수 있다. The image encoding apparatus 100 and the image decoding apparatus 200 according to an embodiment of the present invention encode the maximum encoding unit as a unit or encode the maximum encoding unit in units of sub encoding units smaller than or equal to the maximum encoding unit. The size of a conversion unit for frequency conversion during encoding is selected as a conversion unit that is not larger than each encoding unit. For example, when the current encoding unit 710 is 64x64, the frequency conversion can be performed using the 32x32 conversion unit 720. [

도 8a 및 8b는 본 발명의 일 실시예에 따른, 부호화 단위, 예측 단위 및 주파수 변환 단위의 분할 형태를 도시한다.FIGS. 8A and 8B show a division form of an encoding unit, a prediction unit, and a frequency conversion unit according to an embodiment of the present invention.

도 8a는 본 발명의 일 실시예에 따른 부호화 단위 및 예측 단위를 도시한다. 8A shows an encoding unit and a prediction unit according to an embodiment of the present invention.

도 8a의 좌측은 최대 부호화 단위(810)를 부호화하기 위해 본 발명의 일 실시예에 따른 영상 부호화 장치(100)가 선택한 분할 형태를 도시한다. 영상 부호화 장치(100)는 다양한 형태로 최대 부호화 단위(810)를 분할하고, 부호화한 다음 다양한 분할 형태의 부호화 결과를 R-D 코스트에 기초해 비교하여 최적의 분할 형태를 선택한다. 최대 부호화 단위(810)를 그대로 부호화하는 것이 최적일 경우에는 도 8a 및 8b와 같이 최대 부호화 단위(810)를 분할하지 않고 최대 부호화 단위(800)를 부호화할 수도 있다. The left side of FIG. 8A shows a division type selected by the image encoding apparatus 100 according to an embodiment of the present invention to encode the maximum encoding unit 810. The image encoding apparatus 100 divides the maximum encoding unit 810 into various types, encodes the encoded image, and then selects an optimal division type by comparing the encoding results of various division types based on the R-D cost. When it is optimal to directly encode the maximum encoding unit 810, the maximum encoding unit 800 may be encoded without dividing the maximum encoding unit 810 as shown in FIGS. 8A and 8B.

도 8a의 좌측을 참조하면, 심도 0인 최대 부호화 단위(810)를 심도 1 이상의 서브 부호화 단위로 분할하여 부호화한다. 최대 부호화 단위(810)를 네 개의 심도 1의 서브 부호화 단위로 분할한 다음, 전부 또는 일부의 심도 1의 서브 부호화 단위를 다시 심도 2의 서브 부호화 단위로 분할한다.Referring to the left side of FIG. 8A, a maximum encoding unit 810 having a depth of 0 is divided into sub-encoding units having a depth of 1 or more and encoded. The maximum encoding unit 810 is divided into sub-encoding units of four depths 1, and then all or a part of the sub-encoding units of depth 1 are divided into sub-encoding units of depth 2 again.

심도 1의 서브 부호화 단위 중 우측 상부에 외치한 서브 부호화 단위 및 좌측 하부에 위치한 서브 부호화 단위가 심도 2 이상의 서브 부호화 단위로 분할되었다. 심도 2 이상의 서브 부호화 단위 중 일부는 다시 심도 3 이상의 서브 부호화 단위로 분할될 수 있다.Among the sub-coding units of depth 1, sub-coding units coded at the upper right and sub-coding units located at the lower left are divided into sub-coding units of depth 2 or more. Some of the sub-encoding units having depths of 2 or more may be further divided into sub-encoding units having depths of 3 or more.

도 8b의 우측은 최대 부호화 단위(810)에 대한 예측 단위의 분할 형태를 도시한다. The right side of FIG. 8B shows the division type of the prediction unit for the maximum coding unit 810.

도 8a의 우측을 참조하면, 최대 부호화 단위에 대한 예측 단위(860)는 최대 부호화 단위(810)와 상이하게 분할될 수 있다. 다시 말해, 서브 부호화 단위들 각각에 대한 예측 단위는 서브 부호화 단위보다 작을 수 있다. Referring to the right side of FIG. 8A, the prediction unit 860 for the maximum coding unit can be divided into the maximum coding unit 810 and the prediction unit 860 for the maximum coding unit. In other words, the prediction unit for each of the sub-encoding units may be smaller than the sub-encoding unit.

예를 들어, 심도 1의 서브 부호화 단위 중 우측 하부에 외치한 서브 부호화 단위(854)에 대한 예측 단위는 서브 부호화 단위(854)보다 작을 수 있다. 심도 2의 서브 부호화 단위들(814, 816, 818, 828, 850, 852) 중 일부 서브 부호화 단위(815, 816, 850, 852)에 대한 예측 단위는 서브 부호화 단위보다 작을 수 있다. 또한, 심도 3의 서브 부호화 단위(822, 832, 848)에 대한 예측 단위는 서브 부호화 단위보다 작을 수 있다. 예측 단위는 각각의 서브 부호화 단위를 높이 또는 너비 방향으로 반분한 형태일 수도 있고, 높이 및 너비 방향으로 4분한 형태일 수도 있다.For example, a prediction unit for a sub-coding unit 854 coded right below the sub-coding unit at depth 1 may be smaller than the sub-coding unit 854. The prediction unit for some of the sub-encoding units 815, 816, 850, and 852 among the sub-encoding units 814, 816, 818, 828, 850, and 852 at the depth 2 may be smaller than the sub- In addition, the prediction unit for the sub-coding units 822, 832, and 848 of depth 3 may be smaller than the sub-coding unit. The prediction unit may be a form in which each sub-coding unit is halved in the height or width direction, or may be divided into four in height and width directions.

도 8b는 본 발명의 일 실시예에 따른 예측 단위 및 변환 단위를 도시한다. FIG. 8B shows a prediction unit and a conversion unit according to an embodiment of the present invention.

도 8b의 좌측은 도 8a의 우측에 도시된 최대 부호화 단위(810)에 대한 예측 단위의 분할 형태를 도시하고, 도 8b의 우측은 최대 부호화 단위(810)의 변환 단위의 분할 형태를 도시한다. The left side of FIG. 8B shows the division form of the prediction unit for the maximum coding unit 810 shown on the right side of FIG. 8A, and the right side of FIG. 8B shows the division form of the conversion unit of the maximum coding unit 810.

도 8b의 우측을 참조하면, 변환 단위(870)의 분할 형태는 예측 단위(860)와 상이하게 설정될 수 있다. Referring to the right side of FIG. 8B, the division type of the conversion unit 870 may be set differently from the prediction unit 860. [

예를 들어, 심도 1의 부호화 단위(854)에 대한 예측 단위가 높이를 반분한 형태로 선택되더라도, 변환 단위는 심도 1의 부호화 단위(854)의 크기와 동일한 크기로 선택될 수 있다. 마찬가지로, 심도 2의 부호화 단위(814, 850)에 대한 예측 단위가 심도 2의 부호화 단위(814, 850)의 높이를 반분한 형태로 선택되더라도 변환 단위는 심도 2의 부호화 단위(814, 850)의 원래 크기와 동일한 크기로 선택될 수 있다. For example, even if the prediction unit for the depth 1 encoding unit 854 is selected to be half the height, the conversion unit may be selected to be the same size as the depth unit 854 encoding unit. Likewise, even if the prediction unit for the depth 2 coding units 814 and 850 is selected in such a manner that the height of the depth level 2 coding units 814 and 850 is halved, the level of the level 2 coding units 814 and 850 It can be selected to be the same size as the original size.

예측 단위보다 더 작은 크기로 변환 단위가 선택될 수도 있다. 예를 들어, 심도 2의 부호화 단위(852)에 대한 예측 단위가 너비를 반분한 형태로 선택된 경우에 변환 단위는 예측 단위보다 더 작은 크기인 높이 및 너비를 반분한 형태로 선택될 수 있다.The conversion unit may be selected to be smaller than the prediction unit. For example, if the prediction unit for depth 2 coding unit 852 is chosen to be half the width, the conversion unit may be selected to be half the width and height, which is a smaller size than the prediction unit.

도 9는 본 발명의 일 실시예에 따른 움직임 벡터를 부호화하는 장치를 도시한다. 9 illustrates an apparatus for encoding a motion vector according to an embodiment of the present invention.

도 1과 관련하여 전술한 영상 부호화 장치(100) 또는 도 4와 관련하여 전술한 영상 부호화부(400)에 포함되어 움직임 벡터를 부호화하는 장치를 상세히 도시된다. 도 9를 참조하면, 본 발명의 일 실시예에 따른 움직임 벡터 부호화 장치(900)는 예측부(910), 제1 부호화부(920) 및 제2 부호화부(930)를 포함한다. The apparatus for encoding a motion vector included in the image encoding apparatus 100 described above with reference to FIG. 1 or the image encoding unit 400 described with reference to FIG. 4 is illustrated in detail. Referring to FIG. 9, a motion vector coding apparatus 900 according to an embodiment of the present invention includes a predictor 910, a first encoder 920, and a second encoder 930.

인터 예측 즉, 픽처간 예측을 이용해 부호화된 블록을 복호화하기 위해서는 현재 블록과 참조 픽처 내의 유사한 블록 사이의 위치 차이를 나타내는 움직임 벡터에 대한 정보가 필요하다. 따라서, 영상 부호화시에 움직임 벡터에 대한 정보를 부호화하여 비트스트림에 삽입하게 되는데, 움직임 벡터에 대한 정보를 그대로 부호화하여 삽입하면, 움직임 벡터에 대한 정보를 부호화하기 위한 오버헤드(overhead)가 증가하게 되어 영상 데이터의 압축률이 낮아진다.In order to decode a block coded by inter prediction or inter-picture prediction, information on a motion vector indicating a position difference between a current block and a similar block in a reference picture is needed. Therefore, when the image coding is performed, the information on the motion vector is encoded and inserted into the bitstream. If the information on the motion vector is directly encoded and inserted, an overhead for coding information on the motion vector increases And the compression rate of the video data is lowered.

따라서, 영상 부호화에서는 현재 블록의 움직임 벡터를 예측하고, 예측의 결과로 생성된 예측 움직임 벡터(motion vector predictor)와 원본 움직임 벡터와의 차분 벡터만을 부호화하여 비트스트림에 삽입으로써 움직임 벡터에 대한 정보도 압축한다. 도 9는 이러한 예측 움직임 벡터를 이용한 움직임 벡터를 부호화하는 장치를 도시한다. Therefore, in the image coding, only the difference vector between the motion vector predictor and the original motion vector generated as a result of the prediction is predicted, and information about the motion vector is also inserted Compress. FIG. 9 shows an apparatus for coding a motion vector using such a predictive motion vector.

도 9를 참조하면, 예측부(910)는 현재 블록의 예측 움직임 벡터가 명시 모드(explicit mode) 및 암시 모드(implicit mode) 중 어떤 모드에 기초해 예측 부호화되는지 결정한다.Referring to FIG. 9, the predictor 910 determines whether a predictive motion vector of a current block is predictively encoded based on an explicit mode or an implicit mode.

전술한 바와 같이, MPEG-4 H.264/MPEG-4 AVC(Advanced Video Coding)와 같은 코덱에서는 현재 블록의 움직임 벡터를 예측하기 위해 현재 블록에 인접한 이전에 부호화된 블록들의 움직임 벡터를 이용한다. 현재 블록에 좌측, 상부 및 우측 상부에 인접한 이전한 부호화된 블록들의 움직임 벡터들의 중앙값(median)을 현재 블록의 예측 움직임 벡터로 이용한다. 인터 예측을 이용해 부호화된 모든 블록의 움직임 벡터가 동일한 방법을 이용해 예측되기 때문에 예측 움직임 벡터에 대해 정보는 별도로 부호화할 필요가 없다. 그러나, 본원 발명에 따른 영상 부호화 장치(100) 또는 영상 부호화부(400)는 움직임 벡터를 보다 정확하게 예측하기 위해 전술한 예측 움직임 벡터에 대한 정보를 별도로 부호화하지 않는 모드 및 예측 움직임 벡터에 대한 정보를 부호화하는 모드를 모두 이용하는 바 이에 대해 상세히 후술한다.As described above, in a codec such as MPEG-4 H.264 / MPEG-4 AVC (Advanced Video Coding), a motion vector of a previously coded block adjacent to a current block is used to predict a motion vector of the current block. The median of the motion vectors of the previous coded blocks adjacent to the upper left, upper and right upper portions of the current block is used as the predicted motion vector of the current block. Since the motion vectors of all blocks coded using inter prediction are predicted using the same method, it is not necessary to separately encode information for the predicted motion vectors. However, in order to more accurately predict a motion vector, the image encoding apparatus 100 or the image encoding unit 400 according to the present invention may include a mode in which information on the predictive motion vector is not separately encoded, Encoding mode are all used, which will be described later in detail.

(1) 명시 모드(1) explicit mode

예측부(910)가 선택할 수 있는 예측 움직임 벡터를 부호화하는 방법 중 하나는 현재 블록의 예측 움직임 벡터에 대한 정보를 명시적으로 부호화하는 모드가 있을 수 있다. 명시 모드는 적어도 하나의 예측 움직임 벡터 후보들 중에서 어떤 예측 움직임 벡터를 이용해 현재 블록의 움직임 벡터를 예측하는지 지시하는 정보를 별도로 부호화하는 모드이다. 도 10a, 10b, 11a 내지 11c를 참조하여 본원 발명의 예측 움직임 벡터 후보를 설명한다. One of the methods for encoding the predictive motion vector that can be selected by the prediction unit 910 may be a mode for explicitly encoding information about the predictive motion vector of the current block. The explicit mode is a mode in which information indicating which one of the at least one predicted motion vector candidate is used to predict a motion vector of the current block is separately encoded. The predictive motion vector candidates of the present invention will be described with reference to Figs. 10A, 10B, 11A to 11C.

도 10a 및 10b는 본 발명의 일 실시예에 따른 명시 모드의 예측 움직임 벡터 후보들을 도시한다.10A and 10B show predicted motion vector candidates in explicit mode according to an embodiment of the present invention.

도 10a를 참조하면, 본 발명의 일 실시예에 따른 움직임 벡터 예측 방법은 현재 블록에 인접한 이전에 부호화된 블록들의 움직임 벡터 중 하나를 현재 블록의 예측 움직임 벡터로 이용할 수 있다. 현재 블록의 상부에 인접한 블록들 중 가장 좌측의 a0 블록, 좌측에 인접한 가장 상부의 b0 블록, 우측상부에 인접한 c 블록, 좌측상부에 인접한 d 블록 및 좌측하부에 인접한 e 블록을 모두 현재 블록의 예측 움직임 벡터로 이용할 수 있다.Referring to FIG. 10A, a motion vector prediction method according to an embodiment of the present invention can use one of motion vectors of previously coded blocks adjacent to a current block as a predicted motion vector of a current block. The leftmost a0 block, the uppermost b0 block adjacent to the left side, the c block adjacent to the upper right side, the d block adjacent to the upper left side, and the e block adjacent to the lower left side among the blocks adjacent to the upper portion of the current block, Can be used as a motion vector.

본 발명에 따른 영상 부호화 방법 및 복호화 방법은 심도에 의해 구분되는 다양한 크기의 부호화 단위를 기초로 영상 부호화 및 복호화를 수행하는 바, 좌측하부에 인접한 e 블록의 움직임 벡터도 현재 블록의 예측 움직임 벡터로 이용할 수 있다. The image encoding method and the decoding method according to the present invention perform image encoding and decoding based on coding units of various sizes classified by depth. The motion vector of the e block adjacent to the lower left is also a predicted motion vector of the current block Can be used.

도 8a을 참조하여 설명하면, 현재 블록이 부호화 단위(820)이면, 현재 블록의 상부, 좌측상부, 우측상부, 좌측 및 좌측하부의 부호화 단위들(814, 816, 818 및 822)은 현재 블록 이전에 부호화된다. 따라서, 현재 블록의 좌측하부에 인접한 블록의 움직임 벡터도 현재 블록의 예측 움직임 벡터로 이용할 수 있다.8A, when the current block is an encoding unit 820, the upper, left upper, right upper, left and lower left encoding units 814, 816, 818, and 822 of the current block are moved to the current block As shown in FIG. Therefore, a motion vector of a block adjacent to the lower left of the current block can also be used as a predicted motion vector of the current block.

도 10b를 참조하면, 현재 블록의 인접한 모든 블록의 움직임 벡터를 현재 블록의 예측 움직임 벡터로 이용할 수 있다. 다시 말해, 상부에 인접한 블록들 중 가장 좌측의 a0 블록뿐만 아니라 상부에 인접한 모든 블록들(a0 내지 aN)의 움직임 벡터를 현재 블록의 예측 움직임 벡터로 이용할 수 있으며, 좌측에 인접한 불록들 중 가장 상부의 b0 블록뿐만 아니라 좌측에 인접한 모든 블록들(b0 내지 bN)의 움직임 벡터를 현재 블록의 예측 움직임 벡터로 이용할 수 있다. Referring to FIG. 10B, a motion vector of all adjacent blocks of the current block can be used as a predicted motion vector of the current block. In other words, not only the leftmost a block of the blocks adjacent to the uppermost block but also the motion vectors of all blocks ao to aN adjacent to the top of the block ao can be used as a predicted motion vector of the current block. The motion vectors of all the blocks b0 to bN adjacent to the left side can be used as the predicted motion vectors of the current block.

또한, 인접한 블록들의 움직임 벡터의 중앙값을 예측 움직임 벡터로 이용할 수 있다. 다시 말해, median(mv_a0, mv_b0, mv_c)을 현재 블록의 예측 움직임 벡터로 이용할 수 있다. 여기서, mv_a0은 a0 블록의 움직임 벡터이고, mv_b0는 b0 블록의 움직임 벡터이며, mv_c는 c 블록의 움직임 벡터이다. In addition, a median of motion vectors of adjacent blocks can be used as a predicted motion vector. In other words, median (mv_a0, mv_b0, mv_c) can be used as the predicted motion vector of the current block. Here, mv_a0 is a motion vector of the a0 block, mv_b0 is a motion vector of the b0 block, and mv_c is a motion vector of the c block.

다만, 현재 블록의 크기 및 인접한 블록들의 크기에 따라 현재 블록의 예측 움직임 벡터 후보들을 제한할 수 있는 바, 도 10c 내지 10e를 참조하여 상세히 설명한다. However, the predicted motion vector candidates of the current block can be limited according to the size of the current block and the size of the adjacent blocks, and will be described in detail with reference to FIGS. 10C to 10E.

도 10c 내지 10e는 본 발명의 일 실시예에 따른 현재 블록에 인접한 다양한 크기의 블록들을 도시한다.Figures 10C-10E illustrate blocks of various sizes adjacent to a current block in accordance with an embodiment of the present invention.

전술한 바와 같이 본 발명에 따른 영상 부호화 방법 및 복호화 방법은 심도에 따라 결정되는 다양한 크기의 부호화 단위 및 예측 단위를 이용해 영상을 부호화한다. 따라서, 현재 블록에 인접한 블록들의 크기도 다양할 수 있는 바, 현재 블록의 크기와 일부 인접한 블록들의 크기가 크게 상이하면, 크기가 다른 일부 인접한 블록들의 움직임 벡터는 현재 블록의 예측 움직임 벡터로 이용하지 않을 수 있다.As described above, the image encoding method and the decoding method according to the present invention encode an image using various sizes of encoding units and prediction units determined according to the depth. Therefore, if the size of the current block and the size of some neighboring blocks are greatly different from each other, the motion vectors of some neighboring blocks having different sizes may be used as the predicted motion vectors of the current block. .

도 10c를 참조하면, 현재 블록(1010)의 상부에 인접한 블록들(1014 내지 1018)은 현재 블록(1010)의 크기보다 작은 블록들이다. 현재 블록(1010)과 크기가 동일한 크기의 인접한 블록(1012)의 움직임 벡터가 현재 블록(1010)의 움직임 벡터와 동일 또는 유사할 가능성이 높을 수 있으므로, 예측부(910)는 동일한 크기의 인접한 블록(1012)의 움직임 벡터만을 예측 움직임 벡터로 이용할 수 있다.Referring to FIG. 10C, blocks 1014 to 1018 adjacent to the top of the current block 1010 are blocks smaller than the size of the current block 1010. The motion vector of the adjacent block 1012 having the same size as the current block 1010 may be the same or similar to the motion vector of the current block 1010. Therefore, Only the motion vector of the motion vector prediction unit 1012 can be used as a predicted motion vector.

크기가 동일하지 않더라도, 소정 크기 이상의 인접한 블록들의 움직임 벡터들만 예측 움직임 벡터로 이용할 수 있다. 예를 들어, 현재 블록(1010)의 크기와 비교하여 1/4 크기 이상인 블록들(1012 및 1018)의 움직임 벡터들만을 예측 움직임 벡터로 이용할 수 있다.Even if the magnitudes are not the same, only the motion vectors of adjacent blocks of a predetermined size or more can be used as a predicted motion vector. For example, only the motion vectors of blocks 1012 and 1018 having a size equal to or larger than 1/4 of the size of the current block 1010 can be used as a predicted motion vector.

도 10d를 참조하면, 현재 블록(1020)의 좌측에 인접한 블록(1022)의 크기는 현재 블록의 16배로서, 현저한 크기의 차이가 존재한다. 현저한 크기의 차이로 인해 좌측에 인접한 블록(1022)의 움직임 벡터가 현재 블록(1020)의 움직임 벡터와 동일 또는 유사할 가능성이 낮을 수 있다. 따라서, 좌측에 인접한 블록(1022)의 움직임 벡터는 현재 블록(1020)의 예측 움직임 벡터로 이용하지 않고, 상부에 인접한 블록(1024) 및 좌측상부에 인접한 블록(1026)의 움직임 벡터만 이용할 수 있다.Referring to FIG. 10D, the size of the block 1022 adjacent to the left side of the current block 1020 is 16 times that of the current block, and there is a noticeable difference in size. The possibility that the motion vector of the block 1022 adjacent to the left side is the same as or similar to the motion vector of the current block 1020 due to the remarkable difference in size may be low. Therefore, the motion vector of the block 1022 adjacent to the left side is not used as the predicted motion vector of the current block 1020, but only the motion vector of the block 1024 adjacent to the upper side and the block 1026 adjacent to the upper left side can be used .

도 10e를 참조하면, 현재 블록(1030)의 크기가 인접한 모든 블록들(1031 내지 1037)의 크기보다 크다. 이 때, 인접한 모든 블록들(1031 내지 1037)의 움직임 벡터를 모두 현재 블록(1030)의 예측 움직임 벡터로 이용하면, 현재 블록(1030)의 예측 움직임 벡터 후보들의 개수가 너무 많을 수 있다. 현재 블록(1030)과 인접한 블록들(1031 내지 1037) 사이의 크기 차이가 클수록 예측 움직임 벡터 후보들의 개수는 더 많아진다. 따라서, 본 발명의 일 실시예에 따른 예측부(910)는 인접한 블록 중 일부 블록의 움직임 벡터는 현재 블록(1030)의 예측 움직임 벡터로 이용하지 않는다. Referring to FIG. 10E, the size of the current block 1030 is larger than the size of all adjacent blocks 1031 to 1037. In this case, if all the motion vectors of all the adjacent blocks 1031 to 1037 are used as the predicted motion vectors of the current block 1030, the number of the predicted motion vector candidates of the current block 1030 may be too large. The larger the difference in size between the current block 1030 and the adjacent blocks 1031 to 1037, the greater the number of predicted motion vector candidates. Therefore, the prediction unit 910 according to an embodiment of the present invention does not use a motion vector of some of the adjacent blocks as a predicted motion vector of the current block 1030. [

예를 들어, 도 10e에 도시된 실시예에서, 좌측하부에 인접한 블록(1031) 및 우측상부에 인접한 블록(1037)의 움직임 벡터는 현재 블록(1030)의 예측 움직임 벡터로 이용하지 않을 수 있다.For example, in the embodiment shown in FIG. 10E, the motion vectors of the block 1031 adjacent to the lower left and the block 1037 adjacent to the upper right may not be used as the predicted motion vector of the current block 1030. [

이를 보다 일반화하여, 현재 블록(1030)의 크기가 소정 크기 이상이면, 인접한 블록들 중 특정 방향으로 인접한 블록들의 움직임 벡터는 현재 블록(1030)의 예측 움직임 벡터로 이용하지 않을 수 있다.If the size of the current block 1030 is larger than a predetermined size, a motion vector of a block adjacent to a specific direction among neighboring blocks may not be used as a predicted motion vector of the current block 1030. [

도 11a 내지 11c는 본 발명의 또 다른 실시예에 따른 명시 모드의 예측 움직임 벡터 후보들을 도시한다.Figures 11A-11C illustrate predicted motion vector candidates in explicit mode in accordance with another embodiment of the present invention.

도 11a는 본 발명의 일 실시예에 따른 B 픽처(Bi-directional Predictive Picture)의 예측 움직임 벡터를 계산하는 방법을 도시한다. 현재 블록을 포함하는 현재 픽처가 양방향 예측을 수행하는 B 픽처인 경우 시간적 거리(tempral distance)에 기초해 생성된 움직임 벡터가 예측 움직임 벡터 후보일 수 있다.FIG. 11A illustrates a method of calculating a predictive motion vector of a B-directional predictive picture according to an embodiment of the present invention. If the current picture including the current block is a B-picture for bidirectional prediction, the motion vector generated based on the temporal distance may be a predicted motion vector candidate.

현재 픽처(1110)의 현재 블록(1100)의 예측 움직임 벡터(mv_temporal)는 시간적으로 선행하는 픽처(1112)의 동일한 위치(colocated)의 블록(1120)의 움직임 벡터를 이용해 생성될 수 있다. 예를 들어, 현재 블록(1100)과 동일한 위치의 블록(1120)의 움직임 벡터 mv_colA가 현재 픽처(1110)의 시간적으로 후행하는 픽처(1114)의 검색된 블록(1122)에 대해 생성되면, 현재 블록(1100)의 예측 움직임 벡터 후보들인 mv_L0A 및 mv_L1A 는 다음과 같이 생성될 수 있다. The predicted motion vector mv_temporal of the current block 1100 of the current picture 1110 may be generated using the motion vector of the block 1120 of the same colocated temporal preceding picture 1112. For example, if the motion vector mv_colA of the block 1120 in the same position as the current block 1100 is generated for the retrieved block 1122 of the temporally following picture 1114 of the current picture 1110, 1100), mv_L0A and mv_L1A, which are predicted motion vector candidates, can be generated as follows.

mv_L1A = (t1/t2) * mv_colAmv_L1A = (t1 / t2) * mv_colA

mv_L0A = mv_L1A - mv_colAmv_L0A = mv_L1A - mv_colA

여기서, mv_L0A는 시간적으로 선행하는 픽처(1112)에 대한 현재 블록(1110)의 예측 움직임 벡터를 의미하고, mv_L1A는 시간적으로 후행하는 픽처(1114)에 대한 현재 블록(1110)의 예측 움직임 벡터를 의미한다.Here, mv_L0A denotes a predicted motion vector of the current block 1110 with respect to a temporally preceding picture 1112, and mv_L1A denotes a predictive motion vector of the current block 1110 with respect to a temporally following picture 1114 do.

도 11a에 도시된 실시예에서는 B 픽처인 현재 픽처(1110)가 시간적으로 선행하는 픽처(1112)와 시간적으로 후행하는 픽처(1114) 사이에 존재한다. 이 때, 동일한 위치의 블록(1120)의 움직임 벡터 mv_colA가 현재 픽처(1110)의 시간적으로 후행하는 픽처(1114)에 대해 생성되면, mv_L1A에 기초해 현재 블록(1100)의 움직임 벡터를 보다 정확하게 예측할 수 있다. 다시 말해, mv_colA가 도 11a에 도시된 방향과 반대 방향의 움직임 벡터인 경우 즉, 시간적으로 선행하는 픽처(1112) 이전의 다른 픽처에 대해 생성된 경우보다 mv_colA가 도 11a에 도시된 방향의 움직임 벡터인 경우에 현재 블록(1100)의 움직임 벡터를 보다 정확하게 예측할 수 있다.In the embodiment shown in FIG. 11A, the current picture 1110 as a B picture exists between the temporally preceding picture 1112 and the temporally following picture 1114. At this time, when the motion vector mv_colA of the block 1120 in the same position is generated for the temporally following picture 1114 of the current picture 1110, the motion vector of the current block 1100 is predicted more accurately based on mv_L1A . In other words, when mv_colA is a motion vector opposite to the direction shown in Fig. 11A, that is, when mv_colA is generated for another picture preceding the temporally preceding picture 1112, The motion vector of the current block 1100 can be more accurately predicted.

따라서, 현재 블록(1110)으로부터 동일한 위치의 블록(1120)으로의 방향이 List0 방향이라면, 동일한 위치의 블록(1120)의 움직임 벡터 mv_colA는 List1 방향이어야, 도 11a에 도시된 바와 같이 현재 픽처(1110)가 선행하는 픽처(1112)와 후행하는 픽처(1114) 사이에 존재할 가능성이 높아져 mv_colA에 기초해 현재 블록(1100)의 움직임 벡터를 보다 정확하게 예측할 수 있다.Therefore, if the direction from the current block 1110 to the block 1120 at the same position is the List0 direction, the motion vector mv_colA of the block 1120 at the same position must be in the direction of List1. Is likely to exist between the preceding picture 1112 and the following picture 1114, so that the motion vector of the current block 1100 can be more accurately predicted based on mv_colA.

또한, 도 11a에 도시된 픽처들(1110 내지 1114)은 시간 순서에 따라 배열되어 있으므로, POC(Picture Order Count)에 기초해 현재 블록의 예측 움직임 벡터(mv_temporal)를 생성할 수 있다. 현재 블록이 참조하는 픽처가 도 11a에 픽처들(1112 및 1114)가 아닌 다른 픽처일 수 있으므로, POC에 기초해 현재 블록의 예측 움직임 벡터를 생성한다.In addition, since the pictures 1110 to 1114 shown in FIG. 11A are arranged in time order, a predicted motion vector (mv_temporal) of the current block can be generated based on POC (Picture Order Count). The predicted motion vector of the current block is generated based on the POC because the picture to which the current block refers may be a picture other than the pictures 1112 and 1114 in Fig. 11A.

예를 들어, 현재 픽처의 POC를 CurrPOC이고, 현재 픽처가 참조하는 픽처의 POC를 CurrRefPOC이라면, 현재 블록이 예측 움직임 벡터는 다음과 같이 생성될 수 있다. For example, if the POC of the current picture is CurrPOC and the POC of the picture referred to by the current picture is CurrRefPOC, the current block predictive motion vector can be generated as follows.

Scale = (CurrPOC-CurrRefPOC)/(ColPOC-ColRefPOC)Scale = (CurrPOC-CurrRefPOC) / (ColPOC-ColRefPOC)

mv_temporal = Scale*mv_colAmv_temporal = Scale * mv_colA

여기서 ColPOC는 동일한 위치의 블록(1120)이 포함되어 있는 시간적으로 선행하는 픽처(1112)의 POC이며, ColRefPOC는 동일한 위치의 블록(1120)이 참조하는 블록(1122)가 포함되어 있는 시간적으로 후행하는 픽처(1114)의 POC이다.Where ColPOC is the POC of the temporally preceding picture 1112 that contains the block 1120 of the same position and ColRefPOC is the temporal distance of the block 1122 containing the block 1122 referenced by the block 1120 of the same position POC of the picture 1114.

도 11b는 본 발명의 또 다른 실시예에 따른 B 픽처(Bi-directional Predictive Picture)의 예측 움직임 벡터를 생성하는 방법을 도시한다. 도 11a에 도시된 방법과 비교해보면, 시간적으로 후행하는 픽처(1114)에 현재 블록(1100)과 동일한 위치의 블록이 존재한다는 점이 상이하다.FIG. 11B shows a method of generating a predictive motion vector of a B-directional predictive picture according to another embodiment of the present invention. Compared with the method shown in Fig. 11A, there is a difference in that a temporally following picture 1114 has a block at the same position as the current block 1100. Fig.

도 11b를 참조하면, 현재 픽처(1110)의 현재 블록(1100)의 예측 움직임 벡터는 시간적으로 후행하는 픽처(1114)의 동일한 위치(colocated)의 블록(1130)의 움직임 벡터를 이용해 생성될 수 있다. 예를 들어, 현재 블록(1100)과 동일한 위치의 블록(1130)의 움직임 벡터 mv_colB가 현재 픽처(1110)의 시간적으로 선행하는 픽처(1112)의 검색된 블록(1132)에 대해 생성되면, 현재 블록(1100)의 예측 움직임 벡터 후보들인 mv_L0B 및 mv_L1B 는 다음과 같이 생성될 수 있다. 11B, the predicted motion vector of the current block 1100 of the current picture 1110 may be generated using the motion vector of the block 1130 of the same position (colocated) of the temporally following picture 1114 . For example, if the motion vector mv_colB of the block 1130 in the same position as the current block 1100 is generated for the retrieved block 1132 of the temporally preceding picture 1112 of the current picture 1110, 1100) mv_L0B and mv_L1B, which are predicted motion vector candidates, can be generated as follows.

mv_L0B = (t3/t4) * mv_colBmv_L0B = (t3 / t4) * mv_colB

mv_L1B = mv_L0B - mv_colBmv_L1B = mv_L0B - mv_colB

여기서, mv_L0B는 시간적으로 선행하는 픽처(1112)에 대한 현재 블록(1110)의 예측 움직임 벡터를 의미하고, mv_L1B는 시간적으로 후행하는 픽처(1114)에 대한 현재 블록(1100)의 예측 움직임 벡터를 의미한다.Here, mv_L0B denotes a predicted motion vector of the current block 1110 with respect to a temporally preceding picture 1112, and mv_L1B denotes a predicted motion vector of the current block 1100 with respect to a temporally following picture 1114 do.

도 11a와 마찬가지로 도 11b에 도시된 실시예에서도 B 픽처인 현재 픽처(1110)가 시간적으로 선행하는 픽처(1112)와 시간적으로 후행하는 픽처(1114) 사이에 존재한다. 따라서, 동일한 위치의 블록(1130)의 움직임 벡터 mv_colB가 시간적으로 선행하는 픽처(1112)에 대해 생성되면, mv_L0B에 기초해 현재 블록(1100)의 움직임 벡터를 보다 정확하게 예측할 수 있다. 다시 말해, _colB가 도 11b에 도시된 방향과 반대 방향의 움직임 벡터인 경우 즉, 시간적으로 후행하는 픽처(1114) 이후의 다른 픽처에 대해 생성된 경우보다 mv_colB가 도 11b에 도시된 방향의 움직임 벡터인 경우 현재 블록(1100)의 움직임 벡터를 보다 정확하게 예측할 수 있다..11A, the current picture 1110, which is a B picture, exists between the temporally preceding picture 1112 and the temporally following picture 1114 in the embodiment shown in FIG. 11B. Therefore, when the motion vector mv_colB of the block 1130 at the same position is generated for the temporally preceding picture 1112, the motion vector of the current block 1100 can be more accurately predicted based on mv_L0B. In other words, if _colB is a motion vector opposite to the direction shown in FIG. 11B, that is, mv_colB is generated for another picture after the temporally following picture 1114, The motion vector of the current block 1100 can be more accurately predicted.

따라서, 현재 블록(1110)으로부터 동일한 위치의 블록(1130)으로의 방향이 List1 방향이라면, 동일한 위치의 블록(1130)의 움직임 벡터 mv_colB는 List0 방향이어야, 도 11b에 도시된 바와 같이 현재 픽처(1110)가 선행하는 픽처(1112)와 후행하는 픽처(1114) 사이에 존재할 가능성이 높아져 mv_colB에 기초해 현재 블록(1100)의 움직임 벡터를 보다 정확하게 예측할 수 있다.Therefore, if the direction from the current block 1110 to the block 1130 at the same position is the List 1 direction, the motion vector mv_colB of the block 1130 at the same position must be in the direction of List 0, Is more likely to exist between the preceding picture 1112 and the following picture 1114, it is possible to more accurately predict the motion vector of the current block 1100 based on mv_colB.

또한, 현재 블록이 참조하는 픽처가 도 11b에 픽처들(1112 및 1114)이 아닌 다른 픽처일 수 있으므로, POC에 기초해 현재 블록의 예측 움직임 벡터를 생성한다.In addition, since the picture to which the current block refers may be a picture other than the pictures 1112 and 1114 in Fig. 11B, a predicted motion vector of the current block is generated based on the POC.

예를 들어, 현재 픽처의 POC를 CurrPOC이고, 현재 픽처가 참조하는 픽처의 POC를 CurrRefPOC이라면, 현재 블록이 예측 움직임 벡터는 다음과 같이 생성될 수 있다. For example, if the POC of the current picture is CurrPOC and the POC of the picture referred to by the current picture is CurrRefPOC, the current block predictive motion vector can be generated as follows.

Scale = (CurrPOC-CurrRefPOC)/(ColPOC-ColRefPOC)Scale = (CurrPOC-CurrRefPOC) / (ColPOC-ColRefPOC)

mv_temporal = Scale*mv_colB
mv_temporal = Scale * mv_colB

*여기서 ColPOC는 동일한 위치의 블록(1130)이 포함되어 있는 시간적으로 후행하는 픽처(1114)의 POC이며, ColRefPOC는 동일한 위치의 블록(1130)이 참조하는 블록(1132)가 포함되어 있는 시간적으로 선행하는 픽처(1112)의 POC이다.Where ColPOC is the POC of the temporally trailing picture 1114 that contains the block 1130 of the same position and ColRefPOC is the temporal precedence of the block 1132 containing the block 1132 referenced by the block 1130 of the same position Is the POC of the picture 1112.

예측부(910)가 B 픽처의 현재 블록(1100)의 예측 움직임 벡터를 생성함에 있어서, 도 11a에 도시된 방법 및 도 11b에 도시된 방법 중 하나를 이용할 수 있다. 다시 말해, 현재 블록(1100)과 동일한 위치의 블록(1120 또는 1130)의 움직임 벡터와 시간적 거리를 이용해 예측 움직임 벡터를 생성하므로, 동일한 위치의 블록(1120 및 1130)의 움직임 벡터가 반드시 존재해야 도 11a 및 11b에 도시된 방법을 이용해 예측 움직임 벡터를 생성할 수 있다. 따라서, 본 발명에 따른 예측부(910)는 동일한 위치의 블록들(1120 및 1130) 중 해당 블록에 대한 움직임 벡터가 존재하는 블록만을 이용해 현재 블록(1100)의 예측 움직임 벡터를 생성한다. In generating the predicted motion vector of the current block 1100 of the B picture, the predicting unit 910 may use one of the methods shown in Fig. 11A and the method shown in Fig. 11B. In other words, the motion vector of the block 1120 or 1130 at the same position as the current block 1100 is used to generate the predicted motion vector using the temporal distance, 11a and 11b to generate a predicted motion vector. Accordingly, the predictor 910 according to the present invention generates a predicted motion vector of the current block 1100 using only the block having the motion vector for the corresponding block among the blocks 1120 and 1130 of the same position.

예를 들어, 시간적으로 선행하는 픽처(1112)의 동일한 위치의 블록(1120)이 인터 예측이 아닌 인트라 예측을 이용해 부호화된 경우 해당 블록(1120)의 움직임 벡터는 존재하지 않으므로, 도 11a에 도시된 바와 같은 예측 움직임 벡터를 생성하는 방법을 이용해 현재 블록(1100)의 예측 움직임 벡터를 생성할 수는 없다.For example, when the block 1120 at the same position in the temporally preceding picture 1112 is coded using intra prediction rather than inter prediction, the motion vector of the corresponding block 1120 does not exist. Therefore, It is not possible to generate a predicted motion vector of the current block 1100 using a method of generating a predictive motion vector as shown in FIG.

도 11a 및 11b에 도시된 바와 같이 예측부(910)가 B 픽처의 현재 블록(1100)의 예측 움직임 벡터를 생성할 때, 시간적으로 선행하는 픽처(1112)의 동일한 위치의 블록(1120) 및 시간적으로 후행하는 픽처(1114)의 동일한 위치의 블록(1130)을 모두 이용할 수 있다. 따라서, 움직임 벡터를 복호화하는 측에서는 움직임 벡터 부호화 장치(900)가 복수의 동일한 위치의 블록(1120 및 1130) 중 어떤 블록을 이용해 예측 움직임 벡터(mv_temporal)를 생성하였는지 알아야 예측 움직임 벡터를 복호화할 수 있다.11A and 11B, when the predictor 910 generates the predictive motion vector of the current block 1100 of the B picture, the block 1120 at the same position of the temporally preceding picture 1112 and the temporal All of the blocks 1130 in the same position of the picture 1114 following the block 1110 can be used. Therefore, on the side of decoding the motion vector, it is necessary to know which block of the plurality of blocks 1120 and 1130 at the same position generates the predictive motion vector mv_temporal to decode the predictive motion vector .

이를 위해 움직임 벡터 부호화 장치(900)는 복수의 동일한 위치의 블록(1120 및 1130) 중 어떤 블록을 예측 움직임 벡터의 생성에 이용하는지 특정하기 위한 정보를 부호화하여 블록 헤더 또는 슬라이스 헤더에 삽입할 수 있다.For this, the motion vector coding apparatus 900 may encode information for specifying which block among the plurality of blocks 1120 and 1130 in the same position is used for generating a predictive motion vector, and insert the information into a block header or a slice header .

도 11c는 본 발명의 일 실시예에 따른 P 픽처(Predictive Picture)의 예측 움직임 벡터를 생성하는 방법을 도시한다.FIG. 11C shows a method of generating a predictive motion vector of a P-picture (Predictive Picture) according to an embodiment of the present invention.

도 11c를 참조하면, 현재 픽처(1110)의 현재 블록(1100)의 예측 움직임 벡터는 시간적으로 선행하는 픽처(1112)의 동일한 위치(colocated)의 블록(1140)의 움직임 벡터를 이용해 생성될 수 있다. 예를 들어, 현재 블록(1100)과 동일한 위치의 블록(1140)의 움직임 벡터 mv_colC가 또 다른 시간적으로 선행하는 픽처(1116)의 검색된 블록(1142)에 대해 생성되면, 현재 블록(1100)의 예측 움직임 벡터 후보인 mv_L0C는 다음과 같이 생성될 수 있다.11C, the predicted motion vector of the current block 1100 of the current picture 1110 may be generated using the motion vector of the block 1140 of the same colocated temporal preceding picture 1112 . For example, if the motion vector mv_colC of the block 1140 in the same position as the current block 1100 is generated for the retrieved block 1142 of another temporally preceding picture 1116, the prediction of the current block 1100 Mv_L0C, which is a motion vector candidate, can be generated as follows.

mv_L0C = (t6/t5) * mv_colCmv_L0C = (t6 / t5) * mv_colC

도 11a 및 11b와 관련하여 전술한 바와 같이 POC에 기초해 mv_L0C를 생성할 수도 있다. 현재 픽처(1110)의 POC, 현재 픽처(1110)가 참조하는 픽처의 POC, 시간적으로 선행하는 픽처(1112)의 POC 및 또 다른 시간적으로 선행하는 픽처(1116)의 POC에 기초해 mv_L0C를 생성할 수 있다. Mv_L0C may be generated based on the POC as described above with reference to Figures 11A and 11B. Mv_L0C is generated based on the POC of the current picture 1110, the POC of the picture referred to by the current picture 1110, the POC of the temporally preceding picture 1112 and the POC of another temporally preceding picture 1116 .

현재 픽처(1110)가 P 픽처이므로, 현재 블록(1100)의 예측 움직임 벡터 후보는 도 11a 및 11b와 달리 하나만 생성된다. Since the current picture 1110 is a P picture, only one candidate of the predicted motion vector of the current block 1100 is generated, unlike in FIGS. 11A and 11B.

종합하면, 도 10a 및 10b, 도 11a 내지 11c에 따라 다음과 같이 예측 움직임 벡터 후보들의 집합 C는 다음과 같이 생성될 수 있다.Taken together, a set C of predicted motion vector candidates may be generated as follows according to FIGS. 10A and 10B and FIGS. 11A through 11C as follows.

C = {median(mv_a0, mv_b0, mv_c), mv_a0, mv_a1 ..., mv_aN, mv_b0, mv_b1, ... , mv_bN, mv_c, mv_d, mv_e, mv_temporal} Mv_b0, mv_b1, ..., mv_bN, mv_c, mv_d, mv_e, mv_temporal}, mv_a0, mv_a1,

또는, 또는 예측 움직임 벡터 후보들의 개수를 줄여 생성할 수도 있다.Or, the number of prediction motion vector candidates may be reduced.

C = {median(mv_a', mv_b', mv_c'), mv_a', mv_b', mv_c', mv_temporal}C = {median (mv_a ', mv_b', mv_c '), mv_a', mv_b ', mv_c', mv_temporal}

여기서, mv_x는 x 블록의 움직임 벡터를 의미하고, median()은 중앙값을 의미하며, mv_temporal은 도 11a 내지 11c와 관련하여 전술한 시간적 거리를 이용해 생성된 예측 움직임 벡터 후보들을 의미한다. Here, mv_x denotes a motion vector of x block, median () denotes a median value, and mv_temporal denotes predicted motion vector candidates generated using the temporal distance described above with reference to Figs. 11A to 11C.

또한, mv_a'은 mv_a0, mv_a1, ... , mv_aN 중 유효한 최초의 움직임 벡터를 의미한다. 예를 들어, a0 블록이 인트라 예측을 이용해 부호화되었거나, 현재 블록과 다른 픽처를 참조하면, a0의 움직임 벡터인 mv_a0은 유효하지 않으므로, mv_a'=mv_a1이 되며, a1 블록의 움직임 벡터도 유효하지 않은 경우에는 mv_a'=mv_a2이다.Also, mv_a 'means the first motion vector effective among mv_a0, mv_a1, ..., mv_aN. For example, if the a0 block is coded using intraprediction or a different picture from the current block is referenced, mv_a0, which is a motion vector of a0, is not valid, so mv_a '= mv_a1, and a1 block motion vector is also invalid In the case of mv_a '= mv_a2.

마찬가지로, mv_b'은 mv_b0, mv_b1, ... , mv_bN 중 유효한 최초의 움직임 벡터를 의미하고, mv_c'은 mv_c, mv_d, mv_e 중 유효한 최초의 움직임 벡터를 의미한다.Likewise, mv_b 'denotes the first motion vector valid among mv_b0, mv_b1, ..., mv_bN, and mv_c' denotes the first motion vector valid among mv_c, mv_d, and mv_e.

현재 블록에 인접한 블록들의 움직임 벡터들 중 현재 블록과 다른 픽처를 참조하는 블록의 움직임 벡터는 현재 블록의 움직임 벡터를 효율적으로 예측할 수 없다. 따라서, 예측 움직임 벡터 후보들의 집합 C에서 현재 블록과 다른 픽처를 참조하는 블록의 움직임 벡터를 제외할 수 있다.A motion vector of a block that refers to a picture different from the current block among the motion vectors of blocks adjacent to the current block can not efficiently predict a motion vector of the current block. Therefore, the motion vector of a block that refers to a different picture from the current block in the set C of predicted motion vector candidates can be excluded.

명시 모드는 상기 C 집합 중 어떤 움직임 벡터를 현재 블록의 예측 움직임 벡터로 이용했는지 지시하는 정보를 부호화하는 모드이다. 예를 들어, 명시 모드로 움직임 벡터를 부호화하는 경우 C 집합의 원소 즉 예측 움직임 벡터 후보들에 각각에 대응되는 이진수를 할당하고, 그 중 하나가 현재 블록의 예측 움직임 벡터로 이용되는 경우 대응되는 이진수를 출력할 수 있다.The explicit mode is a mode for coding information indicating which motion vector of the set C is used as a predicted motion vector of the current block. For example, when coding a motion vector in the explicit mode, a binary number corresponding to each of the elements of the C set, that is, the predicted motion vector candidates is allocated, and when one of them is used as a predicted motion vector of the current block, a corresponding binary number Can be output.

C 집합의 원소 중 하나를 특정하기 위해 각각의 예측 움직임 벡터 후보에 대응되는 이진수를 할당하고, 이진수를 출력하기 때문에 C 집합의 원소의 개수가 적을수록 더 적은 비트의 이진수로 C 집합의 원소를 특정할 수 있다.
In order to specify one of the elements of the set C, a binary number corresponding to each of the predicted motion vector candidates is allocated and a binary number is output. Therefore, the smaller the number of elements of the C set, the smaller the number of elements of the C set can do.

*따라서, C 집합에서 중복되는 예측 움직임 벡터 후보가 있으면, 중복되는 예측 움직임 벡터 후보는 C 집합에서 제외하고, 이진수를 할당할 수 있다. 예를 들어, C 집합이 전술한 바와 같이 C = {median(mv_a', mv_b', mv_c'), mv_a', mv_b', mv_c', mv_temporal} 일 때, mv_a', mv_b' 및 mv_c'가 모두 동일하다면, C 집합을 C = {median(mv_a', mv_b', mv_c'), mv_a', mv_temporal}와 같이 세 개의 원소로 결정하고, 이진수를 할당할 수 있다. 중복되는 예측 움직임 벡터 후보를 제외하기 전에 C 집합의 원소들을 3 비트를 이용해 특정할 수 있다면, 중복되는 예측 움직임 벡터 후보를 제외한 후에는 C 집합의 원소들을 2 비트를 이용해 특정할 수 있다.Therefore, if there are duplicated predicted motion vector candidates in the C set, the duplicated predicted motion vector candidates can be excluded from the C set and assigned a binary number. For example, when C set is C = {median (mv_a ', mv_b', mv_c '), mv_a', mv_b ', mv_c', mv_temporal}, mv_a ', mv_b' and mv_c ' If it is the same, the C set can be determined by three elements such as C = {median (mv_a ', mv_b', mv_c '), mv_a', mv_temporal}, and binary numbers can be assigned. If the C set of elements can be specified using 3 bits before excluding the redundant predicted motion vector candidates, after eliminating the redundant predicted motion vector candidates, the C set of elements can be specified using 2 bits.

중복되는 예측 움직임 벡터 후보를 제외하는 대신 중복되는 예측 움직임 벡터 후보가 현재 블록의 예측 움직임 벡터로 결정될 확률을 높이기 위해 소정의 가중치(weight)를 부가할 수도 있다. 전술한 예에서 mv_a', mv_b' 및 mv_c'가 모두 동일하여 mv_a'만 C 집합에 포함되어 있으므로, mv_a'에 소정의 가중치를 부가하여 mv_a'가 현재 블록의 예측 움직임 벡터로 결정될 확률을 높일 수 있다.Instead of excluding overlapping predicted motion vector candidates, a predetermined weight may be added to increase the probability that the redundant predicted motion vector candidate is determined as the predicted motion vector of the current block. Since only mv_a ', mv_b' and mv_c 'are included in the C set in the above example, a predetermined weight is added to mv_a' to increase the probability that mv_a 'is determined as a predicted motion vector of the current block have.

또한, 예측 움직임 벡터 후보가 하나인 경우에는 명시 모드임에도 불구하고 예측 움직임 벡터 후보 중 하나를 특정하기 위한 이진수를 부호화하지 않을 수도 있다. 예를 들어, C 집합이 C = {median(mv_a0, mv_b0, mv_c), mv_a0, mv_a1 ..., mv_aN, mv_b0, mv_b1, ... , mv_bN, mv_c, mv_d, mv_e, mv_temporal} 인데, a0 내지 aN 블록, b0 내지 bN 블록, c 블록, d 블록, e 블록이 모두 인트라 예측된 블록들이면, C 집합은 C = {mv_temporal} 이므로, 실질적으로 하나의 원소 밖에 포함하지 않는다. 따라서, 이 경우에 움직임 벡터 부호화 장치(900)는 명시 모드임에도 불구하고 예측 움직임 벡터 후보 중 하나를 특정하기 위한 이진수를 부호화하지 않을 수도 있다. In addition, when there is one prediction motion vector candidate, the binary number for specifying one of the prediction motion vector candidates may not be encoded regardless of the explicit mode. For example, the C set is C = {median (mv_a0, mv_b0, mv_c), mv_a0, mv_a1 ... mv_aN, mv_b0, mv_b1, ..., mv_bN, mv_c, mv_d, mv_e, mv_temporal} If the aN block, the b0 to bN block, the c block, the d block, and the e block are all intraprediction blocks, then the C set is C = {mv_temporal}, so that it contains substantially only one element. Therefore, in this case, the motion vector coding apparatus 900 may not encode a binary number for specifying one of the predicted motion vector candidates, despite being in the explicit mode.

명시 모드와 관련하여 전술한 모든 예측 움직임 벡터 후보들 이외에 다른 예측 움직임 벡터 후보들이 이용될 수 있음은 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자는 쉽게 이해할 수 있다. It will be appreciated by those skilled in the art that other predictive motion vector candidates other than all the predictive motion vector candidates described above with respect to the explicit mode can be used.

(2) 암시 모드(2) Implicit mode

예측부(910)가 선택할 수 있는 예측 움직임 벡터를 부호화하는 방법 중 또 다른 하나는 현재 블록의 예측 움직임 벡터가 현재 블록에 인접한 이전에 부호화된 영역에 포함된 블록 또는 픽셀에 기초해 생성됨을 지시하는 정보만 부호화하는 모드이다. 이 모드는 명시 모드와 달리 예측 움직임 벡터를 특정하기 위한 정보를 부호화하지 않고, 암시 모드로 예측 움직임 벡터로 생성함을 지시하는 정보만 부호화하는 모드이다. Another method of coding the predictive motion vector that can be selected by the prediction unit 910 is to indicate that the predictive motion vector of the current block is generated based on a block or pixel included in a previously encoded area adjacent to the current block It is a mode to encode information only. Unlike the explicit mode, this mode is a mode in which information for specifying a predictive motion vector is not encoded but only information indicating that the predictive motion vector is generated in an implicit mode.

전술한 바와 같이 MPEG-4 H.264/MPEG-4 AVC(Advanced Video Coding)와 같은 코덱에서는 현재 블록의 움직임 벡터를 예측하기 위해 현재 블록에 인접한 이전에 부호화된 블록들의 움직임 벡터를 이용한다. 현재 블록에 좌측, 상부 및 우측 상부에 인접한 이전한 부호화된 블록들의 움직임 벡터들의 중앙값을 현재 블록의 예측 움직임 벡터로 이용하는데, 이 경우 명시 모드와 같이 예측 움직임 벡터 후보들 중 하나를 선택하기 위한 정보를 부호화하지 않아도 된다.As described above, in a codec such as MPEG-4 H.264 / MPEG-4 AVC (Advanced Video Coding), a motion vector of a previously coded block adjacent to a current block is used to predict a motion vector of the current block. The median of the motion vectors of the previous coded blocks adjacent to the upper left, upper and right upper blocks of the current block is used as a predicted motion vector of the current block. In this case, information for selecting one of the predicted motion vector candidates It is not necessary to encode it.

다시 말해, 영상 부호화 과정에서는 현재 블록의 예측 움직임 벡터가 암시 모드로 부호화되었음을 지시하는 정보만 부호화하면, 영상 복호화 과정에서는 현재 블록에 좌측, 상부 및 우측 상부에 인접한 이전한 복호화된 블록들의 움직임 벡터들의 중앙값을 현재 블록의 예측 움직임 벡터로 이용할 수 있다.In other words, in the image coding process, if only information indicating that the predictive motion vector of the current block is coded in the implicit mode is coded, in the image decoding process, the motion vectors of the previous decoded blocks adjacent to the left, The median value can be used as the predicted motion vector of the current block.

또한, 본 발명에 따른 영상 부호화 방법은 현재 블록에 인접한 이전에 부호화된 픽셀 값들을 탬플릿(template)으로 이용하여 예측 움직임 벡터를 생성하는 새로운 암시 모드를 제공한다. 도 12를 참조하여 상세히 설명한다. Also, the image encoding method according to the present invention provides a new implicit mode for generating a predicted motion vector using previously encoded pixel values adjacent to a current block as a template. Will be described in detail with reference to FIG.

도 12a는 본 발명의 일 실시예에 따른 암시 모드의 예측 움직임 벡터를 생성하는 방법을 도시한다. 12A illustrates a method of generating a predictive motion vector of an implicit mode according to an embodiment of the present invention.

도 12a를 참조하면, 현재 픽처(1210)의 현재 블록(1200)의 예측 움직임 벡터를 생성함에 있어, 현재 블록에 인접한 이전에 부호화된 영역(1220)에 포함된 픽셀들(1222)을 이용한다. 인접한 픽셀들(1222)을 이용해 참조 픽처(1212)를 검색하여 대응되는 픽셀들(1224)을 결정한다. SAD(Sum of Absolute Difference)를 계산하여 대응되는 픽셀들(1224)을 결정할 수 있다. 대응되는 픽셀들(1224)이 결정되면, 인접한 픽셀들(1222)의 움직임 벡터 mv_template가 생성되고, mv_template를 현재 블록(1200)의 예측 움직임 벡터로 이용할 수 있다. Referring to FIG. 12A, pixels 1222 contained in a previously encoded region 1220 adjacent to a current block are used in generating a predicted motion vector of a current block 1200 of a current picture 1210. The neighboring pixels 1222 are used to search the reference picture 1212 to determine the corresponding pixels 1224. The Sum of Absolute Difference (SAD) may be calculated to determine the corresponding pixels 1224. Once the corresponding pixels 1224 are determined, the motion vector mv_template of the neighboring pixels 1222 is generated and mv_template can be used as the predicted motion vector of the current block 1200.

mv_template를 참조 픽처(1212)에서 검색할 때, 전술한 예측 움직임 벡터 후보들의 집합 C를 이용할 수 있다. 도 12b를 참조하여 상세히 설명한다. When retrieving the mv_template from the reference picture 1212, it is possible to use the set C of the above-mentioned predicted motion vector candidates. Will be described in detail with reference to FIG. 12B.

도 12b는 본 발명의 일 실시예에 따른 암시 모드의 예측 움직임 벡터를 검색하는 방법을 도시한다.FIG. 12B illustrates a method of searching for a predictive motion vector in an implicit mode according to an embodiment of the present invention.

도 12b를 참조하면, 예측부(910)가 현재 블록(1200)에 인접한 픽셀들(1222)를 이용해 참조 픽처(1212)를 검색할 때, 소정의 검색 범위(1226)를 설정하고, 설정된 검색 범위(1226) 안에서만 대응되는 픽셀들(1224)를 검색할 수 있다.12B, when the predicting unit 910 searches for the reference picture 1212 using the pixels 1222 adjacent to the current block 1200, a predetermined search range 1226 is set, Pixels 1224 can be searched for corresponding pixels 1226 only in the pixels 1226. [

검색 범위(1226)는 전술한 예측 움직임 벡터 후보들에 기초해 설정할 수 있다. 예측 움직임 벡터 후보에 의해 검색 범위(1226)의 중심을 결정하고, 결정된 검색 범위(1226)의 중심으로부터 소정의 픽셀 범위 안에 포함되는 영역을 검색 범위(1226)로 설정할 수 있다. 예측 움직임 벡터 후보들은 복수일 수 있으므로, 복수의 검색 범위(1226)가 설정될 수 있고, 서로 상이한 픽처에 검색 범위(1226)가 설정될 수 있다.The search range 1226 can be set based on the above-described predicted motion vector candidates. The center of the search range 1226 may be determined by the predicted motion vector candidate and an area included in a predetermined pixel range from the center of the determined search range 1226 may be set to the search range 1226. [ Since there may be a plurality of predicted motion vector candidates, a plurality of search ranges 1226 may be set, and a search range 1226 may be set for different pictures.

복수의 검색 범위(1226)를 모두 검색하여 SAD가 가장 작은 대응되는 픽셀들(1224)를 결정하고, 결정에 기초해 mv_template를 생성한다. 현재 블록(1200)에 인접한 픽셀들(1222)의 크기 및 형태는 실시예에 따라 다양할 수 있는 바, 도 12c를 참조하여 상세히 설명한다.Searches all of the plurality of search ranges 1226 to determine the corresponding pixels 1224 having the smallest SAD, and generates an mv_template based on the determination. The size and shape of the pixels 1222 adjacent to the current block 1200 may vary according to the embodiment, and will be described in detail with reference to FIG. 12C.

도 12c는 본 발명의 일 실시예에 따른 예측 움직임 벡터를 생성하기 위해 이용되는 템플릿(template)을 도시한다. Figure 12C shows a template used to generate a predicted motion vector according to an embodiment of the present invention.

도 12c를 참조하면, 예측부(910)가 현재 블록(1200)의 예측 움직임 벡터를 도 12a에 도시된 바와 같이 생성하기 위해 이용하는 인접한 픽셀들(1222)는 다양한 크기와 형태일 수 있다. Referring to FIG. 12C, neighboring pixels 1222 that the predictor 910 uses to generate the predicted motion vector of the current block 1200 as shown in FIG. 12A may be of various sizes and shapes.

현재 블록(1200)의 크기가 4x4인 경우를 예로 들어 설명하면, 현재 블록(1220)에 인접한 픽셀들(1222)을 도 12c와 같이 9개의 픽셀들만 포함하도록 설정할 수도 있고, 더 많은 픽셀들이 포함되도록 인접한 픽셀들(1228)을 설정할 수도 있다. 또한, 인접한 픽셀들(1222)의 형태도 도 12a 내지 12c에 도시된 바와 같이 '┌'의 형태가 아닌 다른 형태로 설정할 수도 있다.For example, if the size of the current block 1200 is 4x4, the pixels 1222 adjacent to the current block 1220 may be set to include only nine pixels as shown in FIG. 12c, Adjacent pixels 1228 may be set. In addition, the shape of the adjacent pixels 1222 may be set to a shape other than '┌' as shown in FIGS. 12A to 12C.

도 12d는 본 발명의 일 실시예에 또 다른 실시예에 따른 예측 움직임 벡터를 생성하기 위해 이용되는 템플릿을 도시한다.12D shows a template used to generate a predicted motion vector according to another embodiment of the present invention.

SAD를 계산함에 있어, 현재 블록에 인접한 픽셀들(1222)를 모두 이용하지 않고, 현재 블록에 인접한 픽셀들(1222) 중 일부만을 이용할 수도 있다. 예를 들어, 4x4 크기의 현재 블록(1200)에 인접한 9개의 픽셀들(1222) 중에서 3개 또는 5개 또는 7개의 픽셀들만 이용해 SAD를 계산할 수 있다. 도 12d는 현재 블록의 좌측상부에 인접한 픽셀, 상부에 인접한 픽셀들 중 가장 우측에 위치한 픽셀 및 좌측에 인접한 픽셀들 중 가장 하부에 위치한 픽셀만을 이용해 SAD를 계산하기 위한 템플릿을 도시한다.In calculating the SAD, only a part of the pixels 1222 adjacent to the current block may be used instead of all of the pixels 1222 adjacent to the current block. For example, the SAD can be calculated using only three or five or seven pixels among the nine pixels 1222 adjacent to the current block 1200 of size 4x4. FIG. 12D shows a template for calculating the SAD using only the pixel located at the upper left of the current block, the pixel located at the right-hand side among the pixels adjacent to the upper side, and the pixel located at the bottom of the pixels adjacent to the left.

도 12b 내지 12d와 관련하여 전술한 템플릿의 다양한 크기 및 형태에 대한 정보는 움직임 벡터와 별도로 부호화되어 슬라이스 파라미터로서 부호화되어 슬라이스 헤더에 삽입될 수도 있고, 시퀀스(sequence) 파라미터로서 부호화되어 비트스트림에 삽입될 수도 있다.Information on various sizes and shapes of the template described above with reference to FIGS. 12B to 12D may be encoded separately as a motion vector, encoded as a slice parameter, inserted into a slice header, encoded as a sequence parameter, .

인접한 블록들의 움직임 벡터의 중앙값을 예측 움직임 벡터로 이용하는 모드를 implicit mode_1 이라 하고, 현재 블록에 인접한 픽셀들(1222)을 이용해 예측 움직임 벡터를 생성하는 모드를 implicit mode_2 라 한다면, 영상 부호화 과정에서는 이 두 가지 암시 모드 중 하나의 모드에 대한 정보를 부호화하고, 영상 복호화 과정에서는 모드에 대한 정보를 참조해 implicit mode_1 및 implicit mode_2 중 하나를 이용해 예측 움직임 벡터를 생성할 수 있다.If the mode for using the median of the motion vectors of adjacent blocks as a predictive motion vector is implicit mode_1 and the mode for generating predictive motion vectors using pixels 1222 adjacent to the current block is implicit mode_2, Information on a mode of one of the inter-gamut modes is encoded, and in the image decoding process, the predictive motion vector can be generated using one of the implicit mode_1 and the implicit mode_2 referring to the mode information.

(3) 모드의 선택(3) Selection of mode

예측부(910)가 전술한 명시 모드 및 암시 모드 중 하나를 선택하는 기준에는 다양한 기준들이 있을 수 있다. There may be various criteria for the predicting unit 910 to select one of the above-described explicit mode and implicit mode.

명시 모드는 복수의 예측 움직임 벡터 후보들 중 하나를 선택하는 것이므로, 현재 블록의 움직임 벡터와 보다 유사한 예측 움직임 벡터를 선택할 수 있다. 대신 복수의 예측 움직임 벡터 후보 중 하나를 지시하는 정보를 부호화하기 때문에 암시 모드보다 더 큰 오버헤드가 발생할 수 있다. 따라서, 크기가 큰 부호화 단위인 경우에 명시 모드로 움직임 벡터를 부호화하는 것이 타당하다. 크기가 큰 부호화 단위가 크기가 작은 부호화 단위보다 움직임 벡터를 잘못 예측할 경우 발생하는 오차가 커질 확률이 높고, 크기가 크기 때문에 단위 픽처마다 오버헤드가 발생하는 횟수가 적기 때문이다.Since the explicit mode selects one of a plurality of predicted motion vector candidates, it is possible to select a predicted motion vector more similar to the motion vector of the current block. Instead, it may encode information indicating one of a plurality of predicted motion vector candidates, resulting in greater overhead than the implicit mode. Therefore, it is appropriate to encode a motion vector in the explicit mode in the case of a large-size encoding unit. This is because the probability that an error occurs when a large-sized coding unit misses a motion vector more than a small-sized coding unit is high, and since the size is large, the number of times of occurrence of overhead per unit picture is small.

예를 들어, m 개의 64x64 크기의 부호화 단위로 균일하게 분할된 픽처를 명시 모드로 부호화하는 경우 오버헤드가 발생하는 횟수는 m 번이지만, 동일한 크기의 픽처를 4m 개의 32x32 크기의 부호화 단위로 균일하게 분할된 픽처를 명시 모드로 부호화하는 경우 오버헤드가 발생하는 횟수는 4m 번이다. For example, when coding a uniformly divided picture with m 64x64 coding units in the explicit mode, the number of times of occurrence of overhead is m times, but a picture of the same size is uniformly divided into 4m 32x32 coding units When the divided pictures are coded in the explicit mode, the number of overhead occurrences is 4m.

따라서, 본 발명에 따른 예측부(910)가 현재 블록의 움직임 벡터를 부호화함에 있어 명시 모드 및 암시 모드 중 하나를 부호화 단위의 크기에 기초해 선택할 수 있다. Therefore, when the prediction unit 910 according to the present invention encodes the motion vector of the current block, one of the explicit mode and the implicit mode can be selected based on the size of the encoding unit.

도 1 내지 8과 관련하여 전술한 본 발명에 따른 영상 부호화, 복호화 방법에서 부호화 단위의 크기는 심도에 의해 표현되므로, 예측부(910)는 현재 블록의 심도에 기초해 현재 블록의 움직임 벡터를 명시 모드로 부호화할지 암시 모드로 부호화할지 선택한다. 예를 들어, 심도 0 및 심도 1의 부호화 단위를 인터 예측하는 경우에는 부호화 단위의 움직임 벡터를 명시 모드로 부호화하고, 심도 2 이상의 부호화 단위를 인터 예측하는 경우에는 암시 모드로 부호화할 수 있다.In the image encoding and decoding method according to the present invention described above with reference to FIGS. 1 to 8, since the size of an encoding unit is represented by depth, the predictor 910 specifies a motion vector of the current block based on the depth of the current block. Mode or in an implicit mode. For example, in the case of inter prediction of a coding unit of depth 0 and depth 1, a motion vector of a coding unit is coded in the explicit mode, and in the case of inter prediction of coding units of depth 2 or more, coding can be performed in an implicit mode.

본 발명의 또 다른 실시예에 따르면, 예측부(910)는 픽처 또는 슬라이스 단위로 명시 모드 또는 암시 모드를 선택할 수 있다. 픽처 또는 슬라이스 단위마다 영상 특성이 상이하므로, 이를 고려하여 픽처 또는 슬라이스 단위로 명시 모드 또는 암시 모드를 선택할 수 있다. R-D 코스트를 고려하여 명시 모드 및 암시 모드 중 최적의 모드를 선택해 현재 픽처 또는 슬라이스에 포함된 부호화 단위들의 움직임 벡터들을 예측 부호화할 수 있다.According to another embodiment of the present invention, the predicting unit 910 can select the explicit mode or the implicit mode in units of pictures or slices. Since the picture characteristics are different for each picture or slice unit, a clear mode or an implicit mode can be selected in units of pictures or slices considering this. It is possible to predictively encode motion vectors of coding units included in the current picture or slice by selecting an optimal mode from the explicit mode and the implicit mode considering the R-D cost.

예를 들어, 명시 모드를 이용하지 않아도 픽처 또는 슬라이스에 포함된 부호화 단위들의 움직임 벡터들을 정확하게 예측할 수 있다면, 픽처 또는 슬라이스에 포함된 모든 부호화 단위들의 움직임 벡터들을 암시 모드로 예측 부호화할 수 있다.For example, if motion vectors of coding units included in a picture or a slice can be accurately predicted without using the explicit mode, motion vectors of all coding units included in a picture or slice can be predictively encoded in an implicit mode.

또한, 본 발명의 또 다른 실시예에 따르면, 예측부(910)는 현재 블록이 스킵 모드로 부호화 되었는지 여부에 따라 명시 모드 및 암시 모드 중 하나를 선택할 수도 있다. 스킵 모드란 현재 블록이 스킵 모드로 부호화되었음을 지시하는 플래그 정보만 부호화하고, 픽셀 값은 부호화하지 않는 부호화 모드를 의미한다. According to another embodiment of the present invention, the predicting unit 910 may select either the explicit mode or the implicit mode depending on whether the current block is coded in the skip mode. The skip mode refers to an encoding mode in which only flag information indicating that the current block is coded in the skip mode is encoded, and pixel values are not encoded.

스킵 모드는 예측 움직임 벡터를 현재 블록의 움직임 벡터로 이용해 움직임 보상하여 생성된 예측 블록이 현재 블록과 매우 유사하면, 현재 블록의 픽셀 값을 부호화하지 않는 모드이다. 따라서, 예측 움직임 벡터를 현재 블록의 움직임 벡터와 유사하게 생성할수록 스킵 모드로 현재 블록을 부호화할 확률이 높아진다. 따라서, 스킵 모드로 부호화되는 블록은 명시 모드로 부호화할 수 있다. The skip mode is a mode in which the pixel value of the current block is not encoded if the prediction block generated by motion compensation using the predicted motion vector as a motion vector of the current block is very similar to the current block. Accordingly, as the predictive motion vector is generated similar to the motion vector of the current block, the probability of encoding the current block in the skip mode increases. Therefore, the block to be coded in the skip mode can be encoded in the explicit mode.

다시 도 9를 참조하면, 예측부(910)에서 명시 모드 및 암시 모드 중 하나를 선택하고, 선택된 모드에 따라 예측 움직임 벡터를 결정하면, 제1 부호화(920) 및 제2 부호화부(930)는 부호화 모드에 대한 정보 및 움직임 벡터를 부호화한다. Referring again to FIG. 9, when one of the explicit mode and the implicit mode is selected in the predicting unit 910 and the predicted motion vector is determined according to the selected mode, the first encoding unit 920 and the second encoding unit 930 Information on a coding mode and a motion vector are encoded.

먼저, 제1 부호화부(920)는 현재 블록의 예측 움직임 벡터에 대한 정보를 부호화한다. 예측부(910)에서 명시 모드로 현재 블록의 움직임 벡터를 부호화할 것을 선택하면, 명시 모드로 예측 움직임 벡터가 생성되었음을 지시하는 정보 및 복수의 예측 움직임 벡터 후보들 중에서 어떤 예측 움직임 벡터가 현재 블록의 예측 움직임 벡터로 이용되었는지 지시하는 정보를 부호화한다. First, the first encoder 920 encodes information on a predicted motion vector of a current block. If the prediction unit 910 selects to encode the motion vector of the current block in the explicit mode, information indicating that the predictive motion vector has been generated in the explicit mode and information indicating which of the plurality of predicted motion vector candidates are to be predicted And information indicating whether the motion vector is used as a motion vector is encoded.

또한, 복수의 예측 움직임 벡터 후보가 도 11a 내지 11c와 관련하여 전술한 mv_temporal을 포함하면, mv_temporal 생성에 기초가 된 동일한 위치의 블록(1200 또는 1300)이 현재 픽처에 시간적으로 선행하는 픽처의 블록인지 후행하는 픽처의 블록인지 지시하는 정보도 함께 부호화한다.Further, if a plurality of predicted motion vector candidates include mv_temporal described above with reference to Figs. 11A to 11C, it is determined whether blocks (1200 or 1300) at the same position based on mv_temporal generation are blocks of temporally preceding pictures Information indicating whether the block is a block of a following picture is also coded.

반면에, 예측부(910)에서 암시 모드로 현재 블록의 움직임 벡터를 부호화할 것을 선택하면, 암시 모드로 현재 블록의 예측 움직임 벡터를 생성함을 지시하는 정보를 부호화한다. 다시 말해, 현재 블록에 인접한 블록 또는 픽셀을 이용해 현재 블록의 예측 움직임 벡터를 생성함을 지시하는 정보를 부호화한다. 두 개 이상의 암시 모드가 있는 경우 어떤 암시 모드를 이용해 현재 블록의 예측 움직임 벡터를 생성하였는지 지시하는 정보를 부호화할 수도 있다.On the other hand, if the prediction unit 910 selects to encode the motion vector of the current block in the implicit mode, information indicating that the motion vector of the current block is generated in the implicit mode is encoded. In other words, information indicating that a predictive motion vector of the current block is generated using a block or pixel adjacent to the current block is encoded. If there are more than two implicit modes, it may be possible to encode information indicating which of the implicit modes is used to generate the predictive motion vector of the current block.

암시 모드는 현재 블록의 예측 움직임 벡터 후보들에 기초해 검색 범위를 설정하고, 도 12c에 도시된 바와 같은 현재 블록에 인접한 이전에 부호화된 영역의 픽셀들에 기초해 설정된 검색 범위를 검색하여 예측 움직임 벡터를 생성하는 모드일 수 있다.The implicit mode sets the search range based on the predicted motion vector candidates of the current block and searches the search range set based on the pixels of the previously encoded area adjacent to the current block as shown in FIG. As shown in FIG.

제2 부호화부(930)는 예측부(910)에서 결정된 예측 움직임 벡터에 기초해 현재 블록의 움직임 벡터를 부호화한다. 움직임 보상 결과 생성된 현재 블록의 움직임 벡터에서 예측부(910)에서 생성된 예측 움직임 벡터를 감산하여 차이 벡터를 생성한다. 그런 다음 차이 벡터에 대한 정보를 부호화한다. The second encoder 930 encodes the motion vector of the current block based on the predicted motion vector determined by the predictor 910. A difference vector is generated by subtracting the predicted motion vector generated by the predictor 910 from the motion vector of the current block generated as a result of motion compensation. Then, information about the difference vector is encoded.

도 13은 본 발명의 일 실시예에 따른 움직임 벡터를 복호화하는 장치를 도시한다. 13 shows an apparatus for decoding a motion vector according to an embodiment of the present invention.

도 2와 관련하여 전술한 영상 부호화 장치(200) 또는 도 5와 관련하여 전술한 영상 부호화부(500)에 포함되어 움직임 벡터를 복호화하는 장치를 상세히 도시된다. 도 13을 참조하면, 본 발명의 일 실시예에 따른 움직임 벡터 복호화 장치(1300)는 제1 복호화부(1310), 제2 복호화부(1320), 예측부(1330) 및 움직임벡터복원부(1340)를 포함한다. An apparatus for decoding a motion vector included in the image encoding apparatus 200 described above with reference to FIG. 2 or the image encoding unit 500 described with reference to FIG. 5 is illustrated in detail. 13, a motion vector decoding apparatus 1300 according to an embodiment of the present invention includes a first decoding unit 1310, a second decoding unit 1320, a predicting unit 1330, and a motion vector restoring unit 1340 ).

제1 복호화부(1310)는 비트스트림에 포함되어 있는 현재 블록의 예측 움직임 벡터에 대한 정보를 복호화한다. 현재 블록의 예측 움직임 벡터가 명시 모드 또는 암시 모드로 부호화되었는지를 나타내는 정보를 복호화한다. The first decoding unit 1310 decodes information on the predicted motion vector of the current block included in the bitstream. And decodes information indicating whether the predicted motion vector of the current block is coded in the explicit mode or the implicit mode.

명시 모드로 현재 블록의 예측 움직임 벡터가 부호화된 경우에는 복수의 예측 움직임 벡터 후보들 중에서 현재 블록의 예측 움직임 벡터로 이용한 하나의 예측 움직임 벡터를 지시하는 정보도 복호화한다. When the predictive motion vector of the current block is coded in the explicit mode, information indicating one predictive motion vector used as the predictive motion vector of the current block among the plurality of predictive motion vector candidates is also decoded.

또한, 복수의 예측 움직임 벡터 후보가 도 11a 내지 11c와 관련하여 전술한 mv_temporal을 포함하면, mv_temporal 생성에 기초가 된 동일한 위치의 블록(1200 또는 1300)이 현재 픽처에 시간적으로 선행하는 픽처의 블록인지 후행하는 픽처의 블록인지 지시하는 정보도 함께 복호화한다.Further, if a plurality of predicted motion vector candidates include mv_temporal described above with reference to Figs. 11A to 11C, it is determined whether blocks (1200 or 1300) at the same position based on mv_temporal generation are blocks of temporally preceding pictures Information indicating whether the block is a block of a following picture is also decoded.

암시 모드로 현재 블록의 예측 움직임 벡터가 부호화된 경우에는 복수의 암시 모드 중 어떤 암시 모드로 현재 블록의 예측 움직임 벡터가 부호화되었는지 지시하는 정보도 복호화할 수 있다. When the predictive motion vector of the current block is coded in the implicit mode, information indicating which predictive motion vector of the current block is encoded in which of the plurality of implicit modes is also decoded.

암시 모드는 현재 블록의 예측 움직임 벡터 후보들에 기초해 검색 범위를 설정하고, 도 12c에 도시된 바와 같은 현재 블록에 인접한 이전에 부호화된 영역의 픽셀들에 기초해 설정된 검색 범위를 검색하여 예측 움직임 벡터를 생성하는 모드일 수 있다.The implicit mode sets the search range based on the predicted motion vector candidates of the current block and searches the search range set based on the pixels of the previously encoded area adjacent to the current block as shown in FIG. As shown in FIG.

제2 복호화부(1310)는 비트스트림에 포함되어 있는 현재 블록의 움직임 벡터와 예측 움직임 벡터 사이의 차이 벡터를 복호화한다.The second decoding unit 1310 decodes the difference vector between the motion vector and the predicted motion vector of the current block included in the bitstream.

예측부(1330)는 제1 복호화부(1310)에서 복호화된 현재 블록의 예측 움직임 벡터에 대한 정보에 기초해 현재 블록의 예측 움직임 벡터를 생성한다.
The predicting unit 1330 generates a predicted motion vector of the current block based on the information on the predicted motion vector of the current block decoded by the first decoding unit 1310. [

*명시 모드로 부호화된 현재 블록의 예측 움직임 벡터에 대한 정보를 복호화한 경우에는 도 10a 및 10b, 11a 내지 11c와 관련하여 전술한 예측 움직임 벡터 후보들 중 하나의 예측 움직임 벡터를 생성하여 현재 블록의 예측 움직임 벡터로서 이용한다. When information on the predictive motion vector of the current block coded in the explicit mode is decoded, one of the predictive motion vector candidates described above with reference to Figs. 10A and 10B and 11A to 11C is generated, And is used as a motion vector.

암시 모드로 부호화된 현재 블록의 예측 움직임 벡터에 대한 정보를 복호화한 경우에는 현재 블록에 인접한 이전에 부호화된 영역에 포함되어 있는 블록 또는 픽셀을 이용해 현재 블록의 예측 움직임 벡터를 생성한다. 현재 블록에 인접한 블록들의 움직임 벡터들의 중앙값을 현재 블록의 예측 움직임 벡터로서 생성하거나, 현재 블록에 인접한 픽셀들을 이용해 참조 픽처를 검색하여 현재 블록의 예측 움직임 벡터를 생성한다. When information on a predictive motion vector of a current block coded in an implicit mode is decoded, a predictive motion vector of the current block is generated using a block or pixel included in a previously coded area adjacent to the current block. A median of motion vectors of blocks adjacent to the current block is generated as a predictive motion vector of the current block or a reference picture is retrieved using pixels adjacent to the current block to generate a predictive motion vector of the current block.

움직임벡터복원부(1340)는 예측부(1330)에서 생성된 예측 움직임 벡터 및 제2 복호화부(320)에서 복호화된 차이 벡터를 가산하여 현재 블록의 움직임 벡터를 복원한다. 복원된 움직임 벡터는 현재 블록의 움직임 보상에 이용된다.The motion vector restoring unit 1340 restores the motion vector of the current block by adding the predictive motion vector generated by the predicting unit 1330 and the difference vector decoded by the second decoding unit 320. [ The restored motion vector is used for motion compensation of the current block.

도 14는 본 발명의 일 실시예에 따른 움직임 벡터를 부호화하는 방법을 설명하기 위한 흐름도이다.14 is a flowchart illustrating a method of coding a motion vector according to an embodiment of the present invention.

도 14를 참조하면, 본 발명의 일 실시예에 따른 움직임 벡터 부호화 장치는 단계 1410에서 예측 움직임 벡터에 대한 정보를 부호화는 모드로서 명시 모드 및 암시 모드 중 하나의 모드를 선택한다. Referring to FIG. 14, in step 1410, a motion vector coding apparatus according to an exemplary embodiment of the present invention selects one of an explicit mode and an implicit mode as a mode for encoding information on a predictive motion vector.

명시 모드는 예측 움직임 벡터에 대한 정보로서 적어도 하나의 예측 움직임 벡터 후보들 중 하나의 예측 움직임 벡터 후보를 지시하는 정보를 부호화하는 모드이고, 암시 모드는 예측 움직임 벡터에 대한 정보로서 현재 블록에 인접한 이전에 부호화된 영역에 포함된 블록 또는 픽셀에 기초해 예측 움직임 벡터를 생성함을 지시하는 정보를 부호화하는 모드이다. 상세한 설명은 도 10a 내지 10e, 11a 내지 11c 및 12a 내지 12c와 관련하여 전술하였다.The explicit mode is a mode for coding information indicating a predicted motion vector candidate of at least one predicted motion vector candidate as information for a predicted motion vector, and the implied mode is a mode for previously And information indicating that a predictive motion vector should be generated based on the block or pixel included in the encoded region. The detailed description has been given above with reference to Figs. 10A to 10E, 11A to 11C and 12A to 12C.

현재 블록의 크기 즉, 현재 블록의 심도에 기초해 모드를 선택하거나, 현재 블록이 포함된 현재 픽처 또는 현재 슬라이스 단위로 모드를 선택할 수 있다. 또한, 현재 블록이 스킵 모드로 부호화되었는지 여부에 따라 모드를 선택할 수도 있다. The mode can be selected based on the size of the current block, that is, the depth of the current block, or the mode can be selected in the current picture or the current slice unit including the current block. In addition, the mode may be selected depending on whether or not the current block is coded in the skip mode.

단계 1420에서 움직임 벡터 부호화 장치는 단계 1410에서 선택된 모드에 따라 예측 움직임 벡터를 결정한다. 단계 1410에서 선택된 명시 모드 또는 암시 모드에 기초해 현재 블록의 예측 움직임 벡터를 결정한다. 명시 모드에 따라 적어도 하나의 예측 움직임 벡터 후보들 중 하나의 예측 움직임 벡터 후보를 현재 블록의 예측 움직임 벡터로 결정하거나, 암시 모드에 따라 현재 블록에 인접한 블록 또는 픽셀에 기초해 현재 블록의 예측 움직임 벡터를 결정한다.In step 1420, the motion vector coding apparatus determines a predicted motion vector according to the mode selected in step 1410. [ The predictive motion vector of the current block is determined based on the explicit mode or the implicit mode selected in step 1410. A predictive motion vector candidate of one of at least one predictive motion vector candidate is determined as a predictive motion vector of a current block according to the explicit mode or a predictive motion vector of a current block is determined based on a block or a pixel adjacent to the current block according to an implicit mode .

단계 1430에서 움직임 벡터 부호화 장치는 단계 1420에서 결정된 예측 움직임 벡터에 대한 정보를 부호화한다. In step 1430, the motion vector coding apparatus encodes the information on the predicted motion vector determined in step 1420.

명시 모드의 경우 적어도 하나의 예측 움직임 벡터 후보들 중 하나의 예측 움직임 벡터를 지시하는 정보 및 현재 블록의 예측 움직임 벡터에 대한 정보가 명시 모드에 따라 부호화됨을 지시하는 정보를 부호화한다.
In the explicit mode, information indicating one predictive motion vector of at least one predictive motion vector candidate and information indicating that predictive motion vector information of the current block is encoded according to the explicit mode is encoded.

*또한, 복수의 예측 움직임 벡터 후보가 도 11a 내지 11c와 관련하여 전술한 mv_temporal을 포함하면, mv_temporal 생성에 기초가 된 동일한 위치의 블록(1200 또는 1300)이 현재 픽처에 시간적으로 선행하는 픽처의 블록인지 후행하는 픽처의 블록인지 지시하는 정보도 함께 부호화한다.Furthermore, if a plurality of predicted motion vector candidates include mv_temporal as described above in connection with Figs. 11A to 11C, a block 1200 or 1300 at the same position, on which the mv_temporal generation is based, blocks a block of temporally preceding pictures Information indicating whether or not a block of a picture following the current picture is also coded.

암시 모드의 경우 현재 블록의 예측 움직임 벡터가 현재 블록에 인접한 이전에 부호화된 영역에 포함된 블록 또는 픽셀에 기초해 생성됨을 지시하는 정보를 부호화한다. 복수의 암시 모드가 있는 경우 이 중 하나의 암시 모드를 지시하는 정보도 부호화될 수 있다.In the case of the implicit mode, information indicating that a predictive motion vector of the current block is generated based on a block or pixel included in a previously encoded area adjacent to the current block is encoded. If there are a plurality of implicit modes, information indicating one of the implicit modes can also be encoded.

암시 모드는 현재 블록의 예측 움직임 벡터 후보들에 기초해 검색 범위를 설정하고, 도 12c에 도시된 바와 같은 현재 블록에 인접한 이전에 부호화된 영역의 픽셀들에 기초해 설정된 검색 범위를 검색하여 예측 움직임 벡터를 생성하는 모드일 수 있다. The implicit mode sets the search range based on the predicted motion vector candidates of the current block and searches the search range set based on the pixels of the previously encoded area adjacent to the current block as shown in FIG. As shown in FIG.

단계 1440에서 움직임 벡터 부호화 장치는 단계 1420에서 결정된 예측 움직임 벡터를 현재 블록의 움직임 벡터에서 감산하여 생성된 차이 벡터를 부호화한다. In step 1440, the motion vector coding apparatus codes the difference vector generated by subtracting the predicted motion vector determined in step 1420 from the motion vector of the current block.

도 15는 본 발명의 일 실시예에 따른 움직임 벡터를 복호화하는 방법을 설명하기 위한 흐름도이다.15 is a flowchart illustrating a method of decoding a motion vector according to an embodiment of the present invention.

도 15를 참조하면, 본 발명의 일 실시예에 따른 움직임 벡터 복호화 장치는 단계 1510에서 비트스트림에 포함된 현재 블록의 예측 움직임 벡터에 대한 정보를 복호화한다. 명시 모드 및 모시 모드 중 현재 블록의 예측 움직임 벡터를 부호화하는데 이용된 모드에 대한 정보를 복호화한다. Referring to FIG. 15, in step 1510, a motion vector decoding apparatus according to an embodiment of the present invention decodes information on a predicted motion vector of a current block included in a bitstream. And decodes the information on the mode used to encode the predictive motion vector of the current block in the explicit mode and the ambiguous mode.

명시 모드의 경우 현재 블록의 예측 움직임 벡터가 명시 모드에 따라 부호화되었음을 지시하는 정보 및 적어도 하나의 예측 움직임 벡터 후보들 중 하나의 예측 움직임 벡터 후보에 대한 정보를 복호화한다. In the explicit mode, information indicating that the predicted motion vector of the current block is coded according to the explicit mode and information on one predicted motion vector candidate of the at least one predicted motion vector candidate are decoded.

또한, 복수의 예측 움직임 벡터 후보가 도 11a 내지 11c와 관련하여 전술한 mv_temporal을 포함하면, mv_temporal 생성에 기초가 된 동일한 위치의 블록(1200 또는 1300)이 현재 픽처에 시간적으로 선행하는 픽처의 블록인지 후행하는 픽처의 블록인지 지시하는 정보도 함께 부호화한다.Further, if a plurality of predicted motion vector candidates include mv_temporal described above with reference to Figs. 11A to 11C, it is determined whether blocks (1200 or 1300) at the same position based on mv_temporal generation are blocks of temporally preceding pictures Information indicating whether the block is a block of a following picture is also coded.

암시 모드의 경우 현재 블록의 예측 움직임 벡터가 현재 블록에 인접한 이전에 복호화된 영역에 포함된 블록 또는 픽셀에 기초해 생성됨을 지시하는 정보를 복호화한다. 복수의 암시 모드가 있는 경우 복수의 암시 모드 중 하나의 암시 모드를 지시하는 정보도 함께 복호화될 수 있다.In the case of the implicit mode, information indicating that the predicted motion vector of the current block is generated based on the block or pixel included in the previously decoded area adjacent to the current block. If there is a plurality of implicit modes, information indicating one implicit mode of the plurality of implicit modes can also be decoded together.

암시 모드는 현재 블록의 예측 움직임 벡터 후보들에 기초해 검색 범위를 설정하고, 도 12c에 도시된 바와 같은 현재 블록에 인접한 이전에 부호화된 영역의 픽셀들에 기초해 설정된 검색 범위를 검색하여 예측 움직임 벡터를 생성하는 모드일 수 있다.The implicit mode sets the search range based on the predicted motion vector candidates of the current block and searches the search range set based on the pixels of the previously encoded area adjacent to the current block as shown in FIG. As shown in FIG.

단계 1520에서 움직임 벡터 복호화 장치는 차이 벡터에 대한 정보를 복호화한다. 차이 벡터는 현재 블록의 예측 움직임 벡터와 현재 블록의 움직임 벡터 사이의 차이에 대한 벡터이다. In step 1520, the motion vector decoding apparatus decodes information on difference vectors. The difference vector is a vector for the difference between the predicted motion vector of the current block and the motion vector of the current block.

단계 1530에서 움직임 벡터 복호화 장치는 단계 1510에서 복호화된 예측 움직임 벡터에 대한 정보에 기초해 현재 블록의 예측 움직임 벡터를 생성한다. 명시 모드 또는 암시 모드에 따라 현재 블록의 예측 움직임 벡터를 생성한다. 적어도 하나의 예측 움직임 벡터 후보들 중에서 하나의 예측 움직임 벡터를 선택하거나, 현재 블록에 인접한 이전에 복호화된 영역에 포함된 블록 또는 픽셀을 이용해 현재 블록의 예측 움직임 벡터를 생성한다.In step 1530, the motion vector decoding apparatus generates a predicted motion vector of the current block based on the information on the predicted motion vector decoded in step 1510. The predictive motion vector of the current block is generated according to the explicit mode or the implicit mode. A predictive motion vector of at least one predictive motion vector candidate is selected or a predictive motion vector of a current block is generated using a block or pixel included in a previously decoded area adjacent to the current block.

단계 1540에서 움직임 벡터 부호화 장치는 단계 1520에서 복호화된 차이 벡터와 단계 1530에서 생성된 예측 움직임 벡터를 가산하여 현재 블록의 움직임 벡터를 복원한다. In operation 1540, the motion vector encoding apparatus reconstructs the motion vector of the current block by adding the difference vector decoded in operation 1520 and the motion vector generated in operation 1530.

이상과 같이 본 발명은 비록 한정된 실시예와 도면에 의해 설명되었으나, 본 발명이 상기의 실시예에 한정되는 것은 아니며, 이는 본 발명이 속하는 분야에서 통상의 지식을 가진 자라면 이러한 기재로부터 다양한 수정 및 변형이 가능하다. 따라서, 본 발명의 사상은 아래에 기재된 특허청구범위에 의해서만 파악되어야 하고, 이와 균등하거나 또는 등가적인 변형 모두는 본 발명 사상의 범주에 속한다 할 것이다. 또한, 본 발명에 따른 시스템은 컴퓨터로 읽을 수 있는 기록매체에 컴퓨터가 읽을 수 있는 코드로서 구현하는 것이 가능하다. While the present invention has been particularly shown and described with reference to exemplary embodiments thereof, it is to be understood that the invention is not limited to the disclosed exemplary embodiments, but, on the contrary, Modification is possible. Accordingly, the spirit of the present invention should be understood only in accordance with the following claims, and all of the equivalent or equivalent variations will fall within the scope of the present invention. In addition, the system according to the present invention can be embodied as computer-readable codes on a computer-readable recording medium.

예를 들어, 본 발명의 예시적인 실시예에 따른 영상 부호화 장치, 영상 복호화 장치, 영상 부호화부, 영상 복호화부, 움직임 벡터 부호화 장치 및 움직임 벡터 복호화 장치는 도 1, 2, 4, 5, 9 및 13에 도시된 바와 같은 장치의 각각의 유닛들에 커플링된 버스, 상기 버스에 결합된 적어도 하나의 프로세서를 포함할 수 있다. 또한, 명령, 수신된 메시지 또는 생성된 메시지를 저장하기 위해 상기 버스에 결합되어, 전술한 바와 같은 명령들을 수행하기 위한 적어도 하나의 프로세서에 커플링된 메모리를 포함할 수 있다. For example, the image encoding apparatus, the image decoding apparatus, the image encoding unit, the image decoding unit, the motion vector encoding apparatus, and the motion vector decoding apparatus according to the exemplary embodiments of the present invention are shown in FIGS. 1, 2, 4, 5, 9, A bus coupled to each unit of the apparatus as shown at 13, and at least one processor coupled to the bus. It may also include a memory coupled to the bus for storing instructions, received messages or generated messages, and coupled to the at least one processor for performing the instructions as described above.

또한, 컴퓨터가 읽을 수 있는 기록매체는 컴퓨터 시스템에 의하여 읽혀질 수 있는 데이터가 저장되는 모든 종류의 기록장치를 포함한다. 기록매체의 예로는 ROM, RAM, CD-ROM, 자기 테이프, 플로피 디스크, 광데이터 저장장치 등이 있다. 또한 컴퓨터가 읽을 수 있는 기록매체는 네트워크로 연결된 컴퓨터 시스템에 분산되어 분산방식으로 컴퓨터가 읽을 수 있는 코드가 저장되고 실행될 수 있다.
In addition, the computer-readable recording medium includes all kinds of recording apparatuses in which data that can be read by a computer system is stored. Examples of the recording medium include ROM, RAM, CD-ROM, magnetic tape, floppy disk, optical data storage, and the like. The computer-readable recording medium may also be distributed over a networked computer system so that computer readable code can be stored and executed in a distributed manner.

Claims (1)

움직임 벡터의 복호화 방법.A method of decoding a motion vector.
KR1020140148724A 2014-10-29 2014-10-29 Method and apparatus for encoding/decoding motion vector KR101617334B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020140148724A KR101617334B1 (en) 2014-10-29 2014-10-29 Method and apparatus for encoding/decoding motion vector

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020140148724A KR101617334B1 (en) 2014-10-29 2014-10-29 Method and apparatus for encoding/decoding motion vector

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
KR1020140058640A Division KR101635111B1 (en) 2014-05-15 2014-05-15 Method and apparatus for encoding/decoding motion vector

Publications (2)

Publication Number Publication Date
KR20140136415A true KR20140136415A (en) 2014-11-28
KR101617334B1 KR101617334B1 (en) 2016-05-02

Family

ID=52456679

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020140148724A KR101617334B1 (en) 2014-10-29 2014-10-29 Method and apparatus for encoding/decoding motion vector

Country Status (1)

Country Link
KR (1) KR101617334B1 (en)

Also Published As

Publication number Publication date
KR101617334B1 (en) 2016-05-02

Similar Documents

Publication Publication Date Title
KR101522850B1 (en) Method and apparatus for encoding/decoding motion vector
KR101452859B1 (en) Method and apparatus for encoding and decoding motion vector
KR101768208B1 (en) Method and apparatus for encoding/decoding motion vector based on reduced motion vector predictor candidates
KR101859451B1 (en) Method and apparatus for encoding/decoding image by using motion vector of previous block as motion vector of current block
KR101974140B1 (en) Method and apparatus for encoding/decoding motion vector based on reduced motion vector predictor candidates
KR101676791B1 (en) Method for decoding an image
KR101691553B1 (en) Method and apparatus for decoding image
KR101635111B1 (en) Method and apparatus for encoding/decoding motion vector
KR101882949B1 (en) Method and apparatus for encoding image, and computer-readable medium
KR101783965B1 (en) Method and apparatus for decoding image
KR101635114B1 (en) Method for decoding an image
KR101477546B1 (en) Apparatus for decoding motion vector
KR101477545B1 (en) Method for decoding motion vector
KR101617334B1 (en) Method and apparatus for encoding/decoding motion vector
KR101424977B1 (en) Method and apparatus for encoding/decoding motion vector
KR101617796B1 (en) Method and apparatus for decoding image
KR101606812B1 (en) Method and apparatus for decoding image
KR101454664B1 (en) Method for decoding motion vector

Legal Events

Date Code Title Description
A107 Divisional application of patent
A201 Request for examination
E902 Notification of reason for refusal
E701 Decision to grant or registration of patent right
GRNT Written decision to grant
FPAY Annual fee payment

Payment date: 20190328

Year of fee payment: 4