KR100774299B1 - Method and apparatus for decoding motion vectors - Google Patents

Method and apparatus for decoding motion vectors Download PDF

Info

Publication number
KR100774299B1
KR100774299B1 KR1020070075878A KR20070075878A KR100774299B1 KR 100774299 B1 KR100774299 B1 KR 100774299B1 KR 1020070075878 A KR1020070075878 A KR 1020070075878A KR 20070075878 A KR20070075878 A KR 20070075878A KR 100774299 B1 KR100774299 B1 KR 100774299B1
Authority
KR
South Korea
Prior art keywords
motion vector
block
current block
picture
neighboring
Prior art date
Application number
KR1020070075878A
Other languages
Korean (ko)
Other versions
KR20070090124A (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 KR1020070075878A priority Critical patent/KR100774299B1/en
Publication of KR20070090124A publication Critical patent/KR20070090124A/en
Application granted granted Critical
Publication of KR100774299B1 publication Critical patent/KR100774299B1/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/124Quantisation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock

Abstract

움직임 벡터의 복호화 방법 및 장치가 개시된다. 본 발명에 따른 움직임 벡터의 복호화 방법은 매크로블록 내에 구비된 현재 블록의 크기와 위치에 따라서 현재 블록의 예측 움직임 벡터로 사용될 움직임 벡터를 갖는 이웃 블록을 선택하는 단계 및 선택된 이웃 블록의 움직임 벡터를 현재 블록의 예측 움직임 벡터로 선택하는 단계를 포함하며, 현재 블록의 예측 움직임 벡터로 사용될 이웃 블록을 선택하는 단계는 매크로 블록 내의 현재 블록의 크기가 16x8이고 현재 블록이 매크로 블록 내의 상측 블록인 경우, 현재 블록의 상측에 인접한 이웃 블록의 움직임 벡터를 현재 블록의 예측 움직임 벡터로 선택하는 것을 특징으로 한다.A method and apparatus for decoding a motion vector are disclosed. According to another aspect of the present invention, there is provided a method of decoding a motion vector, the method comprising: selecting a neighboring block having a motion vector to be used as a predicted motion vector of a current block according to a size and a position of a current block included in the macroblock; Wherein the step of selecting a neighboring block to be used as a predictive motion vector of a current block includes selecting a predictive motion vector of a current block as a predictive motion vector of the current block if the current block size in the macroblock is 16x8 and the current block is an upper block in the macroblock, And a motion vector of a neighboring block adjacent to an upper side of the block is selected as a predicted motion vector of the current block.

Description

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

본 발명은 움직임 벡터의 부호화 및 복호화에 관한 것으로, 보다 상세하게는 복수개의 픽처를 참조하여 산출된 움직임 벡터를 부호화하는 방법, 복호화하는 및 그 장치에 관한 것이다.BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to motion vector coding and decoding, and more particularly, to a method and a device for coding a motion vector calculated with reference to a plurality of pictures.

MPEG-1 또는 MPEG-2 부호화 표준에 따르면, 현재의 픽처를 부호화함에 있어 과거의 픽처를 참조하는 P-픽춰 부호화 방법과 과거와 미래의 픽처 두 개를 모두 참조하는 B-픽춰 부호화 방법을 채용하고 이를 기반으로 움직임 보상을 수행한다. 또한, 부호화 효율을 높이기 위해 현재 블록의 움직임 벡터를 그대로 부호화하는 것이 아니라 이웃한 블록들 간의 움직임 벡터들 간의 연관성이 반영되도록 이웃 블록들의 움직임 벡터들을 이용하여 예측 부호화를 수행하고 있다.According to the MPEG-1 or MPEG-2 coding standard, in encoding a current picture, a P-picture coding method which refers to a past picture and a B-picture coding method which refers to both past and future pictures are adopted And motion compensation is performed based on this. In addition, in order to increase the coding efficiency, the motion vector of the current block is not encoded as it is, but prediction coding is performed using motion vectors of neighboring blocks so that the association between motion vectors between neighboring blocks is reflected.

예측 부호화에 사용되는 이웃 블록들의 움직임 벡터는 현재 블록의 그것과 동일한 참조 픽처를 사용하지 않게 되는 경우가 발생할 수 있다. 이와 같은 경우가 발생하면 종래에는 참조 픽처가 같지 않은 이웃 블록의 움직임 벡터를 예측 부호화 과정에서 제외시키는 방식으로 대처해왔다. 다른 참조 픽처를 기반으로 얻어 진 움직임 벡터가 예측 부호화에 참여하게 되면 부호화 효율이 떨어질 수 있기 때문이다. 하지만, 다른 참조 픽처를 갖는 이웃 블록의 움직임 벡터를 예측 부호화 과정에서 제외시키면 이웃하는 블록들의 움직임 벡터의 연관성을 반영하는 정도가 낮아지고 따라서 움직임 벡터의 부호화 효율이 그만큼 저하될 수 있다. 참조 픽처가 서로 다른 경우가 빈번한 블록들로 구성된 픽처의 경우에는 더욱 그러하다.It may happen that the motion vectors of neighboring blocks used for predictive coding do not use the same reference picture as that of the current block. When such a case occurs, a motion vector of a neighboring block which is not the same as a reference picture has been dealt with in a process of excluding it from a predictive coding process. If the motion vector obtained based on another reference picture participates in the prediction coding, the coding efficiency may be lowered. However, if the motion vector of a neighboring block having a different reference picture is excluded from the predictive coding process, the degree of relevance of motion vectors of neighboring blocks is lowered, and thus the coding efficiency of the motion vector may be reduced accordingly. This is particularly so in the case of a picture in which the reference pictures are frequently different from each other.

본 발명의 목적은 참조 픽처가 서로 상이한 움직임 벡터 간에 대해서도 보다 효율적인 예측 부호화를 수행할 수 있는 움직임 벡터 부호화 방법, 그 복호화 방법 및 그 장치를 제공하는 것이다.An object of the present invention is to provide a motion vector coding method, a decoding method thereof, and an apparatus therefor, which can more efficiently perform predictive coding even for motion vectors different from each other in reference pictures.

본 발명의 다른 목적은 참조 픽처가 서로 상이한 움직임 벡터들 중 적어도 일부를 재조정하여 부호화 효율을 높이는 움직임 벡터 부호화 방법, 그 복호화 방법 및 그 장치를 제공하는 것이다.Another object of the present invention is to provide a motion vector coding method, a decoding method thereof, and an apparatus therefor, which improve coding efficiency by re-adjusting at least a part of motion vectors which are different from each other.

본 발명에 따라, 움직임 벡터를 부호화하는 방법에 있어서, (a) 현재 블록에 이웃하는 복수개의 이웃 블록들 중 상기 현재 블록의 움직임 벡터와 상이한 타입의 움직임 벡터를 가진 이웃 블록에 대해 상기 현재 블록의 움직임 벡터와 동일한 타입의 움직임 벡터를 예측하여 예측 움직임 벡터를 구하는 단계; (b) 구해진 예측 움직임 벡터를 포함하여 상기 이웃 블록들의 움직임 벡터들 중 상기 현재 블록의 움직임 벡터와 동일한 타입의 움직임 벡터들에 대한 대표값을 산출하는 단계; (c) 산출된 대표값과 상기 현재 블록의 움직임 벡터와의 오차값을 산출하는 단계; 및 (d) 산출된 오차값을 부호화하는 단계를 포함하는 것을 특징으로 하는 방법에 의해서도 달성된다.According to another aspect of the present invention, there is provided a method of coding a motion vector, the method comprising the steps of: (a) determining, for a neighboring block having a motion vector of a type different from a motion vector of the current block among a plurality of neighboring blocks neighboring the current block, Estimating a motion vector of the same type as a motion vector to obtain a predicted motion vector; (b) calculating a representative value of the motion vectors of the same type as the motion vector of the current block among the motion vectors of the neighboring blocks including the predicted motion vector; (c) calculating an error value between the calculated representative value and the motion vector of the current block; And (d) encoding the calculated error value.

한편, 본 발명의 다른 분야에 따르면, 움직임 벡터를 부호화하는 장치에 있어서, 현재 블록에 이웃하는 복수개의 이웃 불록들 중 상기 현재 블록의 움직임 벡 터와 상이한 타입의 움직임 벡터들을 가진 이웃 블록에 대해 상기 현재 블록의 움직임 벡터와 동일한 타입의 움직임 벡터를 예측하여 예측 움직임 벡터를 구한 다음, 구해진 예측 움직임 벡터를 포함하여 상기 이웃 블록들의 움직임 벡터들 중 상기 현재 블록의 움직임 벡터와 동일한 타입의 움직임 벡터들에 대한 대표값을 산출하고, 산출된 대표값과 상기 현재 블록의 움직임 벡터와의 오차값을 산출하는 움직임 벡터 예측기; 및 산출된 오차값을 부호화하는 움직임 벡터 부호화기를 포함하는 것을 특징으로 하는 장치에 의해서도 달성된다.According to another aspect of the present invention, there is provided an apparatus for coding a motion vector, the apparatus comprising: a motion vector estimating unit for estimating, for a neighboring block having a motion vector of a different type from a motion vector of the current block among a plurality of neighboring blocks neighboring the current block, A motion vector of the same type as the motion vector of the current block is predicted to obtain a predicted motion vector and motion vectors of the same type as the motion vector of the current block among the motion vectors of the neighboring blocks, A motion vector predictor for calculating an error value between the calculated representative value and the motion vector of the current block; And a motion vector encoder for coding the calculated error value.

상기 현재 블록의 움직임 벡터가 포워드 움직임 벡터 MVf이고 상기 이웃 블록의 움직임 벡터는 백워드 움직임 벡터 MVb일 때, 상기 움직임 벡터 예측기는 상기 예측 움직임 벡터인 포워드 움직임 벡터 MVf(예측)를 다음 식에 의해 산출하는 것이 바람직하다.When the motion vector of the current block is the forward motion vector MVf and the motion vector of the neighboring block is the backward motion vector MVb, the motion vector predictor calculates the forward motion vector MVf (prediction), which is the predictive motion vector, .

MVf(예측) = {상기 이웃 블록이 속하는 현재 픽처와 참조한 과거 픽처의 거리/(상기 이웃 블록이 참조한 미래 픽처와 상기 과거 픽처의 거리 - 상기 이웃 블록이 속하는 현재 픽처와 참조한 과거 픽처의 거리)}*MVbMVf (prediction) = {Distance between the current picture to which the neighboring block belongs and the reference picture to which the neighboring block belongs / Distance between the future picture referenced by the neighboring block and the past picture - Distance between the current picture to which the neighboring block belongs and the past picture to which the neighboring block belongs) * MVb

상기 현재 블록의 움직임 벡터가 백워드 움직임 벡터 MVb이고 상기 이웃 블록의 움직임 벡터는 포워드 움직임 벡터 MVf일 때, 상기 움직임 벡터 예측기는 상기 예측 움직임 벡터인 백워드 움직임 벡터 MVb(예측)를 다음 식에 의해 산출하는 것이 바람직하다.When the motion vector of the current block is the backward motion vector MVb and the motion vector of the neighboring block is the forward motion vector MVf, the motion vector predictor calculates the backward motion vector MVb (prediction), which is the predictive motion vector, .

MVb(예측) = {(상기 이웃 블록이 참조한 미래 픽처와 상기 과거 픽처의 거리 - 상기 이웃 블록이 속하는 현재 픽처와 참조한 과거 픽처의 거리)/상기 이웃 블록 이 속하는 현재 픽처와 참조한 과거 픽처의 거리}*MVfMVb (prediction) = {(distance between the future picture referred to by the neighboring block and the previous picture, distance between the current picture to which the neighboring block belongs and the past reference picture) / distance between the current picture to which the neighboring block belongs, * MVf

상기 움직임 벡터 예측기는 다음 식에 의해 산출된 대표값인 예측값 PMV_X을 구하는 것이 바람직하다.The motion vector predictor preferably obtains a predictive value PMV_X, which is a representative value calculated by the following equation.

PVM_X = median(MVf_A, MVf_B, MVf_C) 또는 median(MVb_A, MVb_B, MVb_C)PVM_X = median (MVf_A, MVf_B, MVf_C) or median (MVb_A, MVb_B, MVb_C)

여기서, MVf_A, MVf_B, MVf_C, MVb_A, MVb_B, 및 MVb_C은 상기 이웃 블록들의 움직임 벡터의 성분들로서, MVf_A는 좌측 블록의 포워드 움직임 벡터를, MVf_B는 상측 블록의 포워드 움직임 벡터를, MVf_C는 우상측 블록의 포워드 움직임 벡터를, MVb_A는 좌측 블록의 백워드 움직임 벡터를. MVb_B는 상측 블록의 백워드 움직임 벡터를, MVb_C는 우상측 블록의 백워드 움직임 벡터를 의미한다. 상기 예측 움직임 벡터는 이들 중 어느 하나일 수 있다.Here, MVf_A, MVf_B, MVf_C, MVb_A, MVb_B, and MVb_C are components of the motion vectors of the neighboring blocks, MVf_A is the forward motion vector of the left block, MVf_B is the forward motion vector of the upper block, MVb_A is the backward motion vector of the left block. MVb_B denotes a backward motion vector of the upper block, and MVb_C denotes a backward motion vector of the upper right block. The predictive motion vector may be any one of them.

한편, 본 발명의 다른 분야에 따르면, 상기 목적은 움직임 벡터를 복호화하는 방법에 있어서, (a) 현재 블록에 이웃하는 복수개의 이웃 블록들 중 상기 현재 블록과 상이한 타입의 움직임 벡터를 가진 이웃 블록에 대해 상기 현재 블록의 움직임 벡터와 동일한 타입의 움직임 벡터를 예측하여 예측 움직임 벡터를 구하는 단계; (b) 구해진 예측 움직임 벡터를 포함하여 상기 이웃 블록들의 움직임 벡터들 중 상기 현재 블록과 동일한 타입의 움직임 벡터들에 대한 대표값을 산출하는 단계; 및 (c) 산출된 대표값과 복호화된 오차값을 더하여 상기 현재 블록의 움직임 벡터를 산출하는 단계를 포함하는 것을 특징으로 하는 방법에 의해서도 달성된다.According to another aspect of the present invention, there is provided a method of decoding a motion vector, the method comprising the steps of: (a) decoding neighboring blocks having a motion vector of a type different from the current block from a plurality of neighboring blocks neighboring the current block; Estimating a motion vector of the same type as the motion vector of the current block to obtain a predicted motion vector; (b) calculating a representative value of the motion vectors of the same type as the current block among the motion vectors of the neighboring blocks including the predicted motion vector; And (c) calculating a motion vector of the current block by adding the calculated representative value and the decoded error value.

상기 현재 블록의 움직임 벡터가 포워드 움직임 벡터 MVf이고 상기 이웃 블록의 움직임 벡터는 백워드 움직임 벡터 MVb일 때, 상기 예측 움직임 벡터인 포워 드 움직임 벡터 MVf(예측)는 다음 식에 의해 산출되는 것이 바람직하다.When the motion vector of the current block is the forward motion vector MVf and the motion vector of the neighboring block is the backward motion vector MVb, the forward motion vector MVf (prediction), which is the predictive motion vector, is calculated by the following equation .

MVf(예측) = {상기 이웃 블록이 속하는 현재 픽처와 참조한 과거 픽처의 시간차/(상기 이웃 블록이 참조한 미래 픽처와 상기 과거 픽처의 시간차 - 상기 이웃 블록이 속하는 현재 픽처와 참조한 과거 픽처의 시간차)}*MVbMVf (prediction) = {time difference between the current picture to which the neighboring block belongs and the referenced past picture / (time difference between the future picture referenced by the neighboring block and the past picture - temporal difference between the current picture to which the neighboring block belongs and the past picture to which the neighboring block belongs) * MVb

상기 현재 블록의 움직임 벡터가 백워드 움직임 벡터 MVb이고 상기 이웃 블록의 움직임 벡터는 포워드 움직임 벡터 MVf일 때, 상기 예측 움직임 벡터인 백워드 움직임 벡터 MVb(예측)는 다음 식에 의해 산출되는 것이 바람직하다.When the motion vector of the current block is the backward motion vector MVb and the motion vector of the neighboring block is the forward motion vector MVf, the backward motion vector MVb (prediction), which is the predictive motion vector, is calculated by the following equation .

MVb(예측) = {(상기 이웃 블록이 참조한 미래 픽처와 상기 과거 픽처의 시간차 - 상기 이웃 블록이 속하는 현재 픽처와 참조한 과거 픽처의 시간차)/상기 이웃 블록이 속하는 현재 픽처와 참조한 과거 픽처의 시간차}*MVfMVb (prediction) = {(time difference between the future picture referred to by the neighboring block and the past picture, time difference between the current picture to which the neighboring block belongs and the past picture referred to) / temporal difference between the current picture to which the neighboring block belongs and the past picture to which the neighboring block belongs} * MVf

상기 현재 블록의 움직임 벡터가 포워드 움직임 벡터 MVf이고 상기 이웃 블록의 움직임 벡터는 백워드 움직임 벡터 MVb일 때, 상기 예측 움직임 벡터인 포워드 움직임 벡터 MVf(예측)는 다음 식에 의해 산출되는 것이 바람직하다.When the motion vector of the current block is the forward motion vector MVf and the motion vector of the neighboring block is the backward motion vector MVb, the forward motion vector MVf (prediction), which is the prediction motion vector, is calculated by the following equation.

MVf(예측) = {상기 이웃 블록이 속하는 현재 픽처와 참조한 과거 픽처의 거리/(상기 이웃 블록이 참조한 미래 픽처와 상기 과거 픽처의 거리 - 상기 이웃 블록이 속하는 현재 픽처와 참조한 과거 픽처의 거리)}*MVbMVf (prediction) = {Distance between the current picture to which the neighboring block belongs and the reference picture to which the neighboring block belongs / Distance between the future picture referenced by the neighboring block and the past picture - Distance between the current picture to which the neighboring block belongs and the past picture to which the neighboring block belongs) * MVb

상기 현재 블록의 움직임 벡터가 백워드 움직임 벡터 MVb이고 상기 이웃 블록의 움직임 벡터는 포워드 움직임 벡터 MVf일 때, 상기 예측 움직임 벡터인 백워드 움직임 벡터 MVb(예측)는 다음 식에 의해 산출되는 것이 바람직하다.When the motion vector of the current block is the backward motion vector MVb and the motion vector of the neighboring block is the forward motion vector MVf, the backward motion vector MVb (prediction), which is the predictive motion vector, is calculated by the following equation .

MVb(예측) = {(상기 이웃 블록이 참조한 미래 픽처와 상기 과거 픽처의 거리 - 상기 이웃 블록이 속하는 현재 픽처와 참조한 과거 픽처의 거리)/상기 이웃 블록이 속하는 현재 픽처와 참조한 과거 픽처의 거리}*MVfMVb (prediction) = {(distance between the future picture referred to by the neighboring block and the previous picture, distance between the current picture to which the neighboring block belongs and the past reference picture) / distance between the current picture to which the neighboring block belongs, * MVf

상기 (b)단계는 다음 식에 의해 산출된 대표값인, 복호화를 위한 예측값 PMV_X을 구하는 단계임이 바람직하다.The step (b) is preferably a step of obtaining a predictive value PMV_X for decoding, which is a representative value calculated by the following equation.

PVM_X = median(MVf_A, MVf_B, MVf_C) 또는 median(MVb_A, MVb_B, MVb_C)PVM_X = median (MVf_A, MVf_B, MVf_C) or median (MVb_A, MVb_B, MVb_C)

여기서, MVf_A, MVf_B, MVf_C, MVb_A, MVb_B, 및 MVb_C은 상기 이웃 블록들의 움직임 벡터의 성분들로서, MVf_A는 좌측 블록의 포워드 움직임 벡터를, MVf_B는 상측 블록의 포워드 움직임 벡터를, MVf_C는 우상측 블록의 포워드 움직임 벡터를, MVb_A는 좌측 블록의 백워드 움직임 벡터를. MVb_B는 상측 블록의 백워드 움직임 벡터를, MVb_C는 우상측 블록의 백워드 움직임 벡터를 의미한다. 상기 예측 움직임 벡터는 이들 중 어느 하나일 수 있다.Here, MVf_A, MVf_B, MVf_C, MVb_A, MVb_B, and MVb_C are components of the motion vectors of the neighboring blocks, MVf_A is the forward motion vector of the left block, MVf_B is the forward motion vector of the upper block, MVb_A is the backward motion vector of the left block. MVb_B denotes a backward motion vector of the upper block, and MVb_C denotes a backward motion vector of the upper right block. The predictive motion vector may be any one of them.

한편, 본 발명의 다른 분야에 따르면, 상기 목적은 움직임 벡터를 복호화하는 장치에 있어서, 오차값을 복호화해내는 움직임 벡터 복호화기; 및 현재 블록에 이웃하는 복수개의 이웃 불록들 중 상기 현재 블록과 상이한 타입의 움직임 벡터들을 가진 이웃 블록에 대해 상기 현재 블록과 동일한 타입의 움직임 벡터를 예측하여 예측 움직임 벡터를 구한 다음, 구해진 예측 움직임 벡터를 포함하여 상기 이웃 블록들의 움직임 벡터들 중 상기 현재 블록의 움직임 벡터와 동일한 타입의 움직임 벡터들에 대한 대표값을 산출하고, 산출된 대표값과 상기 오차값을 더하여 상기 현재 블록의 움직임 벡터를 산출하는 움직임 벡터 예측 보상기를 포함하는 것을 특징으로 하는 장치에 의해서도 달성된다.According to another aspect of the present invention, there is provided an apparatus for decoding a motion vector, the apparatus comprising: a motion vector decoder for decoding an error value; And a motion vector predictor for estimating a motion vector of the same type as that of the current block with respect to a neighboring block having a motion vector of a different type from the current block among a plurality of neighboring blocks neighboring the current block, A representative value of the motion vectors of the same type as the motion vector of the current block among the motion vectors of the neighboring blocks is calculated and the motion vector of the current block is calculated by adding the calculated representative value and the error value And a motion vector prediction compensator for performing motion vector prediction.

상기 현재 블록의 움직임 벡터가 포워드 움직임 벡터 MVf이고 상기 이웃 블록의 움직임 벡터는 백워드 움직임 벡터 MVb일 때, 상기 움직임 벡터 예측 보상기는 상기 예측 움직임 벡터인 포워드 움직임 벡터 MVf(예측)를 다음 식에 의해 산출하는 것이 바람직하다.When the motion vector of the current block is the forward motion vector MVf and the motion vector of the neighboring block is the backward motion vector MVb, the motion vector prediction compensator calculates the forward motion vector MVf (prediction) .

MVf(예측) = {상기 이웃 블록이 속하는 현재 픽처와 참조한 과거 픽처의 시간차/(상기 이웃 블록이 참조한 미래 픽처와 상기 과거 픽처의 시간차 - 상기 이웃 블록이 속하는 현재 픽처와 참조한 과거 픽처의 시간차)}*MVbMVf (prediction) = {time difference between the current picture to which the neighboring block belongs and the referenced past picture / (time difference between the future picture referenced by the neighboring block and the past picture - temporal difference between the current picture to which the neighboring block belongs and the past picture to which the neighboring block belongs) * MVb

상기 현재 블록의 움직임 벡터가 백워드 움직임 벡터 MVb이고 상기 이웃 블록의 움직임 벡터는 포워드 움직임 벡터 MVf일 때, 상기 움직임 벡터 예측 보상기는 상기 예측 움직임 벡터인 백워드 움직임 벡터 MVb(예측)를 다음 식에 의해 산출하는 것이 바람직하다.When the motion vector of the current block is a backward motion vector MVb and the motion vector of the neighboring block is a forward motion vector MVf, the motion vector prediction compensator calculates a backward motion vector MVb (prediction) .

MVb(예측) = {(상기 이웃 블록이 참조한 미래 픽처와 상기 과거 픽처의 시간차 - 상기 이웃 블록이 속하는 현재 픽처와 참조한 과거 픽처의 시간차)/상기 이웃 블록이 속하는 현재 픽처와 참조한 과거 픽처의 시간차}*MVfMVb (prediction) = {(time difference between the future picture referred to by the neighboring block and the past picture, time difference between the current picture to which the neighboring block belongs and the past picture referred to) / temporal difference between the current picture to which the neighboring block belongs and the past picture to which the neighboring block belongs} * MVf

상기 현재 블록의 움직임 벡터가 포워드 움직임 벡터 MVf이고 상기 이웃 블록의 움직임 벡터는 백워드 움직임 벡터 MVb일 때, 상기 움직임 벡터 예측 보상기는 상기 예측 움직임 벡터인 포워드 움직임 벡터 MVf(예측)를 다음 식에 의해 산출하는 것이 바람직하다.When the motion vector of the current block is the forward motion vector MVf and the motion vector of the neighboring block is the backward motion vector MVb, the motion vector prediction compensator calculates the forward motion vector MVf (prediction) .

MVf(예측) = {상기 이웃 블록이 속하는 현재 픽처와 참조한 과거 픽처의 거리/(상기 이웃 블록이 참조한 미래 픽처와 상기 과거 픽처의 거리 - 상기 이웃 블 록이 속하는 현재 픽처와 참조한 과거 픽처의 거리)}*MVbMVf (prediction) = {distance between the current picture to which the neighboring block belongs and the reference picture past / (distance between the future picture referenced by the neighboring block and the previous picture, distance between the current picture to which the neighboring block belongs, } * MVb

상기 현재 블록의 움직임 벡터가 백워드 움직임 벡터 MVb이고 상기 이웃 블록의 움직임 벡터는 포워드 움직임 벡터 MVf일 때, 상기 움직임 벡터 예측 보상기는 상기 예측 움직임 벡터인 백워드 움직임 벡터 MVb(예측)를 다음 식에 의해 산출하는 것이 바람직하다.When the motion vector of the current block is a backward motion vector MVb and the motion vector of the neighboring block is a forward motion vector MVf, the motion vector prediction compensator calculates a backward motion vector MVb (prediction) .

MVb(예측) = {(상기 이웃 블록이 참조한 미래 픽처와 상기 과거 픽처의 거리 - 상기 이웃 블록이 속하는 현재 픽처와 참조한 과거 픽처의 거리)/상기 이웃 블록이 속하는 현재 픽처와 참조한 과거 픽처의 거리}*MVfMVb (prediction) = {(distance between the future picture referred to by the neighboring block and the previous picture, distance between the current picture to which the neighboring block belongs and the past reference picture) / distance between the current picture to which the neighboring block belongs, * MVf

한편, 상기 목적은 전술한 부호화 방법 또는 복호화 방법을 수행하기 위한 프로그램 코드가 기록된 컴퓨터 판독가능한 정보저장매체에 의해서도 달성된다.The above object is also achieved by a computer-readable information storage medium having recorded therein a program code for performing the above-described encoding method or decoding method.

또한, 본 발명의 또 다른 실시예에 따른 움직임 벡터의 복호화 방법은 매크로블록 내에 구비된 현재 블록의 크기와 위치에 따라서 상기 현재 블록의 예측 움직임 벡터로 사용될 움직임 벡터를 갖는 이웃 블록을 선택하는 단계; 및 상기 선택된 이웃 블록의 움직임 벡터를 상기 현재 블록의 예측 움직임 벡터로 선택하는 단계를 포함하며, 상기 현재 블록의 예측 움직임 벡터로 사용될 이웃 블록을 선택하는 단계는 상기 매크로 블록 내의 현재 블록의 크기가 16x8이고 상기 현재 블록이 매크로 블록 내의 상측 블록인 경우, 상기 현재 블록의 상측에 인접한 이웃 블록의 움직임 벡터를 상기 현재 블록의 예측 움직임 벡터로 선택하는 것을 특징으로 한다.According to another aspect of the present invention, there is provided a motion vector decoding method comprising: selecting a neighboring block having a motion vector to be used as a predicted motion vector of a current block according to a size and a position of a current block included in the macro block; And selecting a motion vector of the selected neighboring block as a predicted motion vector of the current block, wherein the step of selecting a neighboring block to be used as a predicted motion vector of the current block includes: And a motion vector of a neighboring block adjacent to an upper side of the current block is selected as a predictive motion vector of the current block if the current block is an upper block in the macroblock.

또한, 본 발명의 또 다른 실시예에 따른 움직임 벡터의 복호화 장치는 현재 블록의 원 움직임 벡터와 상기 현재 블록의 예측 움직임 벡터 사이의 차이값을 복호화하는 움직임 벡터 복호화부; 및 매크로블록 내에 구비된 상기 현재 블록의 크기와 위치에 따라서 상기 현재 블록의 예측 움직임 벡터로 사용될 움직임 벡터를 갖는 이웃 블록을 선택하고, 상기 선택된 이웃 블록의 움직임 벡터를 상기 현재 블록의 예측 움직임 벡터로 선택하며, 상기 선택된 예측 움직임 벡터와 상기 복호화된 차이값을 더하는 움직임 벡터 예측 보상부를 포함하며, 상기 움직임 벡터 예측 보상부는 상기 매크로 블록 내의 현재 블록의 크기가 16x8이고 상기 현재 블록이 매크로 블록 내의 상측 블록인 경우, 상기 현재 블록의 상측에 인접한 이웃 블록의 움직임 벡터를 상기 현재 블록의 예측 움직임 벡터로 선택하는 것을 특징으로 한다.According to another aspect of the present invention, there is provided an apparatus for decoding a motion vector, the apparatus comprising: a motion vector decoding unit decoding a difference value between an original motion vector of a current block and a predicted motion vector of the current block; And selecting a neighboring block having a motion vector to be used as a predictive motion vector of the current block according to the size and position of the current block included in the macroblock, and selecting a motion vector of the selected neighboring block as a predictive motion vector of the current block And a motion vector prediction compensating unit for adding the selected predictive motion vector and the decoded difference value, wherein the motion vector prediction compensating unit compensates the motion vector prediction compensating unit for the current block in the macroblock, A motion vector of a neighboring block adjacent to an upper side of the current block is selected as a predicted motion vector of the current block.

본 발명에 따르면 움직임 벡터를 부호화하고 복호화함에 있어, 현재 블록의 움직임 벡터와 타입이 다른 움직임 벡터를 갖는 이웃 블록에 대해 동일한 타입의 움직임 벡터를 예측하여 이를 토대로 중간값을 구하고 구해진 중간값에 기초하여 얻어진 차분값을 부호화하며, 복호화된 차분값에 현재 블록과 다른 타입의 움직임 벡터를 갖는 이웃 블록에 대해 동일한 타입의 움직임 벡터를 예측하여 이를 토대로 구해진 중간값을 더하여 현재 블록의 움직임 벡터를 구하므로, 부호화 효율 및 복호화 효율이 증대된다.According to the present invention, in encoding and decoding a motion vector, a motion vector of the same type is predicted for a neighboring block having a motion vector of a type different from the motion vector of the current block, an intermediate value is obtained based on the predicted motion vector, The motion vector of the current block is obtained by adding the intermediate value obtained based on the predicted motion vector to the decoded difference value for the neighboring block having the motion vector of the different type from the current block, Coding efficiency and decoding efficiency are increased.

즉, 현재 블록의 움직임 벡터를 부호화하거나 복호화함에 있어 이웃 블록의 그것들의 대표값(중간값)을 토대로한다는 것은 이웃하는 블록들의 움직임은 유사하 다는 전제를 기초로 한다. 이에 본 발명의 움직임 벡터 부호화 방법 및 복호화 방법에 따르면, 종래 타입이 다른 움직임 벡터의 경우 대표값(중간값) 산출에서 배제됨으로써 이웃 블록들의 움직임이 제대로 반영되지 못하는 문제점을 개선하여, 이웃 블록이 다른 움직임 벡터를 갖는 경우라도 동일한 타입의 예측 움직임 벡터를 구하여 이를 대표값(중간값)을 구하는데 반영시킴으로써 부호화 및 복호화 효율이 보다 향상된다.That is, in coding or decoding the motion vector of the current block, it is based on the representative value (intermediate value) of the neighboring blocks, that the motion of neighboring blocks is similar. According to the motion vector coding method and the decoding method of the present invention, it is possible to improve the problem that motion of neighboring blocks is not properly reflected by excluding a motion vector of a conventional type from calculation of a representative value (intermediate value) Even when a motion vector is included, a prediction motion vector of the same type is obtained and reflected in a representative value (intermediate value) to improve encoding and decoding efficiency.

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

도 1은 본 발명의 바람직한 실시예에 따른 움직임 벡터 부호화 장치의 블록도이다.1 is a block diagram of a motion vector coding apparatus according to a preferred embodiment of the present invention.

도 1을 참조하면, 부호화 장치(70)는 움직임 벡터를 부호화하는 장치로서, 움직임 벡터 예측기(701) 및 움직임 벡터 부호화기(702)를 구비한다. 복수개의 블록들에 대한 움직임 벡터들이 입력되면, 움직임 벡터 예측기(701)는 현재 블록에 이웃하는 복수개의 이웃 불록들 중 상기 현재 블록의 움직임 벡터와 상이한 타입의 움직임 벡터들만을 가진 이웃 블록에 대해 상기 현재 블록의 움직임 벡터와 동일한 타입의 움직임 벡터를 예측하여 예측 움직임 벡터를 구한 다음, 구해진 예측 움직임 벡터를 포함하여 상기 이웃 블록들의 움직임 벡터들 중 상기 현재 블록의 움직임 벡터와 동일한 타입의 움직임 벡터들에 대한 대표값을 산출하고, 산출된 대표값과 상기 현재 블록의 움직임 벡터와의 오차값을 산출한다. 움직임 벡터 부호화 기(702)는 움직임 벡터 예측기(701)로부터 출력된 오차값을 부호화한다. 본 실시예에서 움직임 벡터 부호화기(702)는 오차값으로서 차분값을 부호화한다.Referring to FIG. 1, an encoder 70 encodes a motion vector, and includes a motion vector predictor 701 and a motion vector encoder 702. When motion vectors for a plurality of blocks are inputted, the motion vector predictor 701 predicts a motion vector of a neighboring block having only motion vectors of a different type from a motion vector of the current block among a plurality of neighboring blocks neighboring the current block, A motion vector of the same type as the motion vector of the current block is predicted to obtain a predicted motion vector and motion vectors of the same type as the motion vector of the current block among the motion vectors of the neighboring blocks, And calculates an error value between the calculated representative value and the motion vector of the current block. The motion vector encoder 702 encodes the error value output from the motion vector predictor 701. In this embodiment, the motion vector encoder 702 encodes a difference value as an error value.

도 2는 본 발명의 바람직한 실시예에 따라, 도 1의 움직임 벡터 부호화 장치를 포함한 영상 데이터 부호화 장치의 블럭도이다.FIG. 2 is a block diagram of an image data encoding apparatus including the motion vector encoding apparatus of FIG. 1, according to a preferred embodiment of the present invention.

도 2를 참조하면, 영상 데이터 부호화 장치는 다중 참조(Multiple reference) 방식을 채용한 부호화 장치로서, 부호화 제어부(100), 제1 소스 부호화부(200), 제2 소스 부호화부(700)를 구비한다. 또한, 소스 복호화부(300), 메모리부(400), 움직임 보상부(500), 및 움직임 예측부(600)를 구비한다. Referring to FIG. 2, the image data encoding apparatus includes a coding control unit 100, a first source coding unit 200, and a second source coding unit 700, do. In addition, a source decoding unit 300, a memory unit 400, a motion compensation unit 500, and a motion prediction unit 600 are provided.

입력되는 영상 데이터는 도 3에서와 같이 시간축을 따라 카메라로부터 입력되는 프레임들 또는 프레임을 소정 크기로 분할하여 얻어진 블록들로 구성된다. 프레임은 순차 주사 방식에 의해 얻어진 순차 주사 프레임, 비월 주사 방식에 의해 얻어진 필드 또는 비월 주사 프레임을 포함한다. 따라서, 이하 설명하는 영상 데이터는 순차 주사 프레임, 비월 주사 프레임, 필드, 블록 구조의 픽처를 의미한다.As shown in FIG. 3, input image data is composed of blocks obtained by dividing a frame or a frame input from a camera along a time axis into a predetermined size. The frame includes a progressive scan frame obtained by the progressive scanning method, a field obtained by the interlaced scanning method, or an interlaced scanning frame. Therefore, the video data described below means a picture of a progressive scan frame, an interlaced scan frame, a field, and a block structure.

영상 데이터가 입력되면 부호화 제어부(100)는 입력되는 영상의 특성 또는 사용자가 원하는 소정 동작 목적에 따라, 입력 영상에 대해 움직임 보상을 수행할지 여부에 따른 코딩-타입(인트라 코딩/인터 코딩)을 결정하여 대응하는 제어 신호를 제1 스위치(S1)로 출력한다. 움직임 보상을 수행할 경우에는 이전 또는 이후에 입력된 영상 데이터가 필요하므로 제1 스위치(S1)는 닫히게 되고 움직임 보상을 수행하지 않을 경우에는 이전 또는 이후에 입력된 영상 데이터가 필요하지 않으므로 제1 스위치(S1)는 열리게 된다. 제1 스위치(S1)가 닫히면 입력 영상과 이전 또는 이후 영상으로부터 얻어진 차 영상 데이터가 제1 소스 부호화부(200)로 입력되고 제1 스위치(S1)가 열리면 입력 영상만이 제1 소스 부호화부(200)로 입력된다.When the video data is input, the encoding control unit 100 determines a coding-type (intra coding / inter coding) according to whether to perform motion compensation on the input video according to characteristics of the input video or a predetermined operation objective desired by the user And outputs the corresponding control signal to the first switch S1. In the case of performing motion compensation, the first switch S1 is closed because the previous or the later input image data is required. When the motion compensation is not performed, the previous or later input image data is not needed, (S1) is opened. When the first switch S1 is closed, the difference image data obtained from the input image and the previous or subsequent image are input to the first source encoding unit 200 and the first switch S1 is opened, only the input image is input to the first source encoding unit 200).

제1 소스 부호화부(200)는 입력된 영상 데이터를 변환(transform) 부호화하여 얻어진 변환 계수값들을 소정 양자화 스텝에 따라 양자화하여 양자화된 변환 계수값들로 구성된 2차원 데이터인 N×M 데이터를 얻는다. 사용되는 변환의 예로는 DCT(Discrete Cosine Transform)을 들 수 있다. 양자화는 미리 결정된 양자화 스텝에 따라 수행된다.The first source encoding unit 200 quantizes the transform coefficient values obtained by transform coding the input image data according to a predetermined quantization step to obtain N × M data that is two-dimensional data composed of quantized transform coefficient values . An example of the transform used is DCT (Discrete Cosine Transform). The quantization is performed according to a predetermined quantization step.

한편, 제1 소스 부호화부(200)로 입력되어 부호화된 영상 데이터는 이후 또는 이전에 입력된 영상 데이터의 움직임 보상을 위한 참조 데이터로 사용될 수 있으므로 소스 복호화부(300)에 의해 제1 소스 부호화부(200)의 역과정인 역양자화와 역변환 부호화를 거친 후 메모리(400)에 저장된다. 또한, 소스 복호화부(200)로부터 출력된 데이터가 차 영상 데이터이면 부호화 제어부(100)는 제2 스위치(S2)를 닫아서 소스 복호화부(300)로부터 출력된 차 영상 데이터가 움직임 보상부(500)의 출력과 더해진 다음 메모리(400)에 저장되도록 한다.Since the image data input to and coded by the first source coding unit 200 can be used as reference data for motion compensation of the image data inputted in the following or before, the source decoding unit 300 decodes the image data, And then stored in the memory 400 after being subjected to inverse quantization and inverse transform coding, which are inverse processes of the inverse quantizer 200. If the data output from the source decoding unit 200 is differential image data, the coding control unit 100 closes the second switch S2 and outputs the differential image data output from the source decoding unit 300 to the motion compensation unit 500. [ And then stored in the memory 400. FIG.

움직임 예측(motion estimation)부(600)는 입력된 영상 데이터와 메모리(400)에 저장된 데이터를 비교하여, 현재 입력된 데이터와 가장 유사한 데이터를 찾은 다음, 입력된 영상 데이터와 비교하여 움직임 벡터 MV(Motion Vector)를 출력한다. 움직임 벡터는 적어도 하나의 픽처를 참조하여 구해진다. 즉, 복수개의 과거 및/또는 미래의 픽처를 참조하여 산출될 수 있다. 움직임 벡터가 메모리(400)로 전달되면 메모리(400)는 해당 데이터를 움직임 보상부(motion compensation)(500)로 출력하며, 움직임 보상부(500)는 입력받은 데이터를 기초로 현재 부호화하는 영상 데이터에 해당하는 보상치를 만들어 출력한다.The motion estimation unit 600 compares input image data with data stored in the memory 400 to find data most similar to the currently inputted data and then compares the input image data with the input image data to obtain a motion vector MV Motion Vector). A motion vector is obtained by referring to at least one picture. That is, it can be calculated with reference to a plurality of past and / or future pictures. When the motion vector is transferred to the memory 400, the memory 400 outputs the corresponding data to the motion compensation unit 500. The motion compensation unit 500 compresses the image data And outputs the compensation value corresponding to the output value.

제2 소스 부호화부(700)는 제1 소스 부호화부(200)로부터 출력되는 양자화된 변환 부호화계수들과 움직임 예측부(600)로부터 출력된 움직임 벡터에 관한 정보를 입력받으며, 부호화 제어부(100)에서 제공되는 코딩 타입 정보, 양자화 스텝 정보, 등 기타 복호화에 필요한 정보들을 입력받아 부호화하여 최종적으로 얻어진 비트스트림을 출력한다.The second source encoder 700 receives the quantized transform coefficients output from the first source encoder 200 and the motion vector output from the motion estimator 600, Coding type information, quantization step information, and other information necessary for decoding and the like, and outputs the finally obtained bitstream.

본 발명에 따른 움직임 벡터의 부호화 장치(70)는 제2 소스 부호화부(700)에 구비된다. 따라서, 본 발명에 따른 움직임 벡터 부호화 방법은 제2 소스 부호화부(700)에 의해 수행된다. 제2 소스 부호화부(700)는 MPEG-4 부호화 표준, H.263 부호화 표준에서와 마찬가지로, 움직임 벡터들 간의 연관성을 반영하여 부호화 효율을 높이기 위해 현재 블록의 움직임 벡터를 그대로 부호화하는 것이 아니라 이웃 블록들의 움직임 벡터들을 이용하여 예측 부호화를 수행한다.The motion vector coding apparatus 70 according to the present invention is provided in the second source coding unit 700. Therefore, the motion vector coding method according to the present invention is performed by the second source coding unit 700. [ As in the MPEG-4 coding standard and the H.263 coding standard, the second source coding unit 700 does not directly encode the motion vector of the current block in order to enhance the coding efficiency by reflecting the association between the motion vectors, And predictive coding is performed using the motion vectors of the motion vectors.

도 4는 본 발명의 바람직한 실시예에 따른 움직임벡터 복호화 장치의 블록도이다.4 is a block diagram of a motion vector decoding apparatus according to a preferred embodiment of the present invention.

도 4를 참조하면, 복호화 장치는 본 발명에 따라 움직임벡터를 복호화하는 장치로서, 움직임벡터 복호화기(131) 및 움직임벡터 예측 보상기(132)를 구비한다. 움직임벡터 복호화기(131)는 입력된 부호화된 움직임벡터 오차값을 복호화하여 오차값을 복원한다. 이렇게 복원된 오차값으로부터 원래의 움직임벡터를 얻기 위해서는 오차값 계산에 사용된 예측치를 구한 후 이를 오차값에 더해주어야 최종적으 로 원래의 움직임벡터를 알아낼 수 있다. 이를 위해 움직임 벡터 예측 보상기(132)는 복수개의 블록들에 대한 움직임 벡터들을 입력받아 현재 블록에 이웃하는 복수개의 이웃 블록들 중 상기 현재 블록의 움직임 벡터와 상이한 타입의 움직임 벡터들만을 가진 이웃 블록에 대해 상기 현재 블록의 움직임 벡터와 동일한 타입의 움직임 벡터를 예측하여 예측 움직임 벡터를 구한 다음, 구해진 예측 움직임 벡터를 포함하여 상기 이웃 블록들의 움직임 벡터들 중 상기 현재 블록의 움직임 벡터와 동일한 타입의 움직임 벡터들에 대한 대표값을 산출하고, 산출된 대표값을 상기 움직임 벡터 복호화기(131)에 의해 복원된 오차값에 더하여 현재 블록의 움직임 벡터를 산출한다.Referring to FIG. 4, the apparatus for decoding a motion vector according to the present invention includes a motion vector decoder 131 and a motion vector prediction compensator 132. The motion vector decoder 131 decodes the input encoded motion vector error value and restores the error value. In order to obtain the original motion vector from the reconstructed error value, the predicted value used for the error value calculation should be obtained and added to the error value, so that the original motion vector can be finally obtained. For this, the motion vector prediction compensator 132 receives the motion vectors for the plurality of blocks and receives the motion vectors of neighboring blocks having only different types of motion vectors from the motion vectors of the current block among a plurality of neighboring blocks neighboring the current block A motion vector of the same type as the motion vector of the current block is predicted to obtain a predicted motion vector, and a motion vector of the same type as the motion vector of the current block among the motion vectors of the neighboring blocks, And adds the calculated representative value to the error value reconstructed by the motion vector decoder 131 to calculate a motion vector of the current block.

본 발명에 따른 움직임 벡터 복호화 방법은 본 발명에 따른 움직임 벡터 복호화 장치(130)에 의해 수행된다. 움직임 벡터 복호화 장치(130)는 MPEG-4 부호화 표준, H.263 부호화 표준에서와 마찬가지로, 움직임 벡터들 간의 연관성을 반영하여 복호화 효율을 높이기 위해 현재 블록의 움직임 벡터를 그대로 복호화하는 것이 아니라 이웃 블록들의 움직임 벡터들을 이용하여 예측 복호화를 수행한다.The motion vector decoding method according to the present invention is performed by the motion vector decoding apparatus 130 according to the present invention. As in the MPEG-4 coding standard and the H.263 coding standard, the motion vector decoding apparatus 130 does not decode the motion vector of the current block in order to enhance the decoding efficiency by reflecting the association between the motion vectors, Predictive decoding is performed using motion vectors.

도 5는 도 4의 움직임 벡터 복호화 장치(130)가 구비된 영상 데이터 복호화 장치의 블록도이다.FIG. 5 is a block diagram of a video data decoding apparatus provided with the motion vector decoding apparatus 130 of FIG.

도 5를 참조하면, 복호화 장치는 비트스트림을 디먹싱하는 디먹싱부(110), 제2 소스 복호화부(710), 제1 소스 복호화부(210)을 구비한다. 또한, 코딩 타입 정보를 복호화하는 코딩 타입 정보 복호화부(120) 및 본 발명에 따른 움직임벡터 복호화를 수행하는 움직임 벡터 복호화부(130)를 구비한다.Referring to FIG. 5, the decoding apparatus includes a demultiplexer 110, a second source decoder 710, and a first source decoder 210 for demultiplexing a bitstream. In addition, a coding type information decoding unit 120 for decoding coding type information and a motion vector decoding unit 130 for performing motion vector decoding according to the present invention are provided.

비트스트림은 디먹싱부(110)에 의해 엔트로피 부호화된 양자화된 변환 부호화계수들, 움직임 벡터 정보, 코딩 타입 정보 등으로 디먹싱된다. 제2 소스 복호화부(710)는 부호화된 변환 부호화계수들을 엔트로피 복호화하여 양자화된 변환 부호화계수들을 출력한다. 제1 소스 복호화부(210)는 양자화된 변환 부호화계수들을 소스 복호화한다. 즉, 도 1의 제1 소스 부호화부(200)의 역과정을 수행한다. 예를 들어, 제1 소스 부호화부(200)가 DCT를 수행하였다면 제1 소스 복호화부(210)는 IDCT(Inverse Discrete Cosine Transform)를 수행한다. 이에, 영상 데이터가 복원된다. 복원된 영상 데이터는 움직임 보상을 위해 메모리부(410)에 저장된다.The bit stream is demultiplexed into entropy-encoded quantized transform coefficients, motion vector information, coding type information, and the like by the demultiplexer 110. The second source decoding unit 710 entropy-decodes the encoded transcoding coefficients and outputs quantized transcoded coefficients. The first source decoding unit 210 performs source decoding on the quantized transform coefficients. That is, the inverse process of the first source encoding unit 200 of FIG. 1 is performed. For example, if the first source coding unit 200 performs DCT, the first source decoding unit 210 performs an IDCT (Inverse Discrete Cosine Transform). Thus, the image data is restored. The restored image data is stored in the memory unit 410 for motion compensation.

한편, 코딩 타입 정보 복호화부(120)는 코딩 타입을 알아내어 움직임 보상이 필요한 인터 타입일 경우 제3 스위치(S30)를 닫아 제1 소스 복호화부(210)로부터 출력된 데이터에 움직임 보상부(510)로부터 출력된 움직임 보상값을 더해지도록 하여 복원된 영상 데이터가 얻어지도록 해준다. 움직임 벡터 복호화부(130)는 움직임 벡터 정보로부터 얻은 움직임 벡터가 가리키는 위치를 알려주고, 움직임 보상부(510)는 움직임 벡터가 가리키는 참조 영상 데이터로부터 움직임 보상값을 생성하여 출력한다. 움직임 벡터 복호화부(130)의 상세한 동작은 도 10을 참조하여 설명한 것과 동일하므로 반복되는 설명은 생략한다.Meanwhile, the coding type information decoding unit 120 finds the coding type and closes the third switch S30 when the inter type is motion compensation, and adds the data output from the first source decoding unit 210 to the motion compensation unit 510 To be added to the motion compensation value to obtain the reconstructed image data. The motion vector decoding unit 130 notifies the position indicated by the motion vector obtained from the motion vector information, and the motion compensation unit 510 generates and outputs a motion compensation value from the reference image data indicated by the motion vector. The detailed operation of the motion vector decoding unit 130 is the same as that described with reference to FIG. 10, and thus a repetitive description thereof will be omitted.

도 6은 본 발명의 바람직한 실시예에 따른 다중 참조(Multiple reference) 방식을 설명하기 위한 참고도이다.6 is a reference diagram for explaining a multiple reference method according to a preferred embodiment of the present invention.

도 6을 참조하면, I 픽처는 다른 픽처를 참조하지 않고 얻어지는 인트라(intra) 픽처를 가리키고, B 픽처는 두 개의 서로 다른 픽처를 참조하여 얻어지 는 양방향(bi-predictive) 픽처를 가리킨다. P 픽처는 I 픽처만을 참조하여 얻어지는 예측(predictive) 픽처를 가리킨다. 화살표는 복호화시 필요한 픽처들, 즉 종속관계를 보여준다. B2 픽처는 I0 픽처와 P4 픽처에 종속되고, B1 픽처는 I0 픽처, P4 픽처, B2 픽처에 종속된다. B3 픽처는 I0 픽처, P4 픽처, B1 픽처, 및 B2 픽처에 종속된다. 따라서, 디스플레이 순서는 I0, B1, B2, B3, P4.. 순서이지만 전송 순서는 I0, P4, B2, B1, B3...가 된다. 이처럼, 도 1의 부호화 장치에 따르면 복수개의 픽처를 참조하여 생성되는 B 픽처가 존재한다. 다시 말해, 본 발명의 부호화 방법 및 복호화 방법에서의 움직임 벡터는 포워드 예측 방식, 백워드 예측 방식, 양방향(bi-directional) 예측 방식, 및 다이렉트(direct) 예측 방식 중 양방향 예측 방식을 포함한 적어도 하나의 방식으로 산출된다. 양방향 예측 방식에 있어서 두 개의 참조 픽처는 모두 과거 픽처 또는 모두 미래 픽처일수 있다.Referring to FIG. 6, an I picture indicates an intra picture obtained without referring to another picture, and a B picture indicates a bi-predictive picture obtained by referring to two different pictures. A P picture indicates a predictive picture obtained by referring to only an I picture. The arrows show the pictures, or dependencies, needed for decoding. The B2 picture is dependent on the I0 picture and the P4 picture, and the B1 picture is dependent on the I0 picture, the P4 picture, and the B2 picture. The B3 picture is subordinate to the I0 picture, the P4 picture, the B1 picture, and the B2 picture. Therefore, the display order is I 0, B 1, B 2, B 3, P 4 .. but the order of transmission is I 0, P 4, B 2, B 1, B 3 .... As described above, according to the encoding apparatus of FIG. 1, there are B pictures generated by referring to a plurality of pictures. In other words, the motion vector in the encoding method and the decoding method of the present invention may be at least one of a forward prediction method, a backward prediction method, a bi-directional prediction method, and a direct prediction method, . In the bidirectional prediction method, both reference pictures can be either a past picture or a future picture in all.

도 7은 본 발명의 바람직한 실시예에 따른 움직임 보상의 단위가 되는 움직임보상 블록들을 보여주는 참고도이다.FIG. 7 is a reference view showing motion compensation blocks as motion compensation units according to a preferred embodiment of the present invention. Referring to FIG.

도 7을 참조하면, 픽처는 복수개의 움직임보상 블록들로 구성된다. 움직임보상 블록은 본 실시예에 따른 16×16 매크로 블록(MB)은 물론, 매크로 블록을 수평 방향으로 이분할하여 얻어진 16×8 블록, 매크로 블록을 수직 방향으로 이분할하여 얻어진 8×16 블록, 매크로 블록을 수평 및 수직 방향으로 각각 이분할하여 얻어진 8×8 블록, 이를 다시 수평 또는 수직 방향으로 이분할하여 얻어진 8×4 블록 또는 4×8 블록, 수평 및 수직 방향으로 각각 이분할하여 얻어진 4×4 블록을 포함한다.Referring to FIG. 7, a picture is composed of a plurality of motion compensation blocks. The motion compensation block includes a 16 × 16 macroblock (MB) according to the present embodiment, a 16 × 8 block obtained by dividing the macroblock in the horizontal direction, an 8 × 16 block obtained by dividing the macroblock in the vertical direction, An 8x8 block obtained by dividing a macroblock in the horizontal and vertical directions, an 8x4 block or a 4x8 block obtained by dividing the macroblock in the horizontal or vertical direction, and a 4x8 block obtained by dividing the macroblock in the horizontal and vertical directions, respectively × 4 blocks.

본 발명에 따른 움직임 벡터 부호화 방법은 현재 블록의 움직임 벡터 MV_X의, 이웃 블록들의 대표값, 본 실시예에서는 중간값(median)에 대한 오차값을 부호화하는 차분 부호화 방식(Differential Pulse Coded Modulation)에 따른다. 즉, 현재 블록 X에 대한 이웃 블록들인 좌측 블록 A, 상측 블록 B, 우상측 블록 C의 움직임 벡터를 각각 MV_A, MV_B, MV_C라고 하면 차분 벡터 부호화를 위한 예측값인 예측 벡터 PVM_X와 이를 이용한 차분값인 차분 벡터 MVD_X는 다음 수학식 1에 의해 계산된다. 계산은 벡터의 성분값(x 성분 및 y 성분)에 대해 각각 독립적으로 수행된다. 한편, 좌측 블록 A는 현재 블록 X에 속하는 첫 번째 행의 맨좌측 픽셀의 좌측으로 인접한 픽셀이 속하는 블록을 가리키고, 상측 블록 C는 현재 블록 X에 속하는 첫 번째 행의 맨좌측 픽셀의 상측으로 인접한 픽셀이 속하는 블록을 가리키며, 우상측 블록 C는 현재 블록 X에 속하는 첫 번째 행의 맨우측 픽셀의 상측으로 인접한 픽셀의 우측으로 인접한 픽셀이 속하는 블록을 가리킨다.The motion vector coding method according to the present invention is based on a differential coding scheme (differential pulse coded modulation) for coding a representative value of neighboring blocks of the motion vector MV_X of the current block, that is, an error value with respect to a median in the present embodiment . That is, if the motion vectors of the left block A, the upper block B, and the upper right block C, which are neighbor blocks for the current block X, are MV_A, MV_B, and MV_C, respectively, a prediction vector PVM_X, which is a prediction vector for differential vector coding, The difference vector MVD_X is calculated by the following equation (1). The calculation is performed independently for each of the component values (x component and y component) of the vector. On the other hand, the left block A indicates a block to which the adjacent pixel to the left of the leftmost pixel of the first row belonging to the current block X belongs, and the upper block C indicates the block adjacent to the uppermost pixel of the leftmost pixel of the first row belonging to the current block X And the upper right side block C indicates a block to which a pixel adjacent to the right side of the pixel adjacent to the upper right side of the pixel on the right side of the first row belonging to the current block X belongs.

PMV_X = median(MV_A, MV_B, MV_C)PMV_X = median (MV_A, MV_B, MV_C)

MVD_X = MV_X - PMV_XMVD_X = MV_X - PMV_X

본 발명에 따른 움직임 벡터 복호화 방법은 현재 블록의 이웃 블록들의 대표값, 본 실시예에서는 중간값(median)과, 복호화하여 얻은 오차값 MVD_X을 더하여 현재 블록의 움직임 벡터 MV_X를 구하는 복호화 방식에 따른다. 즉, 현재 블록 X에 대한 이웃 블록들인 좌측 블록 A, 상측 블록 B, 우상측 블록 C의 움직임 벡터를 각각 MV_A, MV_B, MV_C라고 하면 복호화를 위한 예측값인 예측 벡터 PVM_X와, 여기 에 복호화된 오차값 MVD_X을 더해서 얻어지는 움직임 벡터 MV_X는 다음 수학식 2에 의해 계산된다. 계산은 벡터의 성분값(x 성분 및 y 성분)에 대해 각각 독립적으로 수행된다.The motion vector decoding method according to the present invention is based on a decoding method of obtaining a motion vector MV_X of a current block by adding a representative value of neighboring blocks of the current block, in this embodiment, an intermediate value (median) and an error value MVD_X obtained by decoding. That is, if the motion vectors of the left block A, the upper block B, and the upper right block C, which are neighbor blocks for the current block X, are MV_A, MV_B, and MV_C, respectively, a prediction vector PVM_X, which is a prediction value for decoding, The motion vector MV_X obtained by adding MVD_X is calculated by the following equation (2). The calculation is performed independently for each of the component values (x component and y component) of the vector.

PMV_X = median(MV_A, MV_B, MV_C)PMV_X = median (MV_A, MV_B, MV_C)

MV_X = MVD_X + PMV_XMV_X = MVD_X + PMV_X

전술한 부호화 방법 및 복호화 방법에 따라 예측 움직임 벡터를 구함에 있어 예외 경우를 처리하는 로직은 다음과 같다.The logic for processing an exception case in obtaining a predicted motion vector according to the above-described encoding method and decoding method is as follows.

첫째, 이웃 블록들 A, B, C, D 중 특정 블록이 픽처(또는 슬라이스)의 밖에 위치하는 경우는 다음과 같이 처리한다. 슬라이스는 시작 코드를 갖는 일련의 데이터 열의 최소 단위로 임의의 길이를 가지며 매크로 블록으로 구성된다. 슬라이스는 여러 픽처에 걸쳐 존재하지 않고 하나의 픽처 내부에 존재한다.First, when a specific block among the neighboring blocks A, B, C, and D is located outside a picture (or a slice), the following processing is performed. A slice is a minimum unit of a series of data sequences having a start code and has an arbitrary length and is composed of macro blocks. The slice does not exist across several pictures and exists inside one picture.

① 블록 A와 D가 모두 픽처(또는 슬라이스)의 밖에 위치하는 경우에는 MV_A=MV_D=0으로 하고 블록 A와 D는 현재 블록 X와 다른 참조 픽처를 갖는 것으로 간주한다.(1) MV_A = MV_D = 0 if blocks A and D are both located outside the picture (or slice), and blocks A and D are considered to have reference pictures different from the current block X.

② 블록 B, C, D 모두 픽처(또는 슬라이스)의 밖에 위치하는 경우에는 MV_B= MV_C=MV_A로 하고 중간값을 취할 경우에 반드시 MV_A이 현재 블록 X의 예측 벡터 PMV_X가 되도록 한다.(2) MV_B = MV_C = MV_A when the blocks B, C, and D are located outside the picture (or slice), and MV_A must be the predicted vector PMV_X of the current block X when taking an intermediate value.

③ 블록 C가 픽처(또는 슬라이스)의 밖에 위치하는 경우에는 블록 D로 대체한다. 블록 D는 현재 블록 X의 좌상측 블록으로서 현재 블록 X에 속하는 첫 번째 행의 맨좌측 픽셀의 상측으로 인접한 픽셀이 속하는 블록을 가리킨다.(3) If block C is located outside the picture (or slice), replace it with block D. The block D indicates a block to which a pixel adjacent to the upper left side of the leftmost pixel of the first row belonging to the current block X belongs as the upper left side block of the current block X. [

둘째, 이웃 블록들이 인트라 부호화된 경우, 즉 이웃 블록 A, B, C, D 가운데 인트라로 부호화된 블록이 있으면 그 블록의 움직임 벡터를 0으로 하고 다른 참조 픽처를 갖는 것으로 간주한다.Second, if the neighboring blocks are intra-coded, that is, if there is a block coded in intra-neighboring blocks A, B, C, and D, the motion vector of the block is regarded as having 0 and having another reference picture.

셋째, 이웃 블록이 현재 블록과 다른 참조 픽처를 갖는 경우에는 본 발명에서 제안하는 방식에 따라 「예측 움직임 벡터」를 구한 다음 구해진 「예측 움직임 벡터」를 중간값을 구하는데 사용한다. 다시 말해, 예측 부호화에 참여하는 현재 블록과 이웃 블록이 서로 다른 타입의 움직임 벡터를 갖고 있으면, 본 발명에서 제안하는 방식에 따라 동일한 타입의 예측 움직임 벡터를 구한 다음 이를 수학식 1 및 수학식 2의 예측 벡터를 구하는 식에 대입하여 중간값을 구한다.Thirdly, when the neighboring block has a reference picture different from the current block, a "predicted motion vector" is obtained according to the method proposed by the present invention, and then a "predicted motion vector" obtained is used to obtain an intermediate value. In other words, if the current block and the neighboring block participating in the predictive encoding have different types of motion vectors, a predictive motion vector of the same type is obtained according to the method proposed by the present invention, Is substituted into the equation for obtaining the predictive vector to obtain the intermediate value.

도 8은 본 발명의 바람직한 실시예에 따라 예측 움직임 벡터를 구하는 경우를 설명하기 위한 참고도이다.8 is a reference diagram for explaining a case of obtaining a predicted motion vector according to a preferred embodiment of the present invention.

도 8을 참조하면, 현재 블록 X는 포워드 움직임 벡터 MVf_X를 가지고 있고, 이웃 블록 A, D는 현재 블록 X와 동일한 타입의 포워드 움직임 벡터 MVf_A 및 MVf_D를 가지고 있다. 그러나, 이웃 블록 B는 현재 블록 X와 상이한 타입의 백워드 움직임 벡터 MVb_B를 가지며, 이웃 블록 C는 포워드 움직임 벡터 MVf_C 및 백워드 움직임 벡터 MVb_C을 모두 가지고 있다.Referring to FIG. 8, the current block X has a forward motion vector MVf_X, and the neighboring blocks A and D have forward motion vectors MVf_A and MVf_D of the same type as the current block X. [ However, neighboring block B has a different type of backward motion vector MVb_B than current block X, and neighboring block C has both forward motion vector MVf_C and backward motion vector MVb_C.

전술한 수학식 1 및 수학식 2에 따른 중간값은 동일한 타입의 움직임 벡터들에 대해서 구해야 한다. 그 이유는 현재 블록과 다른 움직임 벡터가 부호화 및 복호화에 참여하게 되면 부호화 및 복호화 효율이 떨어질 수 있기 때문이다. 그런 데, 이웃 블록 B는 동일한 타입의 움직임 벡터를 가지고 있지 않으므로 먼저 이웃 블록 B의 예측 움직임 벡터를 구해야 한다. 다시 말해, 현재 블록 X와 동일한 타입의 포워드 움직임 벡터를 예측해야 한다.The intermediate values according to the above-described equations (1) and (2) must be obtained for the same type of motion vectors. This is because encoding and decoding efficiency may be degraded if motion vectors different from the current block participate in encoding and decoding. Since the neighboring block B does not have the same type of motion vector, the predicted motion vector of the neighboring block B must be obtained. In other words, a forward motion vector of the same type as the current block X must be predicted.

도 9는 예측 움직임 벡터를 구하는 방식의 일 예를 보여준다.FIG. 9 shows an example of a method of obtaining a predicted motion vector.

도 9를 참조하면, 이웃 블록에 대한 예측 움직임 벡터로서 포워드 움직임 벡터 MVf(예측) 또는 백워드 움직임 벡터 MVb(예측)은 다음 식에 의해 예측될 수 있다.Referring to FIG. 9, the forward motion vector MVf (prediction) or the backward motion vector MVb (prediction) as a prediction motion vector for a neighboring block can be predicted by the following equation.

MVb(예측) = {(Distance_B - Distance_A)/Distance_B}*MVfMVb (prediction) = {(Distance_B - Distance_A) / Distance_B} * MVf

MVf(예측) = {Distance_B/(Distance_B - Distance_A)}*MVbMVf (prediction) = {Distance_B / (Distance_B - Distance_A)} * MVb

여기서, Distance_A는 대응 이웃 블록이 속하는 현재 픽처가 참조한 참조 픽처 1 및 참조 픽처 2와의 픽처 거리(picture_distance)이고, Distance_B는 대응 이웃 블록이 속하는 현재 픽처와 참조 픽처 1과의 픽처 거리(picture_distance)이다. 본 예에서 참조 픽처 1은 현재 픽처에 대한 과거 픽처이고 참조 픽처 2는 미래 픽처이다.Here, Distance_A is the picture distance (picture_distance) between the reference picture 1 and the reference picture 2 referenced by the current picture to which the corresponding neighboring block belongs, and Distance_B is the picture distance (picture_distance) between the current picture and the reference picture 1 to which the corresponding neighboring block belongs. In this example, reference picture 1 is a past picture for the current picture and reference picture 2 is a future picture.

도 10은 예측 움직임 벡터를 구하는 방식의 다른 예를 보여준다.FIG. 10 shows another example of a method of obtaining a predicted motion vector.

도 10을 참조하면, 이웃 블록에 대한 예측 움직임 벡터로서 포워드 움직임 벡터 MVf(예측) 또는 백워드 움직임 벡터 MVb(예측)은 다음 식에 의해 예측될 수 있다.Referring to FIG. 10, the forward motion vector MVf (prediction) or the backward motion vector MVb (prediction) as predicted motion vectors for neighboring blocks can be predicted by the following equation.

MVb(예측) = {(TR_B - TR_A)/TR_B}*MVfMVb (prediction) = {(TR_B - TR_A) / TR_B} * MVf

MVf(예측) = {TR_B/(TR_B - TR_A)}*MVbMVf (prediction) = {TR_B / (TR_B - TR_A)} * MVb

여기서, TR_A는 대응 이웃 블록이 속하는 현재 픽처가 참조한 과거 픽처 및 미래 픽처와의 시간차이고, TR_B는 대응 이웃 블록이 속하는 현재 픽처와 과거 픽처와의 시간차이다. 시간차는 픽처 간의 디스플레이의 상대적인 시간 순서를 알기위한 카운터값 TR(Temporal Reference)으로부터 구해낼 수 있다.Here, TR_A is the time difference between the current picture to which the corresponding neighboring block belongs and the future picture referenced by the current picture, and TR_B is the time difference between the current picture and the past picture to which the corresponding neighboring block belongs. The time difference can be obtained from a counter value TR (Temporal Reference) for knowing the relative time sequence of display between pictures.

한편, 본 발명에 따른 움직임 벡터 부호화 방법은 B(Bi-predictive) 픽처에 대해 그 특징을 가지므로 B 픽처에 대해 보다 상세히 설명하면 다음과 같다.Meanwhile, since the motion vector coding method according to the present invention has characteristics of a B (Bi-predictive) picture, the B picture will be described in more detail as follows.

B 픽처는 반드시 시간적으로 과거 픽처와 미래 픽처를 가지고 움직임 보상을 수행해야 한다는 제약을 갖지 않는다. 이에 따라 B 픽처에 속하는 현재 블록의 움직임 벡터는 시간이나 방향에 독립적이다. 다시 말해, B 픽처는 복수개의 픽처들을 참조하여 얻어진 것이므로, 현재 블록과 이웃 블록이 서로 다른 타입의 움직임 벡터를 가질 가능성이 높다. 그럼에도 불구하고, B 픽처에 속하는 현재 블록의 움직임 벡터는 본 발명에 따른 움직임 벡터 부호화 방법 및 복호화 방법에 의해, 이웃 블록들의 움직임 벡터들의 타입에 관계없이 부호화 및 복호화가 가능하다.The B picture does not necessarily have a constraint that the motion compensation must be performed with the past picture and the future picture temporally. Accordingly, the motion vector of the current block belonging to the B picture is independent of time or direction. In other words, since the B picture is obtained by referring to a plurality of pictures, there is a high possibility that the current block and the neighboring block have different types of motion vectors. Nevertheless, the motion vector of the current block belonging to the B picture can be encoded and decoded regardless of the type of motion vectors of neighboring blocks by the motion vector coding method and decoding method according to the present invention.

B 픽처는 4 종류의 움직임 보상 모드를 가지므로 4 종류의 움직임 벡터가 존재한다. 포워드 움직임 벡터 Forward MV(MVf), 백워드 움직임 벡터 Backward MV(MVb), 양방향 움직임 벡터 Bi-predictive MV(MVf, MVb), 다이렉트 움직임 벡터 Direct MV가 그것이다. 다이렉트 움직임 벡터인 경우에는 움직임 벡터 정보를 수신단에 전송하지 않으므로 부호화 및 복호화할 필요가 없지만, 나머지 움직임 벡터 들은 P 픽처와 마찬가지로, 이웃 블록의 움직임 벡터들로부터 얻어진 예측 벡터 PMV를 사용하여 부호화하거나 복호화한다.Since B pictures have four kinds of motion compensation modes, there are four kinds of motion vectors. Forward motion vector Forward MV (MVf), backward motion vector Backward MV (MVb), bidirectional motion vector Bi-predictive MV (MVf, MVb), and direct motion vector Direct MV. In the case of a direct motion vector, it is not necessary to encode and decode motion vector information since the motion vector information is not transmitted to the receiving end. Likewise, the remaining motion vectors are encoded or decoded using a predictive vector PMV obtained from motion vectors of neighboring blocks .

전술한 바와 같이, B 픽처에 속하는 현재 블록의 움직임 벡터는 시간이나 방향에 독립적이므로 포워드, 백워드가 반드시 특정 시간이나 방향으로 구분됨을 의미하지는 않는다. 양방향 또한 반드시 특정 시간이나 방향을 구분하여 특정 시점을 기준으로 과거와 미래를 포함해야하거나 특정 지점을 기준으로 양방향이 반드시 포함되어야 하는 것은 아니다.As described above, the motion vector of the current block belonging to the B picture is independent of the time or direction, and thus does not necessarily mean that the forward and backward words are necessarily separated by a specific time or direction. Both directions also need to include the past and the future based on the specific time or direction by distinguishing the specific time or direction, or both directions based on the specific point are not necessarily included.

예측 벡터 PMV를 구함에 있어 MVf와 MVb는 각각 이웃 블록과 동일한 타입의 움직임 벡터들을 이용한다. 즉, MVf는 예측 벡터를 구함에 있어 이웃의 MVf들만을 이용하고 MVb는 주변의 MVb들만을 이용한다. 단, 양방향 움직임 벡터는 두가지 모두를 가지고 있으므로 각각 필요한 움직임 벡터를 사용한다. 따라서, B 픽처의 움직임 벡터를 부호화하거나 복호화함에 있어 예측 벡터 PMV를 설정할 때, 이웃의 움직임 벡터의 타입이 상이한 경우 동일한 타입의 움직임 벡터는 도 9 및 10을 참조하여 설명한 방법으로 예측할 수 있다.In obtaining the prediction vector PMV, MVf and MVb use motion vectors of the same type as neighboring blocks, respectively. That is, MVf uses only neighboring MVfs in finding a prediction vector, and MVb uses only nearby MVbs. However, since the bidirectional motion vector has both of them, a necessary motion vector is used. Therefore, when setting the predictive vector PMV in coding or decoding the motion vector of the B picture, if the types of neighboring motion vectors are different, motion vectors of the same type can be predicted by the method described with reference to FIG. 9 and FIG.

도 7를 다시 참조하여, MVf_X = (1,2), MVf_A = (4,4), MVb_B = (-1,-1), MVf_C = (0,3), MVb_C = (-1,-2)라고 할 때, 종래 기술에 따르면 MVb_B = (-1,-1)는 현재 블록의 움직임 벡터와 타입이 상이하므로 중간값을 구하는데 있어 배제되고 대신 (0,0)이 대입된다. 따라서, 중간값은 (0, 3)이 되고 차분값 DMV_X는 (1, -1)이 된다. 그러나, 본 발명에 따르면, MVb_B = (-1,-1) 대신 예측된 (1, 1)이 중간값을 구하는데 사용된다. 따라서 중간값은 (1,1)이 되고 차분값 DMV_X는 (0,1)이 된다.7, MVb_B = (-1, -1), MVf_C = (0,3), MVb_C = (-1, -2) MVb_B = (-1, -1) is excluded from obtaining the intermediate value because MVb_B = (-1, -1) is different from the type of the motion vector of the current block, and (0,0) is substituted instead. Therefore, the intermediate value becomes (0, 3) and the difference value DMV_X becomes (1, -1). However, according to the present invention, the predicted (1, 1) instead of MVb_B = (-1, -1) is used to obtain the intermediate value. Therefore, the intermediate value becomes (1,1) and the difference value DMV_X becomes (0, 1).

한편, 움직임보상 블록은 전술한 바와 같이 직사각형 형태를 가질 수 있다. 직사각형의 움직임 보상 블록의 경우에는 움직임 벡터의 예측 방향을 알 수가 있기 때문에 상기 서술한 주변 세 블록의 움직임 벡터들의 중간값을 예측 벡터로 사용하는 대신 다른 방식으로 예측한 예측 벡터를 사용한다.On the other hand, the motion compensation block may have a rectangular shape as described above. In the case of a rectangular motion compensation block, the prediction direction of the motion vector can be known. Therefore, instead of using the intermediate value of the motion vectors of the neighboring three blocks described above as prediction vectors, prediction vectors predicted by other methods are used.

도 11은 직사각형 움직임보상 블록에 대한 예측 벡터를 구하는 방식을 설명하기 위한 참고도이다.11 is a reference diagram for explaining a method of obtaining a prediction vector for a rectangular motion compensation block.

도 11을 참조하면, 움직임보상 블록이 8×16인 경우 블록 ①의 예측 벡터로는 이웃 블록 중 좌측 블록의 움직임 벡터가 사용되고 블록 ②의 예측 벡터로는 이웃 블록 중 우상측 블록의 움직임 벡터가 사용된다.Referring to FIG. 11, when the motion compensation block is 8 × 16, the motion vector of the left block of the neighboring block is used as the predictive vector of the block 1, and the motion vector of the upper block is used as the prediction vector of the block do.

움직임보상 블록이 16×8인 경우 블록 ③의 예측 벡터로는 이웃 블록 중 상측 블록의 움직임 벡터가 사용되고 블록 ④의 예측 벡터로는 이웃 블록 중 좌측 블록의 움직임 벡터가 사용된다.If the motion compensation block is 16 × 8, the motion vector of the upper block of the neighboring block is used as the prediction vector of the block ③, and the motion vector of the left block of the neighboring block is used as the prediction vector of the block ④.

움직임보상 블록이 8×4인 경우 블록 ⑤의 예측 벡터는 각각 이전 블록의 중간값이 그대로 사용되어 구해지고 블록 ⑥의 예측 벡터로는 각각 이웃 블록 중 좌측 블록의 움직임 벡터가 사용된다.When the motion compensation block is 8 × 4, the prediction vector of the block ⑤ is obtained by using the intermediate value of the previous block as it is, and the motion vector of the left block among the neighboring blocks is used as the prediction vector of the block ⑥.

움직임보상 블록이 4×8인 경우 블록 ⑦의 예측 벡터는 각각 이전 블록의 중간값이 그대로 사용되어 구해지고 블록 ⑧의 예측 벡터로는 각각 이웃 블록 중 상측 블록의 움직임 벡터가 사용된다.If the motion compensation block is 4 × 8, the prediction vector of the block ⑦ is obtained by using the intermediate value of the previous block as it is, and the motion vector of the upper block among the neighboring blocks is used as the prediction vector of the block ⑧, respectively.

다만, 예측 벡터로 설정된 움직임 벡터의 참조 픽처가 현재 블록의 참조 픽 처와 다른 경우에는 기존 중간값을 사용한다. 다른 예외의 경우들은 상기 서술한 중간값 예측에서와 동일하게 처리한다.However, if the reference picture of the motion vector set as the predictive vector is different from the reference picture of the current block, the existing intermediate value is used. Other cases of exception are processed in the same manner as in the above-described intermediate value prediction.

전술한 움직임 벡터 부호화 방법 및 복호화 방법은 컴퓨터 프로그램으로 작성 가능하다. 상기 프로그램을 구성하는 코드들 및 코드 세그먼트들은 당해 분야의 컴퓨터 프로그래머에 의하여 용이하게 추론될 수 있다. 또한, 상기 프로그램은 컴퓨터가 읽을 수 있는 정보저장매체(computer readable medium)에 저장되고, 컴퓨터에 의하여 읽혀지고 실행됨으로써 움직임 벡터 부호화 방법 및 복호화 방법을 구현한다. 상기 정보저장매체는 자기 기록매체, 광 기록매체, 및 캐리어 웨이브 매체를 포함한다.The motion vector coding method and the decoding method described above can be created by a computer program. The codes and code segments that make up the program can be easily deduced by a computer programmer in the field. Also, the program is stored in a computer readable medium and read and executed by a computer to implement a motion vector coding method and a decoding method. The information storage medium includes a magnetic recording medium, an optical recording medium, and a carrier wave medium.

도 1은 본 발명의 바람직한 실시예에 따른 움직임 벡터 부호화 장치의 블록도,1 is a block diagram of a motion vector coding apparatus according to a preferred embodiment of the present invention.

도 2는 본 발명의 바람직한 실시예에 따라, 도 1의 움직임 벡터 부호화 장치를 포함한 영상 데이터 부호화 장치의 블록도,FIG. 2 is a block diagram of an image data encoding apparatus including the motion vector encoding apparatus of FIG. 1 according to a preferred embodiment of the present invention;

도 3은 입력 영상의 일 예,3 shows an example of an input image,

도 4는 본 발명의 바람직한 실시예에 따른 움직임 벡터 복호화 장치의 블록도,4 is a block diagram of a motion vector decoding apparatus according to a preferred embodiment of the present invention.

도 5는 본 발명의 바람직한 실시예에 따라, 도 10의 움직임 벡터 복호화 장치를 포함한 영상 데이터 복호화 장치의 블록도,FIG. 5 is a block diagram of a video data decoding apparatus including the motion vector decoding apparatus of FIG. 10 according to a preferred embodiment of the present invention;

도 6은 본 발명의 바람직한 실시예에 따른 다중 참조(Multiple reference) 방식을 설명하기 위한 참고도,6 is a reference diagram for explaining a multiple reference method according to a preferred embodiment of the present invention,

도 7은 본 발명의 바람직한 실시예에 따른 움직임 보상의 단위가 되는 움직임보상 블록들을 보여주는 참고도,FIG. 7 is a reference view showing motion compensation blocks as units of motion compensation according to a preferred embodiment of the present invention;

도 8은 본 발명의 바람직한 실시예에 따라 예측 움직임 벡터를 구하는 경우를 설명하기 위한 참고도,8 is a reference diagram for explaining a case of obtaining a predicted motion vector according to a preferred embodiment of the present invention,

도 9는 예측 움직임 벡터를 구하는 방식의 일 예,9 shows an example of a method of obtaining a predicted motion vector,

도 10은 예측 움직임 벡터를 구하는 방식의 다른 예,10 shows another example of a method of obtaining a predicted motion vector,

도 11은 직사각형 움직임보상 블록에 대한 예측 벡터를 구하는 방식을 설명하기 위한 참고도이다.11 is a reference diagram for explaining a method of obtaining a prediction vector for a rectangular motion compensation block.

Claims (3)

움직임 벡터를 복호화하는 방법에 있어서,A method for decoding a motion vector, 매크로블록 내에 구비된 현재 블록의 크기와 위치에 따라서 상기 현재 블록의 예측 움직임 벡터로 사용될 움직임 벡터를 갖는 이웃 블록을 선택하는 단계; 및Selecting a neighboring block having a motion vector to be used as a predicted motion vector of the current block according to a size and position of a current block included in the macroblock; And 상기 선택된 이웃 블록의 움직임 벡터를 상기 현재 블록의 예측 움직임 벡터로 선택하는 단계를 포함하며,And selecting a motion vector of the selected neighboring block as a predicted motion vector of the current block, 상기 현재 블록의 예측 움직임 벡터로 사용될 이웃 블록을 선택하는 단계는 상기 매크로 블록 내의 현재 블록의 크기가 16x8이고 상기 현재 블록이 매크로 블록 내의 상측 블록인 경우, 상기 현재 블록의 상측에 인접한 이웃 블록의 움직임 벡터를 상기 현재 블록의 예측 움직임 벡터로 선택하는 것을 특징으로 하는 움직임 벡터의 복호화 방법.Wherein the step of selecting a neighboring block to be used as a predictive motion vector of the current block comprises: if the current block in the macroblock is 16x8 and the current block is an upper block within the macroblock, And selecting a predictive motion vector of the current block as a predictive motion vector of the current block. 제 1항에 있어서,The method according to claim 1, 상기 현재 블록의 원 움직임 벡터와 상기 예측 움직임 벡터 사이의 차이값을 복원하는 단계; 및Reconstructing a difference value between the original motion vector of the current block and the predicted motion vector; And 상기 복원된 차이값과 상기 예측 움직임 벡터를 더하는 단계를 포함하는 것을 특징으로 하는 움직임 벡터의 복호화 방법.And adding the restored difference value to the predicted motion vector. 움직임 벡터의 복호화 장치에 있어서,An apparatus for decoding a motion vector, 현재 블록의 원 움직임 벡터와 상기 현재 블록의 예측 움직임 벡터 사이의 차이값을 복호화하는 움직임 벡터 복호화부; 및A motion vector decoding unit for decoding a difference value between a original motion vector of a current block and a predicted motion vector of the current block; And 매크로블록 내에 구비된 상기 현재 블록의 크기와 위치에 따라서 상기 현재 블록의 예측 움직임 벡터로 사용될 움직임 벡터를 갖는 이웃 블록을 선택하고, 상기 선택된 이웃 블록의 움직임 벡터를 상기 현재 블록의 예측 움직임 벡터로 선택하며, 상기 선택된 예측 움직임 벡터와 상기 복호화된 차이값을 더하는 움직임 벡터 예측 보상부를 포함하며,Selecting a neighboring block having a motion vector to be used as a predictive motion vector of the current block according to a size and a position of the current block included in the macroblock and selecting a motion vector of the selected neighboring block as a predictive motion vector of the current block And a motion vector prediction compensator for adding the selected predictive motion vector and the decoded difference value, 상기 움직임 벡터 예측 보상부는 상기 매크로 블록 내의 현재 블록의 크기가 16x8이고 상기 현재 블록이 매크로 블록 내의 상측 블록인 경우, 상기 현재 블록의 상측에 인접한 이웃 블록의 움직임 벡터를 상기 현재 블록의 예측 움직임 벡터로 선택하는 것을 특징으로 하는 움직임 벡터의 복호화 장치. If the current block size of the macroblock is 16x8 and the current block is an upper block within the macroblock, the motion vector predictor / compensator calculates a motion vector of a neighboring block adjacent to an upper side of the current block as a predicted motion vector of the current block And a motion vector of the motion vector.
KR1020070075878A 2007-07-27 2007-07-27 Method and apparatus for decoding motion vectors KR100774299B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020070075878A KR100774299B1 (en) 2007-07-27 2007-07-27 Method and apparatus for decoding motion vectors

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020070075878A KR100774299B1 (en) 2007-07-27 2007-07-27 Method and apparatus for decoding motion vectors

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
KR20020041798A Division KR100774296B1 (en) 2002-07-16 2002-07-16 Method and apparatus for encoding and decoding motion vectors

Publications (2)

Publication Number Publication Date
KR20070090124A KR20070090124A (en) 2007-09-05
KR100774299B1 true KR100774299B1 (en) 2007-11-08

Family

ID=38688662

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020070075878A KR100774299B1 (en) 2007-07-27 2007-07-27 Method and apparatus for decoding motion vectors

Country Status (1)

Country Link
KR (1) KR100774299B1 (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR19980036073A (en) * 1996-11-15 1998-08-05 배순훈 Motion vector detection method and apparatus
KR20010084661A (en) * 2000-02-28 2001-09-06 구자홍 Method for estimating motion and apparatus for the same

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR19980036073A (en) * 1996-11-15 1998-08-05 배순훈 Motion vector detection method and apparatus
KR20010084661A (en) * 2000-02-28 2001-09-06 구자홍 Method for estimating motion and apparatus for the same

Also Published As

Publication number Publication date
KR20070090124A (en) 2007-09-05

Similar Documents

Publication Publication Date Title
KR100774296B1 (en) Method and apparatus for encoding and decoding motion vectors
KR100856411B1 (en) Method and apparatus for compensating illumination compensation and method and apparatus for encoding moving picture based on illumination compensation, and method and apparatus for encoding moving picture based on illumination compensation
JP5580453B2 (en) Direct mode encoding and decoding apparatus
CA2459229C (en) Image coder and decoder which select interpolated pixel accuracy depending on the size of coverage of local motion vector detection areas
KR101420957B1 (en) Image encoding device, image decoding device, image encoding method, and image decoding method
RU2444856C2 (en) Method of encoding video signal and method of decoding, apparatus for realising said methods and data media storing programmes for realising said methods
JP2007329693A (en) Image encoding device and method
TW202017379A (en) Video encoding device and video encoding method
KR20090095012A (en) Method and apparatus for encoding and decoding image using consecutive motion estimation
KR20130117749A (en) Image processing device and image processing method
WO2006035584A1 (en) Encoder, encoding method, program of encoding method and recording medium wherein program of encoding method is recorded
JP3940657B2 (en) Moving picture encoding method and apparatus and moving picture decoding method and apparatus
JP3866624B2 (en) Moving picture encoding method, moving picture decoding method, moving picture encoding apparatus, and moving picture decoding apparatus
KR101187580B1 (en) Method and apparatus for compensating illumination compensation and method and apparatus for encoding moving picture based on illumination compensation, and method and apparatus for encoding moving picture based on illumination compensation
KR20040095398A (en) Method for determining reference picture, moving compensation method thereof and apparatus thereof
EP2109319A1 (en) Moving image encoding-decoding system with macroblock-level adaptive frame/field processing
KR100774297B1 (en) Method and apparatus for decoding motion vectors
KR20050098292A (en) Predictive encoding of motion vectors including a flag notifying the presence of coded residual motion vector data
KR100774299B1 (en) Method and apparatus for decoding motion vectors
KR100774298B1 (en) Method and apparatus for decoding motion vectors
KR100774300B1 (en) Method and apparatus for decoding motion vectors
JP5442039B2 (en) Image encoding device, image decoding device, image encoding method, and image decoding method
JP2006304350A (en) Moving picture decoding method and system
JP2003116141A (en) Moving picture prediction encoding method and its decoding method, and apparatus for the same
EP2479997A1 (en) Method and apparatus for encoding or decoding a video signal using a summary reference picture

Legal Events

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

Payment date: 20121030

Year of fee payment: 6

FPAY Annual fee payment

Payment date: 20131030

Year of fee payment: 7

FPAY Annual fee payment

Payment date: 20141030

Year of fee payment: 8

FPAY Annual fee payment

Payment date: 20151029

Year of fee payment: 9

FPAY Annual fee payment

Payment date: 20161028

Year of fee payment: 10

FPAY Annual fee payment

Payment date: 20171030

Year of fee payment: 11

FPAY Annual fee payment

Payment date: 20181030

Year of fee payment: 12

FPAY Annual fee payment

Payment date: 20191030

Year of fee payment: 13