JP4169767B2 - Encoding method - Google Patents

Encoding method Download PDF

Info

Publication number
JP4169767B2
JP4169767B2 JP2006182516A JP2006182516A JP4169767B2 JP 4169767 B2 JP4169767 B2 JP 4169767B2 JP 2006182516 A JP2006182516 A JP 2006182516A JP 2006182516 A JP2006182516 A JP 2006182516A JP 4169767 B2 JP4169767 B2 JP 4169767B2
Authority
JP
Japan
Prior art keywords
motion
motion vector
encoding
frame
encoding target
Prior art date
Legal status (The legal status 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 status listed.)
Expired - Fee Related
Application number
JP2006182516A
Other languages
Japanese (ja)
Other versions
JP2007124614A (en
Inventor
義裕 松尾
剛 渡邉
英樹 山内
茂之 岡田
優 松田
治彦 村田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sanyo Electric Co Ltd
Original Assignee
Sanyo Electric Co Ltd
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 Sanyo Electric Co Ltd filed Critical Sanyo Electric Co Ltd
Priority to JP2006182516A priority Critical patent/JP4169767B2/en
Publication of JP2007124614A publication Critical patent/JP2007124614A/en
Application granted granted Critical
Publication of JP4169767B2 publication Critical patent/JP4169767B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、動画像を符号化する符号化方法に関する。   The present invention relates to an encoding method for encoding a moving image.

ブロードバンドネットワークが急速に発展しており、高品質な動画像を利用したサービスに期待が集まっている。また、DVDなど大容量の記録媒体が利用されており、高画質の画像を楽しむユーザ層が広がっている。動画像を通信回線で伝送したり、記録媒体に蓄積するために不可欠な技術として圧縮符号化がある。動画像圧縮符号化技術の国際標準として、MPEG4の規格やH.264/AVC規格がある。また、ひとつのストリームにおいて高画質のストリームと低画質のストリームを併せもつSVC(Scalable Video Coding)のような次世代画像圧縮技術がある。   Broadband networks are rapidly developing, and there are high expectations for services that use high-quality moving images. In addition, a large-capacity recording medium such as a DVD is used, and a user group who enjoys high-quality images is expanding. There is compression coding as an indispensable technique for transmitting moving images via a communication line or storing them in a recording medium. As an international standard for moving image compression coding technology, the MPEG4 standard and H.264 standard. There is a H.264 / AVC standard. In addition, there is a next-generation image compression technique such as SVC (Scalable Video Coding) in which one stream includes a high-quality stream and a low-quality stream.

高解像度の動画像をストリーム配信したり、記録媒体に蓄積する場合、通信帯域を圧迫しないように、あるいは、記憶容量が大きくならないように、動画ストリームの圧縮率を高める必要がある。動画像の圧縮効果を高めるために、動き補償フレーム間予測符号化が行われる。動き補償フレーム間予測符号化では、符号化対象フレームをブロックに分割し、既に符号化された参照フレームからの動きをブロック毎に予測して動きベクトルを検出し、差分画像とともに動きベクトル情報を符号化する。   When streaming a high-resolution moving image or storing it in a recording medium, it is necessary to increase the compression rate of the moving image stream so as not to compress the communication band or increase the storage capacity. In order to enhance the compression effect of moving images, motion compensation interframe predictive coding is performed. In motion-compensated interframe predictive coding, the encoding target frame is divided into blocks, the motion from a reference frame that has already been encoded is predicted for each block, a motion vector is detected, and motion vector information is encoded along with the difference image. Turn into.

特許文献1には、残差動きベクトルと残りフレーム数より予想される予測動きベクトルがフレーム間の動きベクトルの近傍に存在する場合、フレーム間の動きベクトルの近傍にある予測動きベクトルを動きベクトルとし、予測動きベクトルがフレーム間の動きベクトルの近傍に存在しないときは、フレーム間の動きベクトルを動きベクトルとする、動き補償予測符号化方式が記載されている。
特開平2−219391号公報
In Patent Document 1, when a predicted motion vector predicted from a residual motion vector and the number of remaining frames exists in the vicinity of a motion vector between frames, a predicted motion vector in the vicinity of a motion vector between frames is used as a motion vector. A motion-compensated predictive coding method is described in which when a motion vector predictor does not exist in the vicinity of a motion vector between frames, the motion vector between frames is used as a motion vector.
JP-A-2-219391

H.264/AVC規格では、動き補償において、よりきめ細かな予測を行うために、動き補償のブロックサイズを可変にしたり、動き補償の画素精度を1/4画素精度まで細かくすることができるようになっており、動きベクトルに関する符号量が多くなる。また、次世代画像圧縮技術であるSVCでは、時間的スケーラビリティを高めるために、MCTF(Motion Compensated Temporal Filtering、動き補償時間方向フィルタ)技術が検討されている。これは、時間軸方向のサブバンド分割に動き補償を組み合わせたものであり、階層的な動き補償を行うため、動きベクトルの情報が非常に多くなる。このように最近の動画圧縮符号化技術では、動きベクトルに関する情報量が増えることにより動画ストリーム全体のデータ量が増大する傾向にあり、動きベクトル情報に起因する符号量を削減する技術が一層求められている。   H. In the H.264 / AVC standard, in order to perform more detailed prediction in motion compensation, the block size of motion compensation can be made variable, and the pixel accuracy of motion compensation can be reduced to ¼ pixel accuracy. Therefore, the amount of code related to the motion vector increases. In SVC, which is a next-generation image compression technology, MCTF (Motion Compensated Temporal Filtering) technology is being studied in order to improve temporal scalability. This is a combination of subband division in the time axis direction and motion compensation. Since hierarchical motion compensation is performed, information on motion vectors becomes very large. As described above, the recent video compression coding technology tends to increase the data amount of the entire video stream due to an increase in the amount of information related to motion vectors, and there is a further demand for a technology for reducing the amount of codes resulting from motion vector information. ing.

本発明はこうした状況に鑑みてなされたもので、その目的は、符号化効率が高い動画像の符号化技術を提供することにある。   The present invention has been made in view of such circumstances, and an object of the present invention is to provide a moving picture coding technique with high coding efficiency.

本発明のある態様は、動画像のピクチャを符号化する方法である。この方法は、複数の符号化対象ピクチャ間における各ブロックの運動状態を推定し、推定した運動状態を表す運動モードの情報を動画像の符号化データに含めることを特徴とする。   One embodiment of the present invention is a method for encoding a moving picture. This method is characterized in that the motion state of each block between a plurality of encoding target pictures is estimated, and motion mode information representing the estimated motion state is included in the encoded data of the moving image.

「ピクチャ」は符号化の単位であり、その概念にはフレーム、フィールド、VOP(Video Object Plane)などを含む。また、符号化対象ピクチャ内の「ブロック」は、マクロブロックやオブジェクトなど一定の範囲に含まれる複数の画素からなり、動き補償予測時のマッチング対象となりうるものをいう。   “Picture” is a unit of encoding, and its concept includes a frame, a field, a VOP (Video Object Plane), and the like. In addition, a “block” in a picture to be encoded is a block that includes a plurality of pixels included in a certain range, such as a macroblock and an object, and can be a matching target in motion compensation prediction.

この態様によると、符号化対象ピクチャ内のブロックの運動状態を推定した運動モードを符号化データに含めるので、運動モードを利用した符号化または復号を実現することができる。   According to this aspect, since the motion mode in which the motion state of the block in the encoding target picture is estimated is included in the encoded data, encoding or decoding using the motion mode can be realized.

第1の参照ピクチャを基準とした第2の参照ピクチャ内のブロックの動きベクトルである参照動きベクトルが求められている場合に、符号化対象ピクチャ内のブロックに対して、第1の参照ピクチャを基準とした動きベクトルである符号化対象動きベクトルを求め、複数の符号化対象ピクチャについて、符号化対象動きベクトルの成分と参照動きベクトルの成分との比率を求め、この比率を参照して各ブロックの運動状態を推定してもよい。これによると、第2の参照ピクチャの動きベクトルを利用して、符号化対象ピクチャの動きベクトルを表現するとともにブロックの運動状態を推定するようにした。したがって、符号化対象動きベクトルそのものを符号化する必要がなくなるため、動きベクトルデータ全体の符号量が削減でき、動画像の符号化効率を向上させることができる。   When a reference motion vector, which is a motion vector of a block in the second reference picture based on the first reference picture, is obtained, the first reference picture is assigned to the block in the current picture. Determine the encoding target motion vector that is the reference motion vector, determine the ratio of the encoding target motion vector component and the reference motion vector component for multiple encoding target pictures, and refer to this ratio for each block. May be estimated. According to this, using the motion vector of the second reference picture, the motion vector of the picture to be encoded is expressed and the motion state of the block is estimated. Therefore, since it is not necessary to encode the motion vector itself to be encoded, the code amount of the entire motion vector data can be reduced, and the encoding efficiency of moving images can be improved.

なお、「第1の参照ピクチャ」は、一例では実施の形態における「前方参照フレーム」であり、「第2の参照ピクチャ」は、一例では実施の形態における「後方参照フレーム」であるが、第1の参照ピクチャが後方参照フレーム、第2の参照ピクチャが前方参照フレームであってもよい。また、「符号化対象ピクチャ」は一例では実施の形態におけるBフレームである。   The “first reference picture” is, for example, the “forward reference frame” in the embodiment, and the “second reference picture” is the “back reference frame” in the embodiment. One reference picture may be a backward reference frame and the second reference picture may be a forward reference frame. In addition, the “encoding target picture” is, for example, a B frame in the embodiment.

第2の参照ピクチャ内のブロックとのマッチングによって、複数の符号化対象ピクチャ内で動き補償予測の対象となるブロックをそれぞれ特定し、特定されたブロックについて符号化対象動きベクトルを求めるようにしてもよい。   A block that is a target of motion compensation prediction in each of a plurality of encoding target pictures is identified by matching with a block in the second reference picture, and an encoding target motion vector is obtained for the identified block. Good.

隣接する符号化対象ピクチャで求められた比率の差分を取ることによって、ブロックの運動状態を推定してもよい。これによって、簡単な手法でブロックの運動状態を推定することができる。   The motion state of a block may be estimated by taking a difference in ratios obtained between adjacent encoding target pictures. Thereby, the motion state of the block can be estimated by a simple method.

運動モードにしたがって参照動きベクトルから符号化対象動きベクトルを求めるための係数を求め、該係数の情報を動画像の符号化データに含めてもよい。   A coefficient for obtaining an encoding target motion vector from a reference motion vector according to the motion mode may be obtained, and information on the coefficient may be included in the encoded data of the moving image.

運動モードには、符号化対象ピクチャ間でブロックが等速度運動すると推定される等速度運動モードが含まれ、係数は、第1の参照ピクチャと符号化対象ピクチャ間の時間間隔に基づいて決定されてもよい。これによって、係数を符号化する必要がなくなるため、動きベクトルデータ全体の符号量が削減でき、動画像の符号化効率を向上させることができる。   The motion mode includes a constant velocity motion mode in which the block is estimated to move at a constant velocity between the encoding target pictures, and the coefficient is determined based on a time interval between the first reference picture and the encoding target picture. May be. This eliminates the need to encode the coefficients, thereby reducing the code amount of the entire motion vector data and improving the encoding efficiency of moving images.

運動モードには、符号化対象ピクチャ間でブロックが等加速度運動すると推定される等加速度運動モードが含まれ、係数は、第1の参照ピクチャと符号化対象ピクチャ間の時間間隔に基づいて決定されてもよい。この場合も、係数を符号化する必要がなくなり、動きベクトルデータ全体の符号量が削減でき、動画像の符号化効率を向上させることができる。   The motion mode includes a uniform acceleration motion mode in which the block is estimated to perform a uniform acceleration motion between the encoding target pictures, and the coefficient is determined based on a time interval between the first reference picture and the encoding target picture. May be. Also in this case, it is not necessary to encode the coefficients, the code amount of the entire motion vector data can be reduced, and the encoding efficiency of the moving image can be improved.

係数を符号化する際、予め可変長符号が割り当てられている複数の定数のうち係数に最も近い定数を選択し、選択された定数に割り当てられている符号を動画像の符号化データに含めてもよい。これによって、係数そのものを符号化する必要がなく、予め割り当てられている符号のみを動画像の符号化データに含めればよいので、符号化データの符号量を抑えることができる。   When coding a coefficient, a constant closest to the coefficient is selected from a plurality of constants to which a variable length code is assigned in advance, and the code assigned to the selected constant is included in the encoded data of the moving image Also good. Accordingly, it is not necessary to encode the coefficient itself, and only a pre-assigned code needs to be included in the encoded data of the moving image, so that the code amount of the encoded data can be suppressed.

符号化対象動きベクトルと、参照動きベクトルに係数を乗じて得られるベクトルとの誤差を表す調整ベクトルを求め、該調整ベクトルの情報を動画像の符号化データに含めてもよい。これによって、上述の定数で係数を近似した場合であっても、調整ベクトルを各マクロブロックについて計算しておけば、誤差は調整ベクトルで吸収されるため、動き補償予測の精度が低下しなくなる。調整ベクトルを符号化する際、その出現頻度に応じた可変長符号を付与してもよい。   An adjustment vector representing an error between the encoding target motion vector and a vector obtained by multiplying the reference motion vector by a coefficient may be obtained, and information on the adjustment vector may be included in the encoded data of the moving image. As a result, even when the coefficients are approximated with the above-described constants, if the adjustment vector is calculated for each macroblock, the error is absorbed by the adjustment vector, so that the accuracy of motion compensation prediction does not decrease. When encoding the adjustment vector, a variable length code corresponding to the appearance frequency may be given.

また、運動モードの情報は複数のピクチャに対してひとつ符号化され、係数と調整ベクトルの情報は符号化対象動きベクトル毎に符号化されてもよい。   Also, motion mode information may be encoded for a plurality of pictures, and coefficient and adjustment vector information may be encoded for each motion vector to be encoded.

なお、以上の構成要素の任意の組み合わせ、本発明の表現を方法、装置、システム、記録媒体、コンピュータプログラムなどの間で変換したものもまた、本発明の態様として有効である。   It should be noted that any combination of the above-described constituent elements and a conversion of the expression of the present invention between a method, an apparatus, a system, a recording medium, a computer program, and the like are also effective as an aspect of the present invention.

本発明によれば、動きベクトルデータの符号量を削減することができる。   According to the present invention, the amount of code of motion vector data can be reduced.

図1は、実施の形態に係る符号化装置100の構成図である。これらの構成は、ハードウェア的には、任意のコンピュータのCPU、メモリ、その他のLSIで実現でき、ソフトウェア的にはメモリにロードされた画像符号化機能のあるプログラムなどによって実現されるが、ここではそれらの連携によって実現される機能ブロックを描いている。したがって、これらの機能ブロックがハードウェアのみ、ソフトウェアのみ、またはそれらの組み合わせによっていろいろな形で実現できることは、当業者には理解されるところである。   FIG. 1 is a configuration diagram of an encoding apparatus 100 according to an embodiment. These configurations can be realized in hardware by a CPU, memory, or other LSI of an arbitrary computer, and in terms of software, it is realized by a program having an image encoding function loaded in the memory. So, functional blocks that are realized by their cooperation are drawn. Therefore, those skilled in the art will understand that these functional blocks can be realized in various forms by hardware only, software only, or a combination thereof.

本実施の形態の符号化装置100は、国際標準化機関であるISO(International Organization for Standardization)/IEC(International Electrotechnical Commission)によって標準化されたMPEG(Moving Picture Experts Group)シリーズの規格(MPEG−1、MPEG−2およびMPEG−4)、電気通信に関する国際標準機関であるITU−T(International Telecommunication Union-Telecommunication Standardization Sector)によって標準化されたH.26xシリーズの規格(H.261、H.262およびH.263)、もしくは両方の標準化機関によって合同で標準化された最新の動画像圧縮符号化標準規格であるH.264/AVC(両機関における正式勧告名はそれぞれMPEG-4 Part 10: Advanced Video CodingとH.264)に準拠して動画像の符号化を行う。   The coding apparatus 100 according to the present embodiment is a moving picture experts group (MPEG-1) series standard (MPEG-1, MPEG) standardized by ISO (International Organization for Standardization) / IEC (International Electrotechnical Commission). -2 and MPEG-4), standardized by ITU-T (International Telecommunication Union-Telecommunication Standardization Sector), which is an international standard organization for telecommunications. 26x series standards (H.261, H.262 and H.263), or H.264, the latest video compression coding standard standardized jointly by both standards organizations. H.264 / AVC (official recommendation names in both organizations are MPEG-4 Part 10: Advanced Video Coding and H.264 respectively).

MPEGシリーズの規格では、フレーム内符号化を行う画像フレームをI(Intra)フレーム、過去のフレームを参照画像として順方向のフレーム間予測符号化を行う画像フレームをP(Predictive)フレーム、過去と未来のフレームを参照画像として双方向のフレーム間予測符号化を行う画像フレームをBフレームという。   In the MPEG series standard, an image frame for intra-frame encoding is an I (Intra) frame, an image frame for forward inter-frame predictive encoding with a past frame as a reference image, a P (Predictive) frame, and past and future An image frame that performs bidirectional inter-frame predictive coding using this frame as a reference image is referred to as a B frame.

一方、H.264/AVCでは、参照画像として利用できるフレームは、時間の先後を問わず、過去の二枚のフレームを参照画像としてもよく、未来の二枚のフレームを参照画像としてもよい。また、参照画像として利用できるフレームの枚数も問わず、3枚以上のフレームを参照画像として用いることもできる。したがって、MPEG−1/2/4では、Bフレームは双方向予測(Bi-directional prediction)フレームのことを指していたが、H.264/AVCでは、Bフレームは、参照画像の時間の先後は問わないため、双予測(Bi-predictive prediction)フレームのことを指すことに留意する。   On the other hand, H. In H.264 / AVC, a frame that can be used as a reference image may be a past two frames as a reference image or a future two frames as a reference image regardless of the time. Further, three or more frames can be used as the reference image regardless of the number of frames that can be used as the reference image. Therefore, in MPEG-1 / 2/4, the B frame refers to a Bi-directional prediction frame. Note that in H.264 / AVC, the B frame refers to a bi-predictive prediction frame because the time of the reference image does not matter before and after.

なお、本願明細書では、フレームとピクチャを同じ意味で用いており、Iフレーム、Pフレーム、Bフレームは、それぞれIピクチャ、Pピクチャ、Bピクチャとも呼ばれている。
また、本願明細書では、符号化の単位としてフレームを例に挙げて説明するが、符号化の単位はフィールドであってもよい。また、符号化の単位はMPEG−4におけるVOPであってもよい。
In the specification of the present application, a frame and a picture are used in the same meaning, and an I frame, a P frame, and a B frame are also called an I picture, a P picture, and a B picture, respectively.
In this specification, a frame is used as an example of the encoding unit. However, the encoding unit may be a field. The unit of encoding may be a VOP in MPEG-4.

符号化装置100は、フレーム単位で動画像の入力を受け取り、動画像を符号化し、符号化ストリームを出力する。   The encoding apparatus 100 receives an input of a moving image in units of frames, encodes the moving image, and outputs an encoded stream.

ブロック生成部10は、入力された画像フレームをマクロブロックに分割する。画像フレームの左上から右下方向の順にマクロブロックが形成される。ブロック生成部10は生成したマクロブロックを差分器12と動き補償部60に供給する。   The block generation unit 10 divides the input image frame into macro blocks. Macroblocks are formed in order from the upper left to the lower right of the image frame. The block generation unit 10 supplies the generated macroblock to the differentiator 12 and the motion compensation unit 60.

差分器12は、ブロック生成部10から供給される画像フレームがIフレームであれば、そのままDCT部20に出力するが、PフレームまたはBフレームであれば、動き補償部60から供給される予測画像との差分を計算してDCT部20に供給する。   If the image frame supplied from the block generation unit 10 is an I frame, the differentiator 12 outputs it to the DCT unit 20 as it is, but if it is a P frame or a B frame, the difference image 12 is supplied from the motion compensation unit 60. Is calculated and supplied to the DCT unit 20.

動き補償部60は、フレームメモリ80に格納されている過去または未来の画像フレームを参照画像として利用し、ブロック生成部10から入力されたPフレームまたはBフレームの各マクロブロックについて、誤差の最も小さい予測領域を参照画像から探索し、マクロブロックから予測領域へのずれを示す動きベクトルを求める。動き補償部60は、動きベクトルを用いてマクロブロック毎に動き補償を行い、予測画像を生成する。動き補償部60は、生成した動きベクトルを可変長符号化部90に供給し、予測画像を差分器12と加算器14に供給する。   The motion compensation unit 60 uses a past or future image frame stored in the frame memory 80 as a reference image, and has the smallest error for each macroblock of the P frame or the B frame input from the block generation unit 10. A prediction area is searched from the reference image, and a motion vector indicating a deviation from the macroblock to the prediction area is obtained. The motion compensation unit 60 performs motion compensation for each macroblock using the motion vector, and generates a predicted image. The motion compensation unit 60 supplies the generated motion vector to the variable length encoding unit 90 and supplies the predicted image to the differentiator 12 and the adder 14.

動き補償部60では、双方向予測と片方向予測のいずれも適用可能である。動き補償部60は、片方向予測では、前方参照フレームに対する動きを示す順方向動きベクトルを生成する。双方向予測では、順方向動きベクトルに加えて、後方参照フレームに対する動きを示す逆方向動きベクトルの2つの動きベクトルを生成する。   The motion compensation unit 60 can apply both bidirectional prediction and unidirectional prediction. In the unidirectional prediction, the motion compensation unit 60 generates a forward motion vector indicating the motion with respect to the forward reference frame. In the bi-directional prediction, in addition to the forward motion vector, two motion vectors of a backward motion vector indicating motion with respect to the backward reference frame are generated.

差分器12は、ブロック生成部10から出力される現在の画像(つまり、符号化対象の画像)と、動き補償部60から出力される予測画像との差分を求め、DCT部20に出力する。DCT部20は、差分器12から与えられた差分画像を離散コサイン変換(DCT)し、DCT係数を量子化部30に与える。   The differentiator 12 obtains a difference between the current image output from the block generation unit 10 (that is, the image to be encoded) and the predicted image output from the motion compensation unit 60 and outputs the difference to the DCT unit 20. The DCT unit 20 performs a discrete cosine transform (DCT) on the difference image given from the differentiator 12 and gives a DCT coefficient to the quantization unit 30.

量子化部30は、DCT係数を量子化し、可変長符号化部90に与える。可変長符号化部90は、動き補償部60から与えられた動きベクトルとともに差分画像の量子化されたDCT係数を可変長符号化し、符号化ストリームを生成する。可変長符号化部90は、符号化ストリームを生成する際、符号化されたフレームを時間順序に並べ替える処理を行う。   The quantization unit 30 quantizes the DCT coefficient and provides it to the variable length coding unit 90. The variable length coding unit 90 performs variable length coding on the quantized DCT coefficient of the difference image together with the motion vector supplied from the motion compensation unit 60, and generates an encoded stream. The variable length encoding unit 90 performs processing of rearranging the encoded frames in time order when generating the encoded stream.

量子化部30は、画像フレームの量子化されたDCT係数を逆量子化部40に供給する。逆量子化部40は、与えられた量子化データを逆量子化し、逆DCT部50に与え、逆DCT部50は、与えられた逆量子化データを逆離散コサイン変換する。これにより、符号化された画像フレームが復元される。復元された画像フレームは加算器14に入力される。   The quantization unit 30 supplies the quantized DCT coefficient of the image frame to the inverse quantization unit 40. The inverse quantization unit 40 inversely quantizes the supplied quantized data and supplies the quantized data to the inverse DCT unit 50. The inverse DCT unit 50 performs inverse discrete cosine transform on the supplied inverse quantized data. Thereby, the encoded image frame is restored. The restored image frame is input to the adder 14.

加算器14は、逆DCT部50から供給される画像フレームがIフレームであれば、そのままフレームメモリ80に格納する。加算器14は、逆DCT部50から供給される画像フレームがPフレームまたはBフレームであれば、それは差分画像であるため、逆DCT部50から供給された差分画像と動き補償部60から供給される予測画像とを加算することにより、元の画像フレームを再構成し、フレームメモリ80に格納する。   If the image frame supplied from the inverse DCT unit 50 is an I frame, the adder 14 stores it in the frame memory 80 as it is. If the image frame supplied from the inverse DCT unit 50 is a P frame or a B frame, the adder 14 is a difference image, and thus is supplied from the difference image supplied from the inverse DCT unit 50 and the motion compensation unit 60. By adding the predicted image, the original image frame is reconstructed and stored in the frame memory 80.

PフレームもしくはBフレームの符号化処理の場合は、上述のように動き補償部60が動作するが、Iフレームの符号化処理の場合は、動き補償部60は動作せず、ここでは図示しないが、Iフレームはフレーム内予測が行われた後、DCT部20に供給される。   In the case of P frame or B frame encoding processing, the motion compensation unit 60 operates as described above. However, in the case of I frame encoding processing, the motion compensation unit 60 does not operate and is not shown here. The I frame is supplied to the DCT unit 20 after intra prediction.

次に、従来の動きベクトルの計算方法について説明し、その後、本発明の一実施形態による動きベクトルの計算方法について説明する。   Next, a conventional motion vector calculation method will be described, and then a motion vector calculation method according to an embodiment of the present invention will be described.

図2は、従来の動きベクトルの計算を説明する図である。同図は、左から右を時間の流れとして5枚のフレームを表示時間順に示しており、Iフレーム201、Bフレーム202、Bフレーム203、Bフレーム204、Pフレーム205の順に表示がなされる。符号化の順序はこの表示順序とは異なり、まず同図のIフレーム201が符号化され、次に5番目のPフレーム205がIフレーム201を参照画像として動き補償が行われて符号化される。その後、Bフレーム203が符号化され、Bフレーム202、Bフレーム204の順に動き補償が行われて符号化される。 FIG. 2 is a diagram for explaining calculation of a conventional motion vector. The figure shows five frames in order of display time, with the flow from left to right as the time flow. The display is in the order of I frame 201, B 1 frame 202, B 2 frame 203, B 3 frame 204, and P frame 205. Made. The encoding order is different from the display order. First, the I frame 201 in the figure is encoded, and then the fifth P frame 205 is encoded with motion compensation using the I frame 201 as a reference image. . Thereafter, the B 2 frame 203 is encoded, and the motion compensation is performed in the order of the B 1 frame 202 and the B 3 frame 204 and encoded.

Pフレームを符号化する際の参照フレームは、時間的に前のIフレームまたはPフレームを用いる。また、Bフレームを符号化する際の参照フレームは、前のIフレーム、または時間的に前後のPフレームを用いる。Pフレームの動き補償予測の場合、予測単位は例えば16×16のマクロブロックでありひとつの動きベクトルを利用する。また、Bフレームは、順方向、逆方向、双方向の予測のうち最適なものを選択して動き補償が行われる。なお、Iフレーム201はPフレームであってもよい。また、Pフレーム205はIフレームであってもよい。   As a reference frame for encoding a P frame, a temporally previous I frame or P frame is used. In addition, as the reference frame for encoding the B frame, the previous I frame or the temporally preceding and following P frames are used. In the case of P frame motion compensation prediction, the prediction unit is, for example, a 16 × 16 macroblock, and one motion vector is used. For the B frame, motion compensation is performed by selecting an optimal prediction from forward, backward and bidirectional predictions. The I frame 201 may be a P frame. The P frame 205 may be an I frame.

現時点で、Iフレーム201、Pフレーム205の符号化が完了し、B〜Bフレーム202〜204を符号化する段階であるとする。このB〜Bフレーム202〜204を「符号化対象フレーム」と呼び、符号化対象フレームより前に表示されるIフレーム201を「前方参照フレーム」と、符号化対象フレームより後に表示されるPフレーム205を「後方参照フレーム」と呼ぶことにする。また、Pフレーム205の動きベクトルを「MV」、B〜Bフレームの動きベクトルを「MVB1〜MVB3」と表記する。
なお、図2では、二次元画像を一次元的に示しているが、実際の動きベクトルは画像の水平方向と垂直方向の二次元成分を持つことに注意する。
At this time, it is assumed that the encoding of the I frame 201 and the P frame 205 is completed and the B 1 to B 3 frames 202 to 204 are encoded. The B 1 to B 3 frames 202 to 204 are called “encoding target frames”, and the I frame 201 displayed before the encoding target frame is displayed as “forward reference frame” and after the encoding target frame. The P frame 205 is referred to as a “backward reference frame”. Also, the motion vector of the P frame 205 is expressed as “MV P ”, and the motion vector of the B 1 to B 3 frames is expressed as “MV B1 to MV B3 ”.
In FIG. 2, the two-dimensional image is shown one-dimensionally, but it should be noted that the actual motion vector has two-dimensional components in the horizontal and vertical directions of the image.

図2に示すように、Pフレーム205内のマクロブロック215について、前方参照フレーム201のマクロブロック211を指し示す動きベクトルMV225を求める。次に、符号化対象フレーム203内のマクロブロック213について、前方参照フレーム201または後方参照フレーム205のいずれかのマクロブロックを指し示す動きベクトルMVB2222を求める。図2では、前方参照フレーム201を指した場合を示す。続いて、符号化対象フレーム202内のマクロブロック212について、前方参照フレーム201または後方参照フレーム205のいずれかのマクロブロックを指し示す動きベクトルMVB1221を求める。 As shown in FIG. 2, a motion vector MV P 225 indicating the macro block 211 of the forward reference frame 201 is obtained for the macro block 215 in the P frame 205. Next, for the macroblock 213 in the encoding target frame 203, a motion vector MV B2 222 indicating either the forward reference frame 201 or the backward reference frame 205 is obtained. FIG. 2 shows a case where the forward reference frame 201 is pointed. Subsequently, a motion vector MV B1 221 indicating the macro block of either the forward reference frame 201 or the backward reference frame 205 is obtained for the macro block 212 in the encoding target frame 202.

本実施の形態では、上記のようにして求められた符号化対象フレーム内の各マクロブロックの動きベクトル(以下、「符号化対象動きベクトル」という)をそのまま符号化する代わりに、後方参照フレームまたは前方参照フレームの動きベクトル(以下、「参照動きベクトル」という)に係数を乗じて符号化対象動きベクトルを表現し、参照動きベクトルと係数を符号化するようにした。これによって、動きベクトルデータの符号量を削減することができる。   In the present embodiment, instead of encoding the motion vector of each macroblock in the encoding target frame obtained as described above (hereinafter referred to as “encoding target motion vector”) as it is, a backward reference frame or The motion vector of the forward reference frame (hereinafter referred to as “reference motion vector”) is multiplied by a coefficient to represent the encoding target motion vector, and the reference motion vector and the coefficient are encoded. Thereby, the code amount of motion vector data can be reduced.

以下では、既に動きベクトルが検出されている後方参照フレーム205の動きベクトルMVを利用した場合について説明するが、前方参照フレーム201の動きベクトルや他の動きベクトルを使用してもよい。 In the following, already a case is explained using the motion vector MV P of the backward reference frame 205 the motion vector is detected, may be used motion vectors and other motion vectors of the forward reference frame 201.

図3は、本実施の形態に係る動き補償部60の構成を説明する図である。
動き補償部60は、後方参照フレーム205の動き補償を行ったときに、後方参照フレーム205の各マクロブロックの動きベクトルMVを検出しており、既に検出した後方参照フレーム205の動きベクトル情報を動きベクトル保持部62に保持する。
FIG. 3 is a diagram illustrating the configuration of the motion compensation unit 60 according to the present embodiment.
Motion compensation unit 60, when performing motion compensation of the backward reference frame 205, and detects a motion vector MV P of each macro block of the backward reference frame 205, already detected motion vector information of the backward reference frame 205 It is held in the motion vector holding unit 62.

ブロックマッチング部61は、後方参照フレーム205内のマクロブロックとのブロックマッチングによって、符号化対象フレーム202〜204内で動き補償予測の対象となるマクロブロックを特定する。   The block matching unit 61 identifies a macroblock that is a target of motion compensation prediction in the encoding target frames 202 to 204 by block matching with the macroblock in the backward reference frame 205.

符号化対象フレーム内で動き補償予測の対象となるマクロブロックを特定するには、以下の手順で行う。まず、通常のブロックマッチングなどの手法により、符号化対象フレームのマクロブロックの動きベクトル(以下、この項において「通常動きベクトル」という)を求める。続いて、符号化対象フレーム上でこの通常動きベクトルが指している位置を含む一定の範囲を定める。そして、定めた範囲内を通過する、後方参照フレームの動きベクトルを抽出する。複数の動きベクトルが抽出された場合には、先に求めた通常動きベクトルが指している位置に最も近い位置を通過する動きベクトルを選択する。このようにして抽出または選択された動きベクトルが、符号化対象フレームのマクロブロックが参照すべき参照動きベクトルMVと考えることができる。 The following procedure is used to identify a macroblock that is subject to motion compensation prediction within the encoding target frame. First, a motion vector of a macroblock of an encoding target frame (hereinafter referred to as “normal motion vector” in this section) is obtained by a method such as normal block matching. Subsequently, a certain range including the position pointed to by the normal motion vector on the encoding target frame is determined. Then, the motion vector of the backward reference frame that passes through the determined range is extracted. When a plurality of motion vectors are extracted, a motion vector that passes through a position closest to the position pointed to by the previously obtained normal motion vector is selected. Thus the motion vector extracted or selected and can be considered as reference motion vector MV P macroblock coding target frame is to be referred.

動きベクトル計算部63は、符号化対象フレーム202〜204内の各マクロブロックについて、前方参照フレーム201のマクロブロックを指し示す動きベクトルMVB1〜MVB3を求める。 The motion vector calculation unit 63 obtains motion vectors MV B1 to MV B3 indicating the macro blocks of the forward reference frame 201 for each macro block in the encoding target frames 202 to 204.

比率計算部64は、参照動きベクトルの情報を動きベクトル保持部62から参照して、符号化対象フレーム202〜204について、参照動きベクトルMVの各成分と符号化対象動きベクトルMVB1〜MVB3の各成分との比を求める。Bフレーム202、Bフレーム203、Bフレーム204についての比率をc、c、cと表すと、次式のようになる。
=[MVB1]/[MV]
=[MVB2]/[MV]
=[MVB3]/[MV]
ここで、[MVB1]〜[MVB3]、[MV]は、それぞれの動きベクトルの水平方向成分、または垂直方向の成分を表す。ここでは、簡単のためにひとつの方向の成分について述べているが、実際には全ての成分について計算する。
Ratio calculation unit 64 refers to the information of the reference motion vector from the motion vector holding unit 62, the coding target frame 202 to 204, the reference motion vector MV components P and coded motion vector MV B1 to MV B3 The ratio with each component of is obtained. When the ratios for the B 1 frame 202, the B 2 frame 203, and the B 3 frame 204 are expressed as c 1 , c 2 , and c 3 , the following equation is obtained.
c 1 = [MV B1 ] / [MV P ]
c 2 = [MV B2 ] / [MV P ]
c 3 = [MV B3 ] / [MV P ]
Here, [MV B1 ] to [MV B3 ], [MV P ] represent horizontal components or vertical components of the respective motion vectors. Here, for the sake of simplicity, a component in one direction is described, but in practice, all components are calculated.

運動解析部65は、各マクロブロックについて比率計算部64で計算された比率c〜cを参照して、当該マクロブロックの運動状態を推定する。具体的には、まず、隣接する符号化対象フレーム間の各マクロブロックについて、比率の差分を取る。符号化対象フレームが3フレームであれば、(c−c)、(c−c)を計算する。そして、これら差分値の関係を検討する。 The motion analysis unit 65 refers to the ratios c 1 to c 3 calculated by the ratio calculation unit 64 for each macro block, and estimates the motion state of the macro block. Specifically, first, a difference in ratio is taken for each macroblock between adjacent encoding target frames. If the encoding target frame is 3 frames, (c 2 -c 1 ) and (c 3 -c 2 ) are calculated. Then, the relationship between these difference values is examined.

差分値が0の場合は、動きベクトルが符号化対象フレーム内で変化していないことを表すから、このマクロブロックは停止していると推定される。差分値が0でなく略等しい値であれば、マクロブロックは等速度運動していると推定される。差分値が一律に増加または減少していく関係にあれば、マクロブロックは等加速度運動していると判断される。差分値が上記いずれの関係でもない場合は、マクロブロックは不規則な運動をしていると推定される。   When the difference value is 0, it indicates that the motion vector has not changed in the encoding target frame, and therefore this macroblock is estimated to be stopped. If the difference value is not 0 but is approximately equal, it is estimated that the macroblock is moving at a constant velocity. If the difference values are uniformly increased or decreased, it is determined that the macroblock is moving at a constant acceleration. If the difference value is not in any of the above relations, it is estimated that the macroblock is moving irregularly.

運動モード選択部66は、上記推定に応じて運動モードを選択する。運動モードには、符号化対象フレーム間でマクロブロックが等速度運動すると推定する等速度運動モードと、符号化対象フレーム間でマクロブロックが等加速度運動すると推定する等加速度運動モードを含むことが好ましい。さらに、運動モード選択部66は、選択した運動モードにしたがって、参照動きベクトルMVから符号化対象動きベクトルMVB1〜MVB3を求めるための係数α〜αを計算する。この係数α〜αは、前方参照フレームと符号化対象フレームとの間の時間間隔に基づいて決定される。これについては、図4ないし図6を参照して後述する。 The exercise mode selection unit 66 selects an exercise mode according to the estimation. Preferably, the motion modes include a constant velocity motion mode in which it is estimated that the macroblock moves at a constant velocity between the encoding target frames, and a constant acceleration motion mode in which it is estimated that the macroblock moves at a constant acceleration between the encoding target frames. . Furthermore, motion mode selection unit 66, according to the selected exercise mode, to calculate the coefficients alpha 1 to? 3 for obtaining the coding target motion vector MV B1 to MV B3 from the reference motion vector MV P. The coefficients α 1 to α 3 are determined based on the time interval between the forward reference frame and the encoding target frame. This will be described later with reference to FIGS.

誤差計算部67は、参照動きベクトルMVに運動モード選択部66で計算された係数を乗じて求めた動きベクトルα・MV〜α・MVと、符号化対象動きベクトルMVB1〜MVB3との誤差を表す調整ベクトルβ〜βを計算する。調整ベクトルβの計算方法については後述する。 Error calculating unit 67, a reference motion vector MV motion vector obtained by multiplying the calculated coefficients in the motion mode selection unit 66 to P α 1 · MV P ~α 3 · MV P, coded motion vector MV B1 ~ The adjustment vectors β 1 to β 3 representing the error from the MV B3 are calculated. A method for calculating the adjustment vector β will be described later.

動き補償予測部68は、係数αと調整ベクトルβにより表される各マクロブロックの動きベクトル(α・MV+β)を使用して動き補償を行い、予測画像を生成し、差分器12、加算器14に出力する。 The motion compensation prediction unit 68 performs motion compensation using the motion vector (α · MV P + β) of each macroblock represented by the coefficient α and the adjustment vector β, generates a prediction image, and the differencer 12 adds To the device 14.

可変長符号化部90は、運動モード選択部66で選択された運動モードを表す情報、および各マクロブロックの係数α、調整ベクトルβを符号化して、符号化ストリームに含める。   The variable length encoding unit 90 encodes information representing the motion mode selected by the motion mode selection unit 66, the coefficient α of each macroblock, and the adjustment vector β, and includes them in the encoded stream.

次に、図4ないし図6を参照して、運動モード選択部66により係数αを求める方法について説明する。なお、図4ないし図6は、従来の動きベクトルについて説明した図2と同じ符号を用いており、図2と共通する説明は省略する。   Next, a method for obtaining the coefficient α by the motion mode selection unit 66 will be described with reference to FIGS. 4 to 6 use the same reference numerals as those in FIG. 2 for the conventional motion vector, and a description common to FIG. 2 is omitted.

図4(a)、(b)は、マクロブロックが等速度運動している場合を示す。運動モード選択部66により等速度運動と推定されたとき、後方参照フレーム205の参照動きベクトルMVを、フレーム間の時間間隔に比例して配分することによって、符号化対象フレーム202〜204の係数α〜αを求めることができる。後方参照フレーム205の参照マクロブロック215の動きベクトルMVは、後方参照フレーム205と前方参照フレーム201との時間差tの間に、参照マクロブロック215が動く量と方向を示すものであるから、マクロブロックが等速度運動していると推定された場合、符号化対象フレーム202〜204において、各符号化対象フレームと前方参照フレーム201の時間差trの間に、MV×(tr/t)の動きを示すことが予測される。したがって、図4(a)に示すように、符号化対象フレームが3枚の場合には、Bフレーム202ではα=0.25、Bフレーム203ではα=0.5、Bフレーム204ではα=0.75と計算される。 4A and 4B show a case where the macroblock is moving at a constant speed. When estimated as moving at constant velocity by the kinetic mode selection unit 66, the reference motion vector MV P of the backward reference frame 205, by allocating in proportion to the time interval between frames, the coefficient of the coding target frame 202 to 204 α 1 to α 3 can be obtained. Motion vector MV P of the reference macro block 215 of the backward reference frame 205, between the time difference t between the backward reference frame 205 and the forward reference frame 201, because the reference macro block 215 is indicative of the amount and direction of movement, macro When it is estimated that the block is moving at a constant velocity, in the encoding target frames 202 to 204, the movement of MV P × (tr / t) between the time difference tr between each encoding target frame and the forward reference frame 201 It is predicted that Therefore, as shown in FIG. 4A, when there are three frames to be encoded, α 1 = 0.25 in the B 1 frame 202, α 2 = 0.5 in the B 2 frame 203, B 3 In the frame 204, α 3 = 0.75 is calculated.

このように、等速度運動モードにおいては係数α〜αを計算で求めることができるので、動きベクトルMVB1〜MVB3を符号化する代わりに、等速度運動モードについての情報と参照動きベクトルMVとを符号化すればよい。 Thus, since the coefficients α 1 to α 3 can be obtained by calculation in the uniform velocity motion mode, instead of encoding the motion vectors MV B1 to MV B3 , information about the uniform velocity motion mode and the reference motion vector and MV P may be encoded.

図5(a)、(b)は、マクロブロックが等加速度運動している場合を示す。運動モード選択部66により等加速度運動と推定されたとき、後方参照フレーム205の参照動きベクトルMVを、フレーム間の時間間隔に基づいて配分することによって、符号化対象フレーム202〜204の係数α〜αを求めることができる。マクロブロックが等加速度運動していると推定された場合、符号化対象フレーム202〜204において、各符号化対象フレームと前方参照フレーム201の時間差trの間に、MV×(tr/t)の動きを示すことが予測される。言い換えると、係数αはフレーム間の時間間隔の二乗に比例した値となる。したがって、図5(a)に示すように、符号化対象フレームが3枚の場合には、Bフレーム202ではα=0.0625、Bフレーム203ではα=0.25、Bフレーム204ではα=0.5625と計算される。 FIGS. 5A and 5B show a case where the macro block is moving at a constant acceleration. When estimated as uniformly accelerated motion by the motion mode selection unit 66, the reference motion vector MV P of the backward reference frame 205, by allocating based on a time interval between frames, the coefficient of the coding target frame 202 to 204 alpha it can be obtained 1 to? 3. When it is estimated that the macroblock is moving at the same acceleration, in the encoding target frames 202 to 204, MV P × (tr 2 / t 2) between the time differences tr of the encoding target frames and the forward reference frame 201. ) Is predicted to show movement. In other words, the coefficient α is a value proportional to the square of the time interval between frames. Therefore, as shown in FIG. 5A, when there are three frames to be encoded, α 1 = 0.0625 in the B 1 frame 202, α 2 = 0.25 in the B 2 frame 203, and B 3 In the frame 204, α 3 = 0.5625 is calculated.

このように、等加速運動モードにおいても係数α〜αを計算で求めることができるので、動きベクトルMVB1〜MVB3を符号化する代わりに、等加速度運動モードについての情報と参照動きベクトルMVとを符号化すればよい。 Thus, since the coefficients α 1 to α 3 can be obtained by calculation even in the uniform acceleration motion mode, instead of encoding the motion vectors MV B1 to MV B3 , information about the uniform acceleration motion mode and the reference motion vector and MV P may be encoded.

図6(a)、(b)は、マクロブロックが不規則運動している場合を示す。この場合は、係数α〜αを計算から求めることができないので、上述した比率c〜cを各符号化対象フレーム202〜204についての係数とみなす。すなわち、α=c、α=c、α=cである。不規則運動モードの場合には、動きベクトルMVB1〜MVB3を符号化する代わりに、係数α〜αと参照動きベクトルMVを符号化する。 FIGS. 6A and 6B show a case where the macroblock is moving irregularly. In this case, since the coefficients α 1 to α 3 cannot be obtained from the calculation, the ratios c 1 to c 3 described above are regarded as the coefficients for the encoding target frames 202 to 204. That is, α 1 = c 1 , α 2 = c 2 , and α 3 = c 3 . Irregular when the motion mode, instead of coding the motion vector MV B1 to MV B3, encodes the reference motion vector MV P and coefficient alpha 1 to? 3.

図7は、調整ベクトルβの計算方法を説明する図である。Bフレーム203を例とすると、調整ベクトルβは、通常の手法で求められる動きベクトルMVB2 222と、参照動きベクトルMVに係数αを乗じて得られるα・MV 223との誤差に相当する。すなわち、実際にはマクロブロックの動きの速度が複数フレーム間で一定であるとは限らないので、マクロブロックの予測された移動位置と実際の移動位置との差分を表すために、調整ベクトルβを求める。 FIG. 7 is a diagram illustrating a method for calculating the adjustment vector β. Taking the B 2 frame 203 as an example, the adjustment vector β 2 includes a motion vector MV B2 222 obtained by a normal method and α 2 · MV P 223 obtained by multiplying the reference motion vector MV P by a coefficient α 2 . It corresponds to the error. That is, since the movement speed of the macroblock is not always constant among a plurality of frames, the adjustment vector β is set to represent the difference between the predicted movement position of the macroblock and the actual movement position. Ask.

図8は、本実施の形態にしたがった動きベクトルの符号化方法を示すフローチャートである。まず、動き補償部60は、後方参照フレーム205内の各マクロブロックについて、前方参照フレーム201を基準とする参照動きベクトルMVを計算し、これらを動きベクトル保持部62に格納する(S10)。ブロックマッチング部61は、後方参照フレーム205内のマクロブロックとのブロックマッチングによって、符号化対象フレーム202〜204内で動き補償予測の対象となるブロックをそれぞれ特定する(S11)。動きベクトル計算部63は、特定された各ブロックに対して、前方参照フレーム201を基準とした符号化対象動きベクトルMVB1〜MVB3を求める(S12)。比率計算部64は、複数の符号化対象フレームのそれぞれについて、符号化対象動きベクトルMVB1〜MVB3の成分と参照動きベクトルMVの成分との比率c〜cを求める(S14)。運動解析部65は、比率c〜cを解析して、複数の符号化対象フレーム間における各ブロックの運動状態を推定し、運動モード選択部66は、推定された運動状態を表す運動モードを選択する(S16)。運動モード選択部66は、選択された運動モードにしたがって、参照動きベクトルMVから符号化対象動きベクトルMVB1〜MVB3を求めるための係数α〜αを求める(S18)。さらに、誤差計算部67は、符号化対象動きベクトルMVB1〜MVB3と、参照動きベクトルMVに係数α〜αを乗じて得られるベクトルとの誤差を表す調整ベクトルβ〜βを求める(S20)。運動モード、係数α、調整ベクトルβは、可変長符号化部90に出力されて、上述した手順にしたがって符号化され、それらの符号化情報は符号化ストリームに含められる(S22)。 FIG. 8 is a flowchart showing a motion vector encoding method according to the present embodiment. First, the motion compensation unit 60 for each macroblock in the backward reference frame 205, calculates a reference motion vector MV P relative to the forward reference frame 201, these movements are stored in the vector holding unit 62 (S10). The block matching unit 61 specifies each block to be subjected to motion compensation prediction in the encoding target frames 202 to 204 by block matching with the macroblock in the backward reference frame 205 (S11). The motion vector calculation unit 63 obtains encoding target motion vectors MV B1 to MV B3 based on the forward reference frame 201 for each identified block (S12). Ratio calculation unit 64, for each of a plurality of encoding target frame, determining the ratio c 1 to c 3 of the component and the reference motion vector MV P component of coded motion vectors MV B1 ~MV B3 (S14). The motion analysis unit 65 analyzes the ratios c 1 to c 3 to estimate the motion state of each block between a plurality of encoding target frames, and the motion mode selection unit 66 represents a motion mode representing the estimated motion state. Is selected (S16). Motion mode selection unit 66, according to the selected motion mode, obtains the coefficients alpha 1 to? 3 for obtaining the coding target motion vector MV B1 to MV B3 from the reference motion vector MV P (S18). Further, the error calculating unit 67, the coding target motion vector MV B1 to MV B3, the reference motion vector MV P to represent the error between the vector obtained by multiplying the coefficient alpha 1 to? 3 adjustment vector β 13 Is obtained (S20). The motion mode, the coefficient α, and the adjustment vector β are output to the variable length encoding unit 90 and encoded according to the above-described procedure, and the encoded information is included in the encoded stream (S22).

なお、上述したように、符号化対象動きベクトルの成分と参照動きベクトルの成分との比較は、水平方向と垂直方向の両方で行う。物体の運動が直線的な場合には、水平方向と垂直方向の比率はほぼ等しくなるので、運動モード、係数α、調整ベクトルβを同一のものとすることによって、さらに符号量を減らすことができる。物体の運動が直線的でない場合には、水平成分と垂直成分のそれぞれについて、運動モード、係数α、調整ベクトルβを符号化する。   Note that, as described above, the comparison between the encoding target motion vector component and the reference motion vector component is performed both in the horizontal direction and in the vertical direction. When the motion of the object is linear, the ratio between the horizontal direction and the vertical direction is almost equal. Therefore, the code amount can be further reduced by making the motion mode, the coefficient α, and the adjustment vector β the same. . If the motion of the object is not linear, the motion mode, coefficient α, and adjustment vector β are encoded for each of the horizontal and vertical components.

図9は、運動モードと符号の対応関係の一例を示す。この例では、可変長符号化部90は、各運動モードに対して2ビットの符号を与える。ここで、図中「通常」と表した運動モードは、従来の方法で検出される動きベクトルMVをそのまま使用するモードである。 FIG. 9 shows an example of the correspondence between motion modes and codes. In this example, the variable length coding unit 90 gives a 2-bit code to each motion mode. Here, the motion mode represented as “normal” in the figure is a mode in which the motion vector MV B detected by the conventional method is used as it is.

可変長符号化部90は、等速度運動モードおよび等加速度運動モードが選択されている場合には、係数αを符号化する必要はない。不規則運動モードの場合には、各符号化対象フレームについての係数αの全てを符号化する必要がある。   The variable length encoding unit 90 does not need to encode the coefficient α when the constant velocity motion mode and the constant acceleration motion mode are selected. In the case of the irregular motion mode, it is necessary to encode all the coefficients α for each encoding target frame.

係数αは、そのまま符号化してもよいが、通常、係数αの値は小数となるため、符号化するとかえって符号量が増大してしまうおそれがある。そこで、係数αを符号化する際、可変長符号化部90は、予め可変長符号が割り当てられている複数の定数のうち係数αに最も近い定数を選択し、選択された定数に割り当てられている符号を動画像の符号化データに含めるようにしてもよい。図10は、その一例を示す。図示するように、係数αに近似させるための対数として、予め、「1」「1/2」「1/3」「1/4」「1/5」といった定数を準備しておき、それぞれに可変長符号を割り当てておく。そして、可変長符号化部90は、動き補償部60から受け取った係数αに最も近い定数を選択する。そして、その定数に割り当てられている可変長符号を符号化データに含めるようにする。これによって、係数αの符号量を削減することができる。
この場合、動きベクトルの精度は低下することになるが、調整ベクトルβを各マクロブロックについて計算しておけば、誤差は調整ベクトルβで吸収されるため、動き補償予測の精度が低下することはない。
The coefficient α may be encoded as it is. However, since the value of the coefficient α is usually a decimal number, there is a possibility that the amount of code may be increased if it is encoded. Therefore, when encoding the coefficient α, the variable-length encoding unit 90 selects a constant closest to the coefficient α among a plurality of constants to which a variable-length code is assigned in advance, and is assigned to the selected constant. The encoded code may be included in the encoded data of the moving image. FIG. 10 shows an example. As shown in the figure, constants such as “1”, “1/2”, “1/3”, “1/4”, and “1/5” are prepared in advance as logarithms for approximating the coefficient α. A variable length code is assigned. Then, the variable length encoding unit 90 selects a constant closest to the coefficient α received from the motion compensation unit 60. Then, the variable length code assigned to the constant is included in the encoded data. As a result, the code amount of the coefficient α can be reduced.
In this case, the accuracy of the motion vector is reduced, but if the adjustment vector β is calculated for each macroblock, the error is absorbed by the adjustment vector β, so that the accuracy of motion compensation prediction is reduced. Absent.

可変長符号化部90は、調整ベクトルβを符号化する際には、その出現頻度に応じた可変長符号を付与するようにしてもよいし、固定長符号化を用いてもよい。   When the adjustment vector β is encoded, the variable length encoding unit 90 may add a variable length code corresponding to the appearance frequency, or may use fixed length encoding.

可変長符号化部90は、運動モードの情報は複数のフレームに対してひとつだけ符号化すればよい。つまり、ひとつのGOP内のフレームについて、ある参照フレームに基づいて動きベクトルを求めているので、運動モードについては、GOP単位でひとつ定めれば十分である。係数αや調整ベクトルβについては、マクロブロック毎に符号化する必要がある。但し、マクロブロックの運動モードが等速度運動モードまたは等加速度運動モードの場合には、係数αを符号化する必要はない。   The variable length encoding unit 90 may encode only one motion mode information for a plurality of frames. That is, since a motion vector is obtained for a frame in one GOP based on a certain reference frame, it is sufficient to determine one motion mode for each GOP. The coefficient α and the adjustment vector β need to be encoded for each macroblock. However, when the motion mode of the macroblock is the constant velocity motion mode or the constant acceleration motion mode, it is not necessary to encode the coefficient α.

運動モードをまとめるのは、GOP単位には限られない。例えば、不規則運動モードと判定されたときに、GOP内で物体の運動状態が一定となる複数のフレームを選び出し、その複数フレーム内においてひとつの運動モードを定めるようにしてもよい。   Collecting exercise modes is not limited to GOP units. For example, when it is determined as the irregular motion mode, a plurality of frames in which the motion state of the object is constant may be selected in the GOP, and one motion mode may be determined in the plurality of frames.

図11は、実施の形態に係る復号装置300の構成図である。これらの機能ブロックもハードウェアのみ、ソフトウェアのみ、またはそれらの組み合わせによっていろいろな形で実現することができる。   FIG. 11 is a configuration diagram of the decoding device 300 according to the embodiment. These functional blocks can be realized in various forms by hardware only, software only, or a combination thereof.

復号装置300は、符号化ストリームの入力を受け取り、符号化ストリームを復号して出力画像を生成する。   The decoding apparatus 300 receives an input of the encoded stream, decodes the encoded stream, and generates an output image.

可変長復号部310は、入力された符号化ストリームを可変長復号し、復号された画像データを逆量子化部320に供給し、動きベクトル情報を動き補償部360に供給する。   The variable length decoding unit 310 performs variable length decoding on the input encoded stream, supplies the decoded image data to the inverse quantization unit 320, and supplies motion vector information to the motion compensation unit 360.

逆量子化部320は、可変長復号部310により復号された画像データを逆量子化し、逆DCT部330に供給する。逆量子化部320により逆量子化された画像データはDCT係数である。逆DCT部330は、逆量子化部320により逆量子化されたDCT係数を逆離散コサイン変換(IDCT)することにより、元の画像データを復元する。逆DCT部330により復元された画像データは、加算器312に供給される。   The inverse quantization unit 320 inversely quantizes the image data decoded by the variable length decoding unit 310 and supplies the image data to the inverse DCT unit 330. The image data inversely quantized by the inverse quantization unit 320 is a DCT coefficient. The inverse DCT unit 330 restores the original image data by performing inverse discrete cosine transform (IDCT) on the DCT coefficients inversely quantized by the inverse quantization unit 320. The image data restored by the inverse DCT unit 330 is supplied to the adder 312.

加算器312は、逆DCT部330から供給された画像データがIフレームである場合、そのIフレームの画像データをそのまま出力するとともに、PフレームやBフレームの予測画像を生成するための参照画像として、フレームメモリ380に格納する。   When the image data supplied from the inverse DCT unit 330 is an I frame, the adder 312 outputs the I frame image data as it is and also serves as a reference image for generating a predicted image of a P frame or a B frame. And stored in the frame memory 380.

加算器312は、逆DCT部330から供給された画像データがPフレームである場合、その画像データは差分画像であるから、逆DCT部330から供給された差分画像と動き補償部360から供給される予測画像を加算することにより、元の画像データを復元し出力する。   When the image data supplied from the inverse DCT unit 330 is a P frame, the adder 312 is supplied from the differential image supplied from the inverse DCT unit 330 and the motion compensation unit 360 because the image data is a difference image. By adding the predicted images, the original image data is restored and output.

動き補償部360は、可変長復号部310から供給される動きベクトル情報と、フレームメモリ380に格納された参照画像を用いて、PフレームまたはBフレームの予測画像を生成し、加算器312に供給する。   The motion compensation unit 360 generates a predicted image of P frame or B frame using the motion vector information supplied from the variable length decoding unit 310 and the reference image stored in the frame memory 380, and supplies the predicted image to the adder 312. To do.

図12は、動き補償部360の構成図である。以下、本実施の形態で符号化されたBフレームを復号するための動き補償部360の動作を説明する。動き補償部360は、後方参照フレームの動き補償を行ったときに、後方参照フレームの各マクロブロックの動きベクトルを検出しており、既に検出した後方参照フレームの動きベクトル情報やマクロブロックの情報を動きベクトル保持部364に保持しておく。   FIG. 12 is a configuration diagram of the motion compensation unit 360. Hereinafter, the operation of the motion compensation unit 360 for decoding the B frame encoded in the present embodiment will be described. The motion compensation unit 360 detects the motion vector of each macroblock of the backward reference frame when performing motion compensation of the backward reference frame, and the motion vector information and macroblock information of the backward reference frame already detected are detected. It is held in the motion vector holding unit 364.

動きベクトル取得部361は、可変長復号部310から動きベクトル情報を取得する。この動きベクトル情報には、上述した運動モード、比例係数αおよび調整ベクトルβが含まれる。動きベクトル取得部361は、動きベクトル情報を動きベクトル計算部362に与える。運動モードを符号化ストリームに含めることによって、ひとつの符号化対象フレーム内に複数の運動モードが含まれていても、動き補償部360において、比例係数αおよび調整ベクトルβから元の動きベクトルを復元することができる。   The motion vector acquisition unit 361 acquires motion vector information from the variable length decoding unit 310. This motion vector information includes the motion mode, the proportional coefficient α, and the adjustment vector β described above. The motion vector acquisition unit 361 provides motion vector information to the motion vector calculation unit 362. By including the motion mode in the encoded stream, the motion compensation unit 360 restores the original motion vector from the proportional coefficient α and the adjustment vector β even if a plurality of motion modes are included in one encoding target frame. can do.

動きベクトル計算部362は、動きベクトル保持部364から後方参照Pフレームのマクロブロックの動きベクトルを取得し、符号化対象フレームの動きベクトルを計算する。計算された動きベクトルは、動き補償予測部366に与えられるとともに、他のフレームの動きベクトルの計算に使用するために、動きベクトル保持部364に保持される。   The motion vector calculation unit 362 acquires the motion vector of the macroblock of the backward reference P frame from the motion vector holding unit 364, and calculates the motion vector of the encoding target frame. The calculated motion vector is given to the motion compensation prediction unit 366 and held in the motion vector holding unit 364 for use in calculation of motion vectors of other frames.

動き補償予測部366は、受け取った動きベクトルを用いて符号化対象フレームの予測画像を生成して加算器312に出力する。   The motion compensation prediction unit 366 generates a prediction image of the encoding target frame using the received motion vector and outputs the prediction image to the adder 312.

以上説明したように、本実施の形態によれば、後方参照フレーム(Pフレーム)の動きベクトルを利用して、符号化対象フレーム(Bフレーム)の動きベクトルを表現するようにした。したがって、Bフレームについては、動きベクトルそのものを符号化する必要がなく、係数αと調整ベクトルβ、および運動モードだけを符号化すればよい。しかも、等速度運動モードまたは等加速度運動モードの場合には、係数αの値はフレーム間隔の比率で求められることから、係数αについても符号化する必要がなく、調整ベクトルβと運動モードのみ符号化すれば十分である。   As described above, according to the present embodiment, the motion vector of the encoding target frame (B frame) is expressed using the motion vector of the backward reference frame (P frame). Therefore, for the B frame, it is not necessary to encode the motion vector itself, and only the coefficient α, the adjustment vector β, and the motion mode need be encoded. In addition, in the case of the constant velocity motion mode or the constant acceleration motion mode, the value of the coefficient α is obtained by the ratio of the frame interval, so there is no need to encode the coefficient α, and only the adjustment vector β and the motion mode are encoded. It is enough to make it.

最近の高画質の圧縮符号化では、1/4画素精度での動きベクトルの探索が行われることが多く、動きベクトル情報の符号量が一層増大する。本実施の形態によって、符号化に要する計算処理量は増加するものの、動きベクトルデータの符号量が削減されるので、符号化ストリームのデータ量が削減され、動画像の符号化効率が向上する。   In recent high-quality compression coding, a search for a motion vector with 1/4 pixel accuracy is often performed, and the amount of code of motion vector information further increases. According to the present embodiment, although the amount of calculation processing required for encoding increases, the code amount of motion vector data is reduced, so that the data amount of the encoded stream is reduced and the encoding efficiency of moving images is improved.

従来のダイレクトモードでは、等速度運動しか対応していないが、本実施の形態によれば、加速度運動または複雑な運動をしている場合にも対応でき、動きベクトルデータの符号量を削減することができる。   In the conventional direct mode, only constant velocity motion is supported. However, according to the present embodiment, it is possible to cope with acceleration motion or complex motion, and the code amount of motion vector data can be reduced. Can do.

なお、以上の説明では、Bフレームの順方向予測の場合について述べたが、逆方向予測についても、同様の手順で本実施形態を適用することができる。また、片方向の動き予測のみならず、双方向予測の場合にも、前方参照フレーム、後方参照フレームのそれぞれに対する動きを示す2つの独立した動きベクトルの符号化について、本実施形態を適用することができる。すなわち、順方向予測、逆方向予測のそれぞれについて、実施の形態と同様にして複数の動きベクトルを用意してやればよい。   In the above description, the case of forward prediction of the B frame has been described. However, the present embodiment can be applied to backward prediction in the same procedure. In addition, in the case of bidirectional prediction as well as unidirectional motion prediction, the present embodiment is applied to the encoding of two independent motion vectors indicating the motion for each of the forward reference frame and backward reference frame. Can do. That is, a plurality of motion vectors may be prepared for each of forward prediction and backward prediction in the same manner as in the embodiment.

以上、本発明を実施の形態をもとに説明した。実施の形態は例示であり、それらの各構成要素や各処理プロセスの組み合わせにいろいろな変形例が可能なこと、またそうした変形例も本発明の範囲にあることは当業者に理解されるところである。   The present invention has been described based on the embodiments. The embodiments are exemplifications, and it will be understood by those skilled in the art that various modifications can be made to combinations of the respective constituent elements and processing processes, and such modifications are within the scope of the present invention. .

上記の説明では、符号化装置100および復号装置300は、MPEGシリーズの規格(MPEG−1、MPEG−2およびMPEG−4)、H.26xシリーズの規格(H.261、H.262およびH.263)、もしくはH.264/AVCに準拠して動画像の符号化および復号を行ったが、本発明は、時間的スケーラビリティをもつ階層的な動画像の符号化および復号を行う場合にも適用することができる。特にMCTF技術を用いた場合の動きベクトルの符号化において、動きベクトルの符号量を削減するために本発明は有効である。   In the above description, the encoding device 100 and the decoding device 300 are MPEG series standards (MPEG-1, MPEG-2, and MPEG-4), H.264, and H.264. 26x series standards (H.261, H.262 and H.263), or H.264 Although video encoding and decoding are performed in accordance with H.264 / AVC, the present invention can also be applied to the case of hierarchical video encoding and decoding with temporal scalability. In particular, the present invention is effective in reducing the amount of motion vector codes in the encoding of motion vectors when the MCTF technique is used.

上述の実施形態では、比率cを解析することによって運動モードを推定することを説明した。しかしながら、複数の運動モードにしたがった複数の動きベクトルを利用して符号化対象フレームの動き補償を実行し予測画像を求め、予測画像と原画像との差分である差分画像の符号量が最小となる動きベクトルが得られた運動モードを選択するように構成してもよい。以下、この方法について説明する。   In the above-described embodiment, it has been described that the motion mode is estimated by analyzing the ratio c. However, the motion compensation of the encoding target frame is performed using a plurality of motion vectors according to a plurality of motion modes to obtain a prediction image, and the code amount of the difference image, which is the difference between the prediction image and the original image, is minimized. You may comprise so that the motion mode from which the motion vector which was obtained may be selected. Hereinafter, this method will be described.

図示しない符号量推定部は、等速度運動モードまたは等加速度運動モードにおいて、予測画像と原画像との差分である差分画像を符号化したときの符号量を推定する。推定した符号量は、運動モードに対応づけて図示しない符号量保持部に保持される。
図示しない動きベクトル選択部は、符号量保持部に保持された差分画像の符号量を比較し、符号量が最小となる方の運動モードを選択する。これによって、動画像の符号化データの符号量を削減し、符号化効率を向上させることができる。
A code amount estimation unit (not shown) estimates a code amount when a differential image that is a difference between a predicted image and an original image is encoded in the constant velocity motion mode or the constant acceleration motion mode. The estimated code amount is held in a code amount holding unit (not shown) in association with the motion mode.
A motion vector selection unit (not shown) compares the code amounts of the difference images held in the code amount holding unit, and selects the motion mode with the smallest code amount. As a result, the code amount of the encoded data of the moving image can be reduced and the encoding efficiency can be improved.

別の方法として、通常の手順で求められる動きベクトルMVよりも差分画像の符号量が減少する場合にのみ、上述した運動モードにしたがった動きベクトルの符号化を実行するようにしてもよい。 As another method, the motion vector encoding according to the motion mode described above may be executed only when the code amount of the difference image is smaller than the motion vector MV B obtained by the normal procedure.

具体的には、まず、動き補償予測部68は、通常の動きベクトルMVを計算し、図示しない符号量推定部は、動きベクトルMVを利用して予測画像を生成したときの差分画像の符号量を算出する。続いて、動き補償予測部68は、等速度運動モードまたは等加速度運動モードにしたがって動きベクトルα・MVを計算し、符号量推定部は、動きベクトルα・MVを利用して予測画像を生成したときの差分画像の符号量を算出する。そして、2つの差分画像の符号量を比較して、等速度運動モードまたは等加速度運動モードの動きベクトルα・MVの方が符号量が小さいときにのみ、等速度運動モードまたは等加速度運動モードのいずれかを選択する。 Specifically, first, the motion compensation prediction unit 68 calculates a normal motion vector MV B , and a code amount estimation unit (not shown) uses the motion vector MV B to generate a prediction image. The code amount is calculated. Subsequently, the motion compensation prediction unit 68 calculates the motion vector α · MV P according to the constant velocity motion mode or the constant acceleration motion mode, and the code amount estimation unit uses the motion vector α · MV P to calculate the predicted image. The code amount of the difference image when it is generated is calculated. Then, the code amounts of the two difference images are compared, and only when the code amount of the motion vector α · MV P in the constant velocity motion mode or the constant acceleration motion mode is smaller, the constant velocity motion mode or the constant acceleration motion mode Select one of the following.

上述の実施形態では、マクロブロック単位で動きベクトルを検出する場合について説明したが、ブロック(8×8画素または4×4画素)単位で動きベクトルを検出する場合、およびオブジェクト単位で動きベクトルを検出する場合についても本発明を適用できる。   In the above-described embodiment, the case of detecting a motion vector in units of macroblocks has been described. However, in the case of detecting a motion vector in units of blocks (8 × 8 pixels or 4 × 4 pixels), and in the case of detecting motion vectors in units of objects. The present invention can also be applied to such cases.

上記の説明では、後方参照フレームの動きベクトルを利用して、符号化対象フレーム内の各マクロブロックについて動きベクトルを表現することを述べた。しかしながら、マクロブロック単位でなくそれ以外のフレーム内の領域、例えば、符号化単位としてのスライスや、図示しないROI領域設定部が動画像上に設定する注目領域(Region of Interest:ROI)について、同様の手法により動きベクトルを求めてもよい。   In the above description, it has been described that the motion vector is expressed for each macroblock in the encoding target frame using the motion vector of the backward reference frame. However, the same applies not only to the macroblock unit but also to other regions in the frame, for example, a slice as an encoding unit and a region of interest (ROI) set on a moving image by a ROI region setting unit (not shown). The motion vector may be obtained by this method.

具体的には、動き補償部60は、後方参照フレーム205内の各スライスまたは注目領域について、前方参照フレーム201を基準とする参照動きベクトルMVを計算し、これらを動きベクトル保持部62に格納する。ブロックマッチング部61は、後方参照フレーム205内のスライスまたは注目領域とのマッチングによって、符号化対象フレーム202〜204内で動き補償予測の対象となるスライスまたは注目領域をそれぞれ特定する。動きベクトル計算部63は、特定された各スライスまたは注目領域に対して、前方参照フレーム201を基準とした符号化対象動きベクトルMVB1〜MVB3を求める。比率計算部64は、複数の符号化対象フレームのそれぞれについて、符号化対象動きベクトルMVB1〜MVB3の成分と参照動きベクトルMVの成分との比率c〜cを求める。運動解析部65は、比率c〜cを解析して、複数の符号化対象フレーム間における各スライスまたは注目領域の運動状態を推定し、運動モード選択部66は、推定された運動状態を表す運動モードを選択する。運動モード選択部66は、選択された運動モードにしたがって、参照動きベクトルMVから符号化対象動きベクトルMVB1〜MVB3を求めるための係数α〜αを求める。さらに、誤差計算部67は、符号化対象動きベクトルMVB1〜MVB3と、参照動きベクトルMVに係数α〜αを乗じて得られるベクトルとの誤差を表す調整ベクトルβ〜βを求める。運動モード、係数α、調整ベクトルβは、可変長符号化部90に出力されて、上述した手順にしたがって符号化され、それらの符号化情報は、スライスまたは注目領域毎に符号化ストリームに含められる。 Specifically, the motion compensation unit 60 stores for each slice or region of interest in the backward reference frame 205, calculates a reference motion vector MV P relative to the forward reference frame 201, these motion vector holding unit 62 To do. The block matching unit 61 specifies a slice or attention area that is a target of motion compensation prediction in the encoding target frames 202 to 204 by matching with a slice or attention area in the backward reference frame 205. The motion vector calculation unit 63 obtains encoding target motion vectors MV B1 to MV B3 based on the forward reference frame 201 for each identified slice or region of interest. Ratio calculation unit 64, for each of a plurality of encoding target frame, determining the ratio c 1 to c 3 of the component and the reference motion vector MV P component of coded motion vectors MV B1 to MV B3. The motion analysis unit 65 analyzes the ratios c 1 to c 3 to estimate the motion state of each slice or region of interest between the plurality of encoding target frames, and the motion mode selection unit 66 determines the estimated motion state. Select the motion mode to represent. Motion mode selection unit 66, according to the selected motion mode, obtains the coefficients alpha 1 to? 3 for obtaining the coding target motion vector MV B1 to MV B3 from the reference motion vector MV P. Further, the error calculating unit 67, the coding target motion vector MV B1 to MV B3, the reference motion vector MV P to represent the error between the vector obtained by multiplying the coefficient alpha 1 to? 3 adjustment vector β 13 Ask for. The motion mode, the coefficient α, and the adjustment vector β are output to the variable length encoding unit 90 and encoded according to the above-described procedure, and the encoded information is included in the encoded stream for each slice or region of interest. .

さらに、符号化対象フレーム内のマクロブロック毎に運動モードを決定する代わりに、フレーム単位またはGOP単位で運動モードを決定してもよい。この場合、以下の2つの手順がある。   Furthermore, instead of determining the motion mode for each macroblock in the encoding target frame, the motion mode may be determined in units of frames or GOPs. In this case, there are the following two procedures.

手順1.動き補償部60は、候補となる運動モード毎に、フレーム単位またはGOP単位で符号化を実行する。つまり、ひとつの運動モードを全てのマクロブロックまたはフレーム内領域について適用して符号化を実行する。この段階では符号化データを出力せず、符号化データの符号量のみを符号量保持部(図示せず)に保持しておく。全ての運動モードについて符号化データの符号量を計算した後、運動モード選択部66は、符号量が最小となる運動モードを選択する。そして、動き補償予測部68は、選択された運動モードにしたがって改めて符号化を実行し、この段階で符号化データが出力される。 Procedure 1. The motion compensation unit 60 performs encoding in frame units or GOP units for each candidate motion mode. That is, encoding is executed by applying one motion mode to all macroblocks or intra-frame regions. At this stage, encoded data is not output, and only the code amount of the encoded data is held in a code amount holding unit (not shown). After calculating the code amount of the encoded data for all the motion modes, the motion mode selection unit 66 selects a motion mode that minimizes the code amount. Then, the motion compensation prediction unit 68 performs encoding again according to the selected motion mode, and encoded data is output at this stage.

手順2.動き補償部60は、候補となる運動モード毎に、フレーム単位またはGOP単位で符号化を実行する。つまり、ひとつの運動モードを全てのマクロブロックまたはフレーム内領域について適用して符号化を実行する。この段階では符号化データを出力しないが、符号化データそのものと符号化データの符号量とを符号量保持部に保持しておく。全ての運動モードについて符号化データの符号量を計算した後、運動モード選択部66は、符号量が最小となる運動モードを選択する。そして、選択された運動モードに対応する符号化データが符号量保持部から出力される。 Procedure 2. The motion compensation unit 60 performs encoding in frame units or GOP units for each candidate motion mode. That is, encoding is executed by applying one motion mode to all macroblocks or intra-frame regions. At this stage, encoded data is not output, but the encoded data itself and the code amount of the encoded data are held in the code amount holding unit. After calculating the code amount of the encoded data for all the motion modes, the motion mode selection unit 66 selects a motion mode that minimizes the code amount. Then, encoded data corresponding to the selected motion mode is output from the code amount holding unit.

手順1、2のうち、運動モードの選択後に改めて符号化をし直す分だけ、手順1の方が手順2よりも符号化に要する計算量が多くなる。しかし、手順2の方は、運動モード毎に符号化データ自体と符号量とを保持しておく必要があるため、手順1より多くの記憶領域が必要となる。このように、手順1と手順2とはトレードオフの関係にあるので、状況に応じて適切な方を選択すればよい。   Of the procedures 1 and 2, the amount of calculation required for the encoding of the procedure 1 is larger than that of the procedure 2 by the amount of re-encoding after selecting the motion mode. However, since the procedure 2 needs to hold the encoded data itself and the code amount for each motion mode, a larger storage area than the procedure 1 is required. Thus, since procedure 1 and procedure 2 are in a trade-off relationship, an appropriate one may be selected according to the situation.

さらに、上述のMCTF技術にしたがった符号化において、MCTFにより生成される符号化階層に含まれる複数のフレーム間の動きベクトルについて本発明の方法を適用することができる。   Furthermore, in the encoding according to the MCTF technique described above, the method of the present invention can be applied to motion vectors between a plurality of frames included in an encoding layer generated by MCTF.

これについて、図13を参照して説明する。図13は、4つのフレーム101〜104をMCTF技術にしたがって符号化する様子を表しており、各階層で出力される画像と動きベクトルとを示している。   This will be described with reference to FIG. FIG. 13 shows a state where four frames 101 to 104 are encoded according to the MCTF technique, and shows images and motion vectors output in each layer.

図示しないMCTF処理部は、連続する二枚のフレーム101、102を順次取得して、高域フレーム111と低域フレーム112とを生成する。また、二枚のフレーム103、104を順次取得して高域フレーム113と低域フレーム114とを生成する。これらを階層1と称する。また、MCTF処理部は、二枚のフレーム101、102から動きベクトルMV1aを検出し、フレーム103、104から動きベクトルMV1bを検出する。 An MCTF processing unit (not shown) sequentially acquires two consecutive frames 101 and 102 and generates a high-frequency frame 111 and a low-frequency frame 112. Also, the two frames 103 and 104 are sequentially acquired to generate a high-frequency frame 113 and a low-frequency frame 114. These are referred to as level 1. The MCTF processing unit detects the motion vector MV 1a from the two frames 101 and 102, and detects the motion vector MV 1b from the frames 103 and 104.

また、MCTF処理部は、階層1の低域フレーム112、114からさらに高域フレーム121と低域フレーム122とを生成する。これらを階層2と称する。MCTF処理部は、二枚の低域フレーム112、114から動きベクトルMVを検出する。 The MCTF processing unit further generates a high-frequency frame 121 and a low-frequency frame 122 from the low-frequency frames 112 and 114 in layer 1. These are referred to as level 2. The MCTF processing unit detects a motion vector MV 0 from the two low frequency frames 112 and 114.

なお、図13では、説明を簡単にするためにフレーム単位で動きベクトルを検出しているが、マクロブロック単位で動きベクトルを検出してもよいし、ブロック(8×8画素または4×4画素)単位で動きベクトルを検出してもよい。   In FIG. 13, the motion vector is detected in units of frames for the sake of simplicity. However, the motion vector may be detected in units of macroblocks, or blocks (8 × 8 pixels or 4 × 4 pixels). ) A motion vector may be detected in units.

図13に示すようなMCTFの階層があるとき、階層1の動きベクトルMV1aとMV1bの符号化に上記方法を適用する。階層1の動きベクトルMV1aとMV1bとは、時間上の距離が階層0の動きベクトルMVの半分であるので、動きも半分と推定される。そこで、動きベクトルMV1aとMV1bとを以下の計算式で算出する。
MV1a=(1/2)・MV+β
MV1b=(1/2)・MV+β
ここで、β、βは予測値とのずれを表す調整ベクトルである。したがって、階層1の動きベクトルMV1aとMV1bを符号化する代わりに、階層0の動きベクトルMVと調整ベクトルβ、βを符号化すればよい。
When there is an MCTF layer as shown in FIG. 13, the above method is applied to encoding of the motion vectors MV 1a and MV 1b of the layer 1. Since the motion vectors MV 1a and MV 1b in the hierarchy 1 are half the distance in the motion vector MV 0 in the hierarchy 0, the motion is also estimated to be half. Therefore, the motion vectors MV 1a and MV 1b are calculated by the following calculation formula.
MV 1a = (1/2) · MV 0 + β a
MV 1b = (1/2) · MV 0 + β b
Here, β a and β b are adjustment vectors representing deviations from the predicted values. Therefore, instead of encoding the motion vectors MV 1a and MV 1b of the layer 1, the motion vector MV 0 and the adjustment vectors β a and β b of the layer 0 may be encoded.

なお、上記計算式から分かるように、階層0の動きベクトルMVが求められるまで階層1を符号化することはできない。そこで、階層0の動きベクトルMVを求めるまでの間、階層1の動きベクトル情報と差分情報とを保持しておく必要がある。 As can be seen from the above equation, layer 1 cannot be encoded until motion vector MV 0 of layer 0 is obtained. Therefore, it is necessary to hold the motion vector information and difference information of layer 1 until the motion vector MV 0 of layer 0 is obtained.

MCTFの階層が3段以上ある場合でも、階層0以外の階層における動きベクトルに対して本発明の方法を適用できる。   Even when there are three or more MCTF layers, the method of the present invention can be applied to motion vectors in layers other than layer 0.

実施の形態に係る符号化装置の構成図である。It is a block diagram of the encoding apparatus which concerns on embodiment. 従来の動きベクトルの計算順序を説明する図である。It is a figure explaining the calculation order of the conventional motion vector. 図1の動き補償部の構成を説明する図である。It is a figure explaining the structure of the motion compensation part of FIG. (a)、(b)は、等速度運動モードの係数αを説明する図である。(A), (b) is a figure explaining the coefficient (alpha) of constant velocity motion mode. (a)、(b)は、等加速度運動モードの係数αを説明する図である。(A), (b) is a figure explaining the coefficient (alpha) of a uniform acceleration motion mode. (a)、(b)は、不規則運動モードの係数αを説明する図である。(A), (b) is a figure explaining the coefficient (alpha) of irregular motion mode. 調整ベクトルβの算出方法を説明する図である。It is a figure explaining the calculation method of adjustment vector (beta). 実施の形態に係る動きベクトルの符号化方法をフローチャートである。5 is a flowchart of a motion vector encoding method according to the embodiment. 動きベクトルの運動モードとその符号の一例を示すテーブルである。It is a table which shows an example of the motion mode of a motion vector, and its code | symbol. 係数αを近似するための定数と、定数に割り当てられる符号の一例を示すテーブルである。It is a table which shows an example of the code | symbol allocated to the constant for approximating coefficient (alpha), and a constant. 実施の形態に係る復号装置の構成を示す図である。It is a figure which shows the structure of the decoding apparatus which concerns on embodiment. 図11の動き補償部の構成図である。It is a block diagram of the motion compensation part of FIG. 4つのフレームをMCTF技術にしたがって符号化する様子を示す図である。It is a figure which shows a mode that four frames are encoded according to MCTF technique.

符号の説明Explanation of symbols

10 ブロック生成部、 12 差分器、 14 加算器、 20 DCT部、 30 量子化部、 40 逆量子化部、 50 逆DCT部、 60 動き補償部、 61 ブロックマッチング部、 62 動きベクトル保持部、 63 動きベクトル計算部、 64 比率計算部、 65 運動解析部、 66 運動モード選択部、 67 誤差計算部、 68 動き補償予測部、 80 フレームメモリ、 90 可変長符号化部、 100 符号化装置、 201 Iフレーム(前方参照フレーム)、 203 Bフレーム(符号化対象フレーム)、 205 Pフレーム(後方参照フレーム)、 300 復号装置、 310 可変長復号部、 312 加算器、 320 逆量子化部、 330 逆DCT部、 360 動き補償部、 361 動きベクトル取得部、 362 動きベクトル計算部、 364 動きベクトル保持部、 366 動き補償予測部、 380 フレームメモリ。   10 block generation units, 12 differentiators, 14 adders, 20 DCT units, 30 quantization units, 40 inverse quantization units, 50 inverse DCT units, 60 motion compensation units, 61 block matching units, 62 motion vector holding units, 63 Motion vector calculation unit, 64 ratio calculation unit, 65 motion analysis unit, 66 motion mode selection unit, 67 error calculation unit, 68 motion compensation prediction unit, 80 frame memory, 90 variable length coding unit, 100 coding device, 201 I Frame (forward reference frame), 203 B frame (encoding target frame), 205 P frame (backward reference frame), 300 decoding device, 310 variable length decoding unit, 312 adder, 320 inverse quantization unit, 330 inverse DCT unit 360 motion compensation unit, 361 motion vector acquisition unit, 62 motion vector calculating unit, 364 a motion vector holding unit, 366 a motion compensation prediction unit, 380 a frame memory.

Claims (11)

動画像のピクチャを符号化する方法であって、
第1の参照ピクチャを基準とした第2の参照ピクチャ内のブロックの動きベクトルである参照動きベクトルが求められている場合に、
符号化対象ピクチャ内のブロックに対して、第1の参照ピクチャを基準とした動きベクトルである符号化対象動きベクトルを求め、
複数の符号化対象ピクチャのそれぞれについて、前記符号化対象動きベクトルの成分と前記参照動きベクトルの成分との比率を求め、
前記比率を参照して、複数の符号化対象ピクチャ間において各ブロックが停止、等速度運動、等加速度運動または不規則運動のうちのいずれの状態にあるかを表す所定の運動モードのなかから、一つの運動モードを選択し、
選択した運動モードについて予め定められている符号を動画像の符号化データに含めることを特徴とする符号化方法。
A method of encoding a moving picture, comprising:
When a reference motion vector that is a motion vector of a block in the second reference picture based on the first reference picture is obtained,
Obtaining an encoding target motion vector that is a motion vector based on the first reference picture for a block in the encoding target picture;
For each of a plurality of encoding target pictures, obtain a ratio between the encoding target motion vector component and the reference motion vector component;
Referring to the ratio, each block stop between a plurality of coded pictures, from among the uniform motion, a predetermined motion mode indicating whether is in one state of the uniformly accelerated motion or irregular movements, Select one exercise mode,
It marks Goka how to characterized the inclusion of code for the selected motion mode predetermined for the encoded data of a moving image.
前記第2の参照ピクチャ内のブロックとのマッチングによって、複数の符号化対象ピクチャ内で動き補償予測の対象となるブロックをそれぞれ特定し、
特定されたブロックについて、前記符号化対象動きベクトルを求めることを特徴とする請求項に記載の符号化方法。
Each of the blocks to be subjected to motion compensation prediction in a plurality of encoding target pictures by matching with a block in the second reference picture,
For a particular block, the encoding method according to claim 1, characterized in that obtaining the encoding target motion vector.
隣接する符号化対象ピクチャで求められた比率の差分を取ることによって、各ブロックが停止、等速度運動、等加速度運動または不規則運動のうちのいずれの状態にあるかを推定することを特徴とする請求項またはに記載の符号化方法。 It is characterized by estimating whether each block is in a stopped state, a constant velocity motion, a constant acceleration motion, or an irregular motion by taking a difference of ratios obtained in adjacent pictures to be encoded. The encoding method according to claim 1 or 2 . 前記運動モードにしたがって前記参照動きベクトルから前記符号化対象動きベクトルを求めるための係数を求め、該係数の情報を動画像の符号化データに含めることを特徴とする請求項ないしのいずれかに記載の符号化方法。 Obtains the coefficients for obtaining the encoding target motion vector from the reference motion vector according to the motion mode, any one of claims 1, characterized in the inclusion of information the coefficient in the encoded data of a moving picture 3 The encoding method described in 1. 前記運動モードとして複数の符号化対象ピクチャ間でブロックが等速度運動することを表す等速度運動モードが選択された場合
前記係数は、前記第1の参照ピクチャと前記符号化対象ピクチャ間の時間間隔に基づいて決定されることを特徴とする請求項に記載の符号化方法。
If the as motion mode, the uniform velocity motion mode indicating that the block is constant velocity motion among a plurality of coded pictures is selected,
The encoding method according to claim 4 , wherein the coefficient is determined based on a time interval between the first reference picture and the encoding target picture.
前記運動モードとして複数の符号化対象ピクチャ間でブロックが等加速度運動することを表す等加速度運動モードが選択された場合
前記係数は、前記第1の参照ピクチャと前記符号化対象ピクチャ間の時間間隔に基づいて決定されることを特徴とする請求項に記載の符号化方法。
If the as motion mode, the constant acceleration motion mode indicating that the block is uniformly accelerated motion across multiple encoding target picture is selected,
The encoding method according to claim 4 , wherein the coefficient is determined based on a time interval between the first reference picture and the encoding target picture.
前記係数を符号化する際、予め可変長符号が割り当てられている複数の定数のうち前記係数に最も近い定数を選択し、選択された定数に割り当てられている符号を動画像の符号化データに含めることを特徴とする請求項に記載の符号化方法。 When encoding the coefficient, a constant closest to the coefficient is selected from a plurality of constants to which a variable-length code is assigned in advance, and the code assigned to the selected constant is used as the encoded data of the moving image. The encoding method according to claim 4 , wherein the encoding method is included. 前記符号化対象動きベクトルと、前記参照動きベクトルに前記係数を乗じて得られるベクトルとの誤差を表す調整ベクトルを求め、該調整ベクトルの情報を動画像の符号化データに含めることを特徴とする請求項ないしのいずれかに記載の符号化方法。 An adjustment vector representing an error between the encoding target motion vector and a vector obtained by multiplying the reference motion vector by the coefficient is obtained, and information on the adjustment vector is included in encoded data of a moving image encoding method according to any one of claims 4 to 7. 前記運動モードの符号は複数のピクチャに対してひとつ選択され、前記係数と前記調整ベクトルの情報は前記符号化対象動きベクトル毎に符号化されることを特徴とする請求項に記載の符号化方法。 The encoding according to claim 8 , wherein one code of the motion mode is selected for a plurality of pictures, and the information on the coefficient and the adjustment vector is encoded for each encoding target motion vector. Method. 動画像のピクチャを符号化する方法であって、
第1の参照ピクチャを基準とした第2の参照ピクチャの動きベクトルである参照動きベクトルが求められている場合に、
符号化対象ピクチャに対して、第1の参照ピクチャを基準とした動きベクトルである符号化対象動きベクトルを求め、
複数の符号化対象ピクチャのそれぞれについて、前記符号化対象動きベクトルの成分と前記参照動きベクトルの成分との比率を求め、
前記比率を参照して、複数の符号化対象ピクチャ間においてピクチャまたは複数のピクチャが停止状態、等速度運動、等加速度運動または不規則運動のうちのいずれの状態にあるかを表す所定の運動モードのなかから、一つの運動モードを選択し、
選択した運動モードについて予め定められている符号を動画像の符号化データに含めることを特徴とする符号化方法。
A method of encoding a moving picture, comprising:
When a reference motion vector that is a motion vector of a second reference picture based on the first reference picture is obtained,
For the encoding target picture, obtain an encoding target motion vector that is a motion vector based on the first reference picture;
For each of a plurality of encoding target pictures, obtain a ratio between the encoding target motion vector component and the reference motion vector component;
Referring to the ratio, indicating whether each picture relevant Yama other among a plurality of encoding target picture is in one of states of a plurality of pictures stopped, constant velocity motion, uniformly accelerated motion or irregular motion Select one exercise mode from the predetermined exercise modes,
An encoding method comprising : a predetermined code for a selected motion mode is included in encoded data of a moving image.
動画像のピクチャに再帰的に動き補償時間フィルタリングを実施してフレームレートの異なる複数の階層を求める符号化方法において、
階層内に含まれる第1の参照ピクチャを基準とした第2の参照ピクチャの動きベクトルである参照動きベクトルが求められている場合に、
階層内に含まれる符号化対象ピクチャに対して、第1の参照ピクチャを基準とした動きベクトルである符号化対象動きベクトルを求め、
複数の符号化対象ピクチャのそれぞれについて、前記符号化対象動きベクトルの成分と前記参照動きベクトルの成分との比率を求め、
前記比率を参照して、複数の符号化対象ピクチャ間において各ピクチャが停止状態、等速度運動、等加速度運動または不規則運動のうちのいずれの状態にあるかを表す所定の運動モードのなかから、一つの運動モードを選択し、
選択した運動モードについて予め定められている符号を動画像の符号化データに含めることを特徴とする符号化方法。
In an encoding method for recursively performing motion compensation time filtering on a moving picture picture to obtain a plurality of layers having different frame rates,
When a reference motion vector that is a motion vector of the second reference picture based on the first reference picture included in the hierarchy is obtained,
For an encoding target picture included in the hierarchy, obtain an encoding target motion vector that is a motion vector based on the first reference picture;
For each of a plurality of encoding target pictures, obtain a ratio between the encoding target motion vector component and the reference motion vector component;
Referring to the ratio, from among a predetermined motion mode indicating whether each picture is in a stopped state, a constant velocity motion, a constant acceleration motion, or an irregular motion among a plurality of encoding target pictures Select one exercise mode,
An encoding method comprising : a predetermined code for a selected motion mode is included in encoded data of a moving image.
JP2006182516A 2005-09-27 2006-06-30 Encoding method Expired - Fee Related JP4169767B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006182516A JP4169767B2 (en) 2005-09-27 2006-06-30 Encoding method

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2005280880 2005-09-27
JP2006182516A JP4169767B2 (en) 2005-09-27 2006-06-30 Encoding method

Publications (2)

Publication Number Publication Date
JP2007124614A JP2007124614A (en) 2007-05-17
JP4169767B2 true JP4169767B2 (en) 2008-10-22

Family

ID=38147895

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006182516A Expired - Fee Related JP4169767B2 (en) 2005-09-27 2006-06-30 Encoding method

Country Status (1)

Country Link
JP (1) JP4169767B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011070730A1 (en) * 2009-12-07 2011-06-16 日本電気株式会社 Video coding device and video decoding device
WO2012081894A1 (en) 2010-12-13 2012-06-21 한국전자통신연구원 Method and device for determining reference unit

Also Published As

Publication number Publication date
JP2007124614A (en) 2007-05-17

Similar Documents

Publication Publication Date Title
JP3072035B2 (en) Two-stage video film compression method and system
US8073048B2 (en) Method and apparatus for minimizing number of reference pictures used for inter-coding
US8189671B2 (en) Statistical content of block matching scheme for pre-processing in encoding and transcoding
KR100873586B1 (en) Dynamic complexity prediction and regulation of mpeg2 decoding in a media processor
US20070025444A1 (en) Coding Method
US8565307B2 (en) Picture encoding method and picture encoding device
US20110280306A1 (en) Real-time video coding/decoding
US20070025442A1 (en) Coding method for coding moving images
US20070064809A1 (en) Coding method for coding moving images
KR100694137B1 (en) Apparatus for encoding or decoding motion image, method therefor, and recording medium storing a program to implement thereof
JP4703449B2 (en) Encoding method
JP2007067731A (en) Coding method
JP2006279573A (en) Encoder and encoding method, and decoder and decoding method
JP2008011455A (en) Coding method
JP2007081720A (en) Coding method
JP2007266749A (en) Encoding method
JP4494803B2 (en) Improved noise prediction method and apparatus based on motion compensation, and moving picture encoding method and apparatus using the same
JP2007036888A (en) Coding method
JP2022123031A (en) Encoding device, encoding method, and encoding program
US20090257497A1 (en) Moving image processing system, encoding device, and decoding device
JP4169767B2 (en) Encoding method
JP2007036889A (en) Coding method
JP4401341B2 (en) Encoding method
JP4243286B2 (en) Encoding method
JP2007036887A (en) Coding method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20070918

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20080404

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20080422

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20080619

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20080708

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20080805

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110815

Year of fee payment: 3

R151 Written notification of patent or utility model registration

Ref document number: 4169767

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110815

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110815

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120815

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130815

Year of fee payment: 5

LAPS Cancellation because of no payment of annual fees