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

Method and apparatus for decoding motion vectors Download PDF

Info

Publication number
KR20070090124A
KR20070090124A KR1020070075878A KR20070075878A KR20070090124A KR 20070090124 A KR20070090124 A KR 20070090124A KR 1020070075878 A KR1020070075878 A KR 1020070075878A KR 20070075878 A KR20070075878 A KR 20070075878A KR 20070090124 A KR20070090124 A KR 20070090124A
Authority
KR
South Korea
Prior art keywords
motion vector
block
current block
picture
prediction
Prior art date
Application number
KR1020070075878A
Other languages
Korean (ko)
Other versions
KR100774299B1 (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

A method and an apparatus for decoding motion vectors are provided to obtain predictive motion vectors of the same type even when a neighboring block has a different motion vector and reflect the obtained predictive motion vector to a process of obtaining a representative value(median) by using a motion vector prediction compensator so that encoding and decoding efficiency can be more improved. A method for decoding motion vectors comprises the following parts: selecting a neighboring block having a motion vector, which will be used as a predictive motion vector of a current block, according to a size and a location of the current block installed within a macro block; and selecting a motion vector of the selected neighboring block as the predictive motion vector of the current block. In the above first step, the motion vector of the neighboring block adjacent to an upper side of the current block is selected as the predictive motion vector of the current block if the size of the current block within the macro block is 8x16 and the current block is an upper block within the macro block.

Description

움직임 벡터 복호화 방법 및 그 장치{Method and apparatus for decoding motion vectors}Motion vector decoding method and apparatus therefor {Method and apparatus for decoding motion vectors}

본 발명은 움직임 벡터의 부호화 및 복호화에 관한 것으로, 보다 상세하게는 복수개의 픽처를 참조하여 산출된 움직임 벡터를 부호화하는 방법, 복호화하는 및 그 장치에 관한 것이다.The present invention relates to encoding and decoding of a motion vector, and more particularly, to a method, a decoding, and an apparatus for encoding 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 encoding method for referring to a past picture and a B-picture encoding method for referencing both past and future pictures are employed. Based on this, motion compensation is performed. In addition, in order to improve encoding efficiency, the prediction vector is performed by using motion vectors of neighboring blocks so that the correlation between motion vectors between neighboring blocks is reflected instead of encoding the motion vector of the current block as it is.

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

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

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

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

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

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

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

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

상기 움직임 벡터 예측기는 다음 식에 의해 산출된 대표값인 예측값 PMV_X을 구하는 것이 바람직하다.Preferably, the motion vector predictor obtains a predicted value PMV_X that 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, and MVf_C is the right upper block. MVb_A is the forward motion vector of the left block. MVb_B refers to the backward motion vector of the upper block, and MVb_C refers to the backward motion vector of the right upper block. The prediction motion vector may be any one of them.

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

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

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

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

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

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

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

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

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

상기 (b)단계는 다음 식에 의해 산출된 대표값인, 복호화를 위한 예측값 PMV_X을 구하는 단계임이 바람직하다.Step (b) is preferably a step of obtaining a prediction 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, and MVf_C is the right upper block. MVb_A is the forward motion vector of the left block. MVb_B refers to the backward motion vector of the upper block, and MVb_C refers to the backward motion vector of the right upper block. The prediction motion vector may be any one of them.

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

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

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

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

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

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

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

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

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

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

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

또한, 본 발명의 또 다른 실시예에 따른 움직임 벡터의 복호화 장치는 현재 블록의 원 움직임 벡터와 상기 현재 블록의 예측 움직임 벡터 사이의 차이값을 복호화하는 움직임 벡터 복호화부; 및 매크로블록 내에 구비된 상기 현재 블록의 크기와 위치에 따라서 상기 현재 블록의 예측 움직임 벡터로 사용될 움직임 벡터를 갖는 이웃 블록을 선택하고, 상기 선택된 이웃 블록의 움직임 벡터를 상기 현재 블록의 예측 움직임 벡터로 선택하며, 상기 선택된 예측 움직임 벡터와 상기 복호화된 차이값을 더하는 움직임 벡터 예측 보상부를 포함하며, 상기 움직임 벡터 예측 보상부는 상기 매크로 블록 내의 현재 블록의 크기가 16x8이고 상기 현재 블록이 매크로 블록 내의 상측 블록인 경우, 상기 현재 블록의 상측에 인접한 이웃 블록의 움직임 벡터를 상기 현재 블록의 예측 움직임 벡터로 선택하는 것을 특징으로 한다.In addition, the apparatus for decoding a motion vector according to another embodiment of the present invention includes a motion vector decoder for decoding a difference value between the original motion vector of the current block and the 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 a macroblock, and converting the motion vector of the selected neighboring block to the predictive motion vector of the current block. And a motion vector prediction compensator configured to add the selected predicted motion vector and the decoded difference value, wherein the motion vector prediction compensator has a size of a 16x8 current block in the macroblock and the current block is an upper block in the macroblock. In this case, the motion vector of the neighboring block adjacent to the upper side of the current block is selected as the 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 with respect to a neighboring block having a motion vector of a different type from the motion vector of the current block, and the intermediate value is obtained based on the intermediate value. Since the obtained difference value is encoded, the motion vector of the current block is obtained by predicting a motion vector of the same type with respect to a neighboring block having a motion vector of a different type from the decoded difference value and adding the intermediate value obtained based on the same. The coding efficiency and the decoding efficiency are increased.

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

이하 첨부한 도면을 참조하여 본 발명의 바람직한 실시예에 대해 상세히 설명한다.Hereinafter, exemplary 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 encoding apparatus according to a preferred embodiment of the present invention.

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

도 2는 본 발명의 바람직한 실시예에 따라, 도 1의 움직임 벡터 부호화 장치를 포함한 영상 데이터 부호화 장치의 블럭도이다.2 is a block diagram of an image data encoding apparatus including the motion vector encoding apparatus of FIG. 1, according to an exemplary 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 is an encoding apparatus employing a multiple reference scheme, and includes an encoding controller 100, a first source encoder 200, and a second source encoder 700. do. Also, a source decoder 300, a memory 400, a motion compensator 500, and a motion predictor 600 are provided.

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

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

제1 소스 부호화부(200)는 입력된 영상 데이터를 변환(transform) 부호화하여 얻어진 변환 계수값들을 소정 양자화 스텝에 따라 양자화하여 양자화된 변환 계수값들로 구성된 2차원 데이터인 N×M 데이터를 얻는다. 사용되는 변환의 예로는 DCT(Discrete Cosine Transform)을 들 수 있다. 양자화는 미리 결정된 양자화 스텝에 따라 수행된다.The first source encoder 200 quantizes transform coefficient values obtained by transform encoding 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 may include a discrete cosine transform (DCT). Quantization is performed according to a predetermined quantization step.

한편, 제1 소스 부호화부(200)로 입력되어 부호화된 영상 데이터는 이후 또는 이전에 입력된 영상 데이터의 움직임 보상을 위한 참조 데이터로 사용될 수 있으므로 소스 복호화부(300)에 의해 제1 소스 부호화부(200)의 역과정인 역양자화와 역변환 부호화를 거친 후 메모리(400)에 저장된다. 또한, 소스 복호화부(200)로부터 출력된 데이터가 차 영상 데이터이면 부호화 제어부(100)는 제2 스위치(S2)를 닫아서 소스 복호화부(300)로부터 출력된 차 영상 데이터가 움직임 보상부(500)의 출력과 더해진 다음 메모리(400)에 저장되도록 한다.Meanwhile, since the image data input and encoded by the first source encoder 200 may be used as reference data for motion compensation of the image data input after or before, the first source encoder by the source decoder 300. After inverse quantization and inverse transform encoding, which are inverse processes of 200, the memory is stored in the memory 400. In addition, if the data output from the source decoder 200 is difference image data, the encoding controller 100 closes the second switch S2 so that the difference image data output from the source decoder 300 is the motion compensator 500. And then stored in the memory 400.

움직임 예측(motion estimation)부(600)는 입력된 영상 데이터와 메모리(400)에 저장된 데이터를 비교하여, 현재 입력된 데이터와 가장 유사한 데이터를 찾은 다음, 입력된 영상 데이터와 비교하여 움직임 벡터 MV(Motion Vector)를 출력한다. 움직임 벡터는 적어도 하나의 픽처를 참조하여 구해진다. 즉, 복수개의 과거 및/또는 미래의 픽처를 참조하여 산출될 수 있다. 움직임 벡터가 메모리(400)로 전달되면 메모리(400)는 해당 데이터를 움직임 보상부(motion compensation)(500)로 출력하며, 움직임 보상부(500)는 입력받은 데이터를 기초로 현재 부호화하는 영상 데이터에 해당하는 보상치를 만들어 출력한다.The motion estimation unit 600 compares the input image data with data stored in the memory 400 to find the most similar data to the currently input data, and then compares the input image data with the input image data to obtain a motion vector MV ( Motion Vector) is output. The motion vector is obtained with reference to at least one picture. That is, it may 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, and the motion compensation unit 500 currently encodes the image data based on the received data. Create and output the compensation value corresponding to

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

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

도 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 decoding apparatus is a device for decoding a motion vector according to the present invention, and 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, it is necessary to obtain the predicted value used in the error value calculation and add it to the error value to finally find the original motion vector. To this end, the motion vector prediction compensator 132 receives motion vectors for a plurality of blocks and inputs them to a neighboring block having only motion vectors of a different type from the motion vector of the current block among a plurality of neighboring blocks neighboring the current block. Predicts a motion vector of the same type as the motion vector of the current block, and then obtains a predictive motion vector, and then, among the motion vectors of the neighboring blocks, including the obtained predicted motion vector, a motion vector of the same type as the motion vector of the current block. A representative value for the current block is calculated and the motion vector of the current block is calculated by adding the calculated representative value to the error value reconstructed by the motion vector decoder 131.

본 발명에 따른 움직임 벡터 복호화 방법은 본 발명에 따른 움직임 벡터 복호화 장치(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 as it is, instead of decoding the motion vector of the current block in order to increase 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 an image data decoding apparatus equipped with the motion vector decoding apparatus 130 of FIG. 4.

도 5를 참조하면, 복호화 장치는 비트스트림을 디먹싱하는 디먹싱부(110), 제2 소스 복호화부(710), 제1 소스 복호화부(210)을 구비한다. 또한, 코딩 타입 정보를 복호화하는 코딩 타입 정보 복호화부(120) 및 본 발명에 따른 움직임벡터 복호화를 수행하는 움직임 벡터 복호화부(130)를 구비한다.Referring to FIG. 5, a decoding apparatus includes a demux 110, a second source decoder 710, and a first source decoder 210 for demuxing a bitstream. A coding type information decoder 120 for decoding coding type information and a motion vector decoder 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 bitstream is demuxed into quantized transform coding coefficients, motion vector information, coding type information, and the like entropy coded by the demux 110. The second source decoder 710 entropy decodes the encoded transform coding coefficients and outputs the quantized transform coding coefficients. The first source decoder 210 source decodes the quantized transform coding coefficients. That is, the reverse process of the first source encoder 200 of FIG. 1 is performed. For example, if the first source encoder 200 performs the DCT, the first source decoder 210 performs an Inverse Discrete Cosine Transform (IDCT). Thus, the video data is restored. The reconstructed image data is stored in the memory unit 410 for motion compensation.

한편, 코딩 타입 정보 복호화부(120)는 코딩 타입을 알아내어 움직임 보상이 필요한 인터 타입일 경우 제3 스위치(S30)를 닫아 제1 소스 복호화부(210)로부터 출력된 데이터에 움직임 보상부(510)로부터 출력된 움직임 보상값을 더해지도록 하여 복원된 영상 데이터가 얻어지도록 해준다. 움직임 벡터 복호화부(130)는 움직임 벡터 정보로부터 얻은 움직임 벡터가 가리키는 위치를 알려주고, 움직임 보상부(510)는 움직임 벡터가 가리키는 참조 영상 데이터로부터 움직임 보상값을 생성하여 출력한다. 움직임 벡터 복호화부(130)의 상세한 동작은 도 10을 참조하여 설명한 것과 동일하므로 반복되는 설명은 생략한다.On the other hand, the coding type information decoder 120 detects the coding type and closes the third switch S30 in the case of an inter type requiring motion compensation, and then the motion compensator 510 to the data output from the first source decoder 210. Reconstructed image data is obtained by adding the motion compensation value output from The motion vector decoder 130 informs the position indicated by the motion vector obtained from the motion vector information, and the motion compensator 510 generates and outputs a motion compensation value from the reference image data indicated by the motion vector. Since the detailed operation of the motion vector decoder 130 is the same as that described with reference to FIG. 10, repeated 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 refers to an intra picture obtained without referring to another picture, and a B picture refers to a bi-predictive picture obtained by referring to two different pictures. P picture refers to a predictive picture obtained by referring to only an I picture. Arrows show pictures required for decoding, that is, dependency. The B2 picture depends on the I0 picture and the P4 picture, and the B1 picture depends on the I0 picture, the P4 picture, and the B2 picture. The B3 picture is dependent on the I0 picture, the P4 picture, the B1 picture, and the B2 picture. Thus, the display order is I0, B1, B2, B3, P4 ..., but the transmission order is I0, P4, B2, B1, B3 .... As described above, according to the encoding apparatus of FIG. 1, there is a B picture 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 includes at least one of a forward prediction method, a backward prediction method, a bi-directional prediction method, and a bidirectional prediction method including a direct prediction method. It is calculated in the way. In the bidirectional prediction scheme, both reference pictures may be both past pictures or both future pictures.

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

도 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 is not only a 16x16 macroblock MB according to the present embodiment but also a 16x8 block obtained by dividing the macroblock in the horizontal direction, an 8x16 block obtained by dividing the macroblock in the vertical direction, 8x8 blocks obtained by dividing the macroblocks in the horizontal and vertical directions respectively, 8x4 blocks or 4x8 blocks obtained by dividing the macro blocks in the horizontal or vertical directions, respectively 4 Contains × 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 encoding method according to the present invention is based on a differential pulse coded modulation that encodes a representative value of neighboring blocks of the motion vector MV_X of the current block, and an error value with respect to a median in this embodiment. . That is, if the motion vectors of the left block A, the upper block B, and the right upper block C, which are neighboring blocks of the current block X, are MV_A, MV_B, and MV_C, respectively, the prediction vector PVM_X, which is a prediction value for the differential vector encoding, and the difference value using the same, The difference vector MVD_X is calculated by the following equation. The calculation is performed independently for each component value (x component and y component) of the vector. On the other hand, the left block A refers to the 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 refers to the pixel adjacent to the top of the leftmost pixel of the first row belonging to the current block X. The right upper block C refers to the block to which the adjacent pixel belongs to the right of the adjacent pixel above the rightmost pixel of the first row belonging to the current block X.

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, a median in this embodiment, 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 right upper block C, which are neighboring blocks for the current block X, are MV_A, MV_B, and MV_C, respectively, the prediction vector PVM_X, which is a prediction value for decoding, and the error value decoded therein. The motion vector MV_X obtained by adding MVD_X is calculated by the following equation. The calculation is performed independently for each component value (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 in obtaining a predicted motion vector according to the above-described encoding method and decoding method is as follows.

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

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

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

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

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

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

도 8은 본 발명의 바람직한 실시예에 따라 예측 움직임 벡터를 구하는 경우를 설명하기 위한 참고도이다.8 is a reference diagram for describing a case of obtaining a predictive 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 neighboring blocks A and D have forward motion vectors MVf_A and MVf_D of the same type as the current block X. However, the neighboring block B has a different type of backward motion vector MVb_B from the current block X, and the neighboring block C has both a forward motion vector MVf_C and a backward motion vector MVb_C.

전술한 수학식 1 및 수학식 2에 따른 중간값은 동일한 타입의 움직임 벡터들에 대해서 구해야 한다. 그 이유는 현재 블록과 다른 움직임 벡터가 부호화 및 복호화에 참여하게 되면 부호화 및 복호화 효율이 떨어질 수 있기 때문이다. 그런 데, 이웃 블록 B는 동일한 타입의 움직임 벡터를 가지고 있지 않으므로 먼저 이웃 블록 B의 예측 움직임 벡터를 구해야 한다. 다시 말해, 현재 블록 X와 동일한 타입의 포워드 움직임 벡터를 예측해야 한다.Median values according to Equations 1 and 2 described above should be obtained for motion vectors of the same type. The reason is that if a motion vector different from the current block participates in encoding and decoding, the encoding and decoding efficiency may be reduced. However, since the neighboring block B does not have the same type of motion vector, first, the prediction 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는 예측 움직임 벡터를 구하는 방식의 일 예를 보여준다.9 shows an example of a method of obtaining a predicted motion vector.

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

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

MVf(예측) = {Distance_B/(Distance_B - Distance_A)}*MVbMVf (forecast) = {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 referred to by the current picture to which the corresponding neighboring block belongs, and Distance_B is the picture distance (picture_distance) between the current picture to which the corresponding neighboring block belongs and the reference picture 1. In this example, reference picture 1 is a past picture for the current picture and reference picture 2 is a future picture.

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

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

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

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

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

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

B 픽처는 반드시 시간적으로 과거 픽처와 미래 픽처를 가지고 움직임 보상을 수행해야 한다는 제약을 갖지 않는다. 이에 따라 B 픽처에 속하는 현재 블록의 움직임 벡터는 시간이나 방향에 독립적이다. 다시 말해, B 픽처는 복수개의 픽처들을 참조하여 얻어진 것이므로, 현재 블록과 이웃 블록이 서로 다른 타입의 움직임 벡터를 가질 가능성이 높다. 그럼에도 불구하고, B 픽처에 속하는 현재 블록의 움직임 벡터는 본 발명에 따른 움직임 벡터 부호화 방법 및 복호화 방법에 의해, 이웃 블록들의 움직임 벡터들의 타입에 관계없이 부호화 및 복호화가 가능하다.The B picture does not necessarily have to be constrained to perform motion compensation with past and future pictures in time. 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, it is highly likely 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 types of motion vectors of neighboring blocks by the motion vector encoding method and the 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 the B picture has four types of motion compensation modes, there are four types of motion vectors. Forward motion vectors Forward MV (MVf), backward motion vectors Backward MV (MVb), bidirectional motion vectors Bi-predictive MV (MVf, MVb), direct motion vectors Direct MV. In the case of the direct motion vector, since the motion vector information is not transmitted to the receiver, it is not necessary to encode and decode. However, similar to the P picture, the remaining motion vectors are encoded or decoded using the prediction vector PMV obtained from the motion vectors of the neighboring blocks. .

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

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

도 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)이 된다.Referring back to FIG. 7, MVf_X = (1,2), MVf_A = (4,4), MVb_B = (-1, -1), MVf_C = (0,3), MVb_C = (-1, -2) In this case, according to the prior art, since MVb_B = (-1, -1) is different from the motion vector of the current block, it is excluded in obtaining an intermediate value and (0,0) is substituted instead. Therefore, the median value is (0, 3) and the difference value DMV_X is (1, -1). However, according to the present invention, instead of MVb_B = (-1, -1), the predicted (1, 1) is used to find the median. Therefore, the median value is (1,1) and the difference value DMV_X is (0,1).

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

도 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 is used as the prediction vector of the block ①, and the motion vector of the right upper block is used as the prediction vector of the block ②. do.

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

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

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

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

전술한 움직임 벡터 부호화 방법 및 복호화 방법은 컴퓨터 프로그램으로 작성 가능하다. 상기 프로그램을 구성하는 코드들 및 코드 세그먼트들은 당해 분야의 컴퓨터 프로그래머에 의하여 용이하게 추론될 수 있다. 또한, 상기 프로그램은 컴퓨터가 읽을 수 있는 정보저장매체(computer readable medium)에 저장되고, 컴퓨터에 의하여 읽혀지고 실행됨으로써 움직임 벡터 부호화 방법 및 복호화 방법을 구현한다. 상기 정보저장매체는 자기 기록매체, 광 기록매체, 및 캐리어 웨이브 매체를 포함한다.The motion vector encoding method and decoding method described above can be created by a computer program. Codes and code segments constituting the program can be easily inferred by a computer programmer in the art. In addition, the program is stored in a computer readable medium, and read and executed by a computer to implement a motion vector encoding 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 encoding apparatus according to a preferred embodiment of the present invention;

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

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

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

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

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

도 10은 예측 움직임 벡터를 구하는 방식의 다른 예,10 is 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)

움직임 벡터를 복호화하는 방법에 있어서,In the 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 the size and position of a current block included in a macroblock; And 상기 선택된 이웃 블록의 움직임 벡터를 상기 현재 블록의 예측 움직임 벡터로 선택하는 단계를 포함하며,Selecting the motion vector of the selected neighboring block as a predicted motion vector of the current block, 상기 현재 블록의 예측 움직임 벡터로 사용될 이웃 블록을 선택하는 단계는 상기 매크로 블록 내의 현재 블록의 크기가 16x8이고 상기 현재 블록이 매크로 블록 내의 상측 블록인 경우, 상기 현재 블록의 상측에 인접한 이웃 블록의 움직임 벡터를 상기 현재 블록의 예측 움직임 벡터로 선택하는 것을 특징으로 하는 움직임 벡터의 복호화 방법.The selecting of the neighboring block to be used as the prediction motion vector of the current block includes: when the size of the current block in the macro block is 16x8 and the current block is an upper block in the macro block, the motion of the neighboring block adjacent to the upper side of the current block; And a vector is selected as the predicted motion vector of the current block. 제 1항에 있어서,The method of claim 1, 상기 현재 블록의 원 움직임 벡터와 상기 예측 움직임 벡터 사이의 차이값을 복원하는 단계; 및Restoring a difference value between the original motion vector of the current block and the prediction motion vector; And 상기 복원된 차이값과 상기 예측 움직임 벡터를 더하는 단계를 포함하는 것을 특징으로 하는 움직임 벡터의 복호화 방법.Adding the reconstructed difference value and the predicted motion vector. 움직임 벡터의 복호화 장치에 있어서,In the motion vector decoding apparatus, 현재 블록의 원 움직임 벡터와 상기 현재 블록의 예측 움직임 벡터 사이의 차이값을 복호화하는 움직임 벡터 복호화부; 및A motion vector decoder for decoding a difference value between the original motion vector of the current block and the 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 a 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 configured to add the selected prediction motion vector and the decoded difference value. 상기 움직임 벡터 예측 보상부는 상기 매크로 블록 내의 현재 블록의 크기가 16x8이고 상기 현재 블록이 매크로 블록 내의 상측 블록인 경우, 상기 현재 블록의 상측에 인접한 이웃 블록의 움직임 벡터를 상기 현재 블록의 예측 움직임 벡터로 선택하는 것을 특징으로 하는 움직임 벡터의 복호화 장치. When the size of the current block in the macro block is 16x8 and the current block is an upper block in the macro block, the motion vector prediction compensator converts a motion vector of a neighboring block adjacent to the upper side of the current block as a predicted motion vector of the current block. And a motion vector decoding device.
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 true KR20070090124A (en) 2007-09-05
KR100774299B1 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)

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100229803B1 (en) * 1996-11-15 1999-11-15 전주범 Method and apparatus for detecting motion vectors
KR100364789B1 (en) * 2000-02-28 2002-12-16 엘지전자 주식회사 Method for estimating motion and apparatus for the same

Also Published As

Publication number Publication date
KR100774299B1 (en) 2007-11-08

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
JP4752631B2 (en) Image coding apparatus and image coding method
JP5580453B2 (en) Direct mode encoding and decoding apparatus
JP4724351B2 (en) Image encoding apparatus, image encoding method, image decoding apparatus, image decoding method, and communication apparatus
JP6100240B2 (en) Multi-view video motion vector encoding method and apparatus, and decoding method and apparatus thereof
KR101420957B1 (en) Image encoding device, image decoding device, image encoding method, and image decoding method
JP2004023458A (en) Moving picture encoding/decoding method and apparatus
CN103202014A (en) Method and apparatus of spatial motion vector prediction
JP3866624B2 (en) Moving picture encoding method, moving picture decoding method, moving picture encoding apparatus, and moving picture decoding apparatus
KR100510136B1 (en) Method for determining reference picture, moving compensation method thereof and apparatus thereof
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
EP2109319A1 (en) Moving image encoding-decoding system with macroblock-level adaptive frame/field processing
KR20070090122A (en) Method and apparatus for decoding motion vectors
WO2004071099A1 (en) Predictive encoding of motion vectors including a flag notifying the presence of coded residual motion vector data
KR20070090124A (en) Method and apparatus for decoding motion vectors
JP5442039B2 (en) Image encoding device, image decoding device, image encoding method, and image decoding method
KR20070090123A (en) Method and apparatus for decoding motion vectors
KR100774300B1 (en) Method and apparatus for decoding motion vectors
JP2006304350A (en) Moving picture decoding method and system
JP2007221202A (en) Moving picture encoder and moving picture encoding program
JP2003116141A (en) Moving picture prediction encoding method and its decoding method, and apparatus for the same
JP4061505B2 (en) Image coding apparatus and method

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