JP4169767B2 - Encoding method - Google Patents
Encoding method Download PDFInfo
- 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
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には、残差動きベクトルと残りフレーム数より予想される予測動きベクトルがフレーム間の動きベクトルの近傍に存在する場合、フレーム間の動きベクトルの近傍にある予測動きベクトルを動きベクトルとし、予測動きベクトルがフレーム間の動きベクトルの近傍に存在しないときは、フレーム間の動きベクトルを動きベクトルとする、動き補償予測符号化方式が記載されている。
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
本実施の形態の符号化装置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
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
ブロック生成部10は、入力された画像フレームをマクロブロックに分割する。画像フレームの左上から右下方向の順にマクロブロックが形成される。ブロック生成部10は生成したマクロブロックを差分器12と動き補償部60に供給する。
The
差分器12は、ブロック生成部10から供給される画像フレームがIフレームであれば、そのままDCT部20に出力するが、PフレームまたはBフレームであれば、動き補償部60から供給される予測画像との差分を計算してDCT部20に供給する。
If the image frame supplied from the
動き補償部60は、フレームメモリ80に格納されている過去または未来の画像フレームを参照画像として利用し、ブロック生成部10から入力されたPフレームまたはBフレームの各マクロブロックについて、誤差の最も小さい予測領域を参照画像から探索し、マクロブロックから予測領域へのずれを示す動きベクトルを求める。動き補償部60は、動きベクトルを用いてマクロブロック毎に動き補償を行い、予測画像を生成する。動き補償部60は、生成した動きベクトルを可変長符号化部90に供給し、予測画像を差分器12と加算器14に供給する。
The
動き補償部60では、双方向予測と片方向予測のいずれも適用可能である。動き補償部60は、片方向予測では、前方参照フレームに対する動きを示す順方向動きベクトルを生成する。双方向予測では、順方向動きベクトルに加えて、後方参照フレームに対する動きを示す逆方向動きベクトルの2つの動きベクトルを生成する。
The
差分器12は、ブロック生成部10から出力される現在の画像(つまり、符号化対象の画像)と、動き補償部60から出力される予測画像との差分を求め、DCT部20に出力する。DCT部20は、差分器12から与えられた差分画像を離散コサイン変換(DCT)し、DCT係数を量子化部30に与える。
The
量子化部30は、DCT係数を量子化し、可変長符号化部90に与える。可変長符号化部90は、動き補償部60から与えられた動きベクトルとともに差分画像の量子化されたDCT係数を可変長符号化し、符号化ストリームを生成する。可変長符号化部90は、符号化ストリームを生成する際、符号化されたフレームを時間順序に並べ替える処理を行う。
The
量子化部30は、画像フレームの量子化されたDCT係数を逆量子化部40に供給する。逆量子化部40は、与えられた量子化データを逆量子化し、逆DCT部50に与え、逆DCT部50は、与えられた逆量子化データを逆離散コサイン変換する。これにより、符号化された画像フレームが復元される。復元された画像フレームは加算器14に入力される。
The
加算器14は、逆DCT部50から供給される画像フレームがIフレームであれば、そのままフレームメモリ80に格納する。加算器14は、逆DCT部50から供給される画像フレームがPフレームまたはBフレームであれば、それは差分画像であるため、逆DCT部50から供給された差分画像と動き補償部60から供給される予測画像とを加算することにより、元の画像フレームを再構成し、フレームメモリ80に格納する。
If the image frame supplied from the
PフレームもしくはBフレームの符号化処理の場合は、上述のように動き補償部60が動作するが、Iフレームの符号化処理の場合は、動き補償部60は動作せず、ここでは図示しないが、Iフレームはフレーム内予測が行われた後、DCT部20に供給される。
In the case of P frame or B frame encoding processing, the
次に、従来の動きベクトルの計算方法について説明し、その後、本発明の一実施形態による動きベクトルの計算方法について説明する。 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、B1フレーム202、B2フレーム203、B3フレーム204、Pフレーム205の順に表示がなされる。符号化の順序はこの表示順序とは異なり、まず同図のIフレーム201が符号化され、次に5番目のPフレーム205がIフレーム201を参照画像として動き補償が行われて符号化される。その後、B2フレーム203が符号化され、B1フレーム202、B3フレーム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
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フレーム201、Pフレーム205の符号化が完了し、B1〜B3フレーム202〜204を符号化する段階であるとする。このB1〜B3フレーム202〜204を「符号化対象フレーム」と呼び、符号化対象フレームより前に表示されるIフレーム201を「前方参照フレーム」と、符号化対象フレームより後に表示されるPフレーム205を「後方参照フレーム」と呼ぶことにする。また、Pフレーム205の動きベクトルを「MVP」、B1〜B3フレームの動きベクトルを「MVB1〜MVB3」と表記する。
なお、図2では、二次元画像を一次元的に示しているが、実際の動きベクトルは画像の水平方向と垂直方向の二次元成分を持つことに注意する。
At this time, it is assumed that the encoding of the
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を指し示す動きベクトルMVP225を求める。次に、符号化対象フレーム203内のマクロブロック213について、前方参照フレーム201または後方参照フレーム205のいずれかのマクロブロックを指し示す動きベクトルMVB2222を求める。図2では、前方参照フレーム201を指した場合を示す。続いて、符号化対象フレーム202内のマクロブロック212について、前方参照フレーム201または後方参照フレーム205のいずれかのマクロブロックを指し示す動きベクトルMVB1221を求める。
As shown in FIG. 2, a
本実施の形態では、上記のようにして求められた符号化対象フレーム内の各マクロブロックの動きベクトル(以下、「符号化対象動きベクトル」という)をそのまま符号化する代わりに、後方参照フレームまたは前方参照フレームの動きベクトル(以下、「参照動きベクトル」という)に係数を乗じて符号化対象動きベクトルを表現し、参照動きベクトルと係数を符号化するようにした。これによって、動きベクトルデータの符号量を削減することができる。 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の動きベクトルMVPを利用した場合について説明するが、前方参照フレーム201の動きベクトルや他の動きベクトルを使用してもよい。
In the following, already a case is explained using the motion vector MV P of the
図3は、本実施の形態に係る動き補償部60の構成を説明する図である。
動き補償部60は、後方参照フレーム205の動き補償を行ったときに、後方参照フレーム205の各マクロブロックの動きベクトルMVPを検出しており、既に検出した後方参照フレーム205の動きベクトル情報を動きベクトル保持部62に保持する。
FIG. 3 is a diagram illustrating the configuration of the
ブロックマッチング部61は、後方参照フレーム205内のマクロブロックとのブロックマッチングによって、符号化対象フレーム202〜204内で動き補償予測の対象となるマクロブロックを特定する。
The
符号化対象フレーム内で動き補償予測の対象となるマクロブロックを特定するには、以下の手順で行う。まず、通常のブロックマッチングなどの手法により、符号化対象フレームのマクロブロックの動きベクトル(以下、この項において「通常動きベクトル」という)を求める。続いて、符号化対象フレーム上でこの通常動きベクトルが指している位置を含む一定の範囲を定める。そして、定めた範囲内を通過する、後方参照フレームの動きベクトルを抽出する。複数の動きベクトルが抽出された場合には、先に求めた通常動きベクトルが指している位置に最も近い位置を通過する動きベクトルを選択する。このようにして抽出または選択された動きベクトルが、符号化対象フレームのマクロブロックが参照すべき参照動きベクトルMVPと考えることができる。 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
比率計算部64は、参照動きベクトルの情報を動きベクトル保持部62から参照して、符号化対象フレーム202〜204について、参照動きベクトルMVPの各成分と符号化対象動きベクトルMVB1〜MVB3の各成分との比を求める。B1フレーム202、B2フレーム203、B3フレーム204についての比率をc1、c2、c3と表すと、次式のようになる。
c1=[MVB1]/[MVP]
c2=[MVB2]/[MVP]
c3=[MVB3]/[MVP]
ここで、[MVB1]〜[MVB3]、[MVP]は、それぞれの動きベクトルの水平方向成分、または垂直方向の成分を表す。ここでは、簡単のためにひとつの方向の成分について述べているが、実際には全ての成分について計算する。
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で計算された比率c1〜c3を参照して、当該マクロブロックの運動状態を推定する。具体的には、まず、隣接する符号化対象フレーム間の各マクロブロックについて、比率の差分を取る。符号化対象フレームが3フレームであれば、(c2−c1)、(c3−c2)を計算する。そして、これら差分値の関係を検討する。
The
差分値が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は、選択した運動モードにしたがって、参照動きベクトルMVPから符号化対象動きベクトルMVB1〜MVB3を求めるための係数α1〜α3を計算する。この係数α1〜α3は、前方参照フレームと符号化対象フレームとの間の時間間隔に基づいて決定される。これについては、図4ないし図6を参照して後述する。
The exercise
誤差計算部67は、参照動きベクトルMVPに運動モード選択部66で計算された係数を乗じて求めた動きベクトルα1・MVP〜α3・MVPと、符号化対象動きベクトルMVB1〜MVB3との誤差を表す調整ベクトルβ1〜β3を計算する。調整ベクトルβの計算方法については後述する。
Error calculating unit 67, a reference motion vector MV motion vector obtained by multiplying the calculated coefficients in the motion
動き補償予測部68は、係数αと調整ベクトルβにより表される各マクロブロックの動きベクトル(α・MVP+β)を使用して動き補償を行い、予測画像を生成し、差分器12、加算器14に出力する。
The motion
可変長符号化部90は、運動モード選択部66で選択された運動モードを表す情報、および各マクロブロックの係数α、調整ベクトルβを符号化して、符号化ストリームに含める。
The variable
次に、図4ないし図6を参照して、運動モード選択部66により係数αを求める方法について説明する。なお、図4ないし図6は、従来の動きベクトルについて説明した図2と同じ符号を用いており、図2と共通する説明は省略する。
Next, a method for obtaining the coefficient α by the motion
図4(a)、(b)は、マクロブロックが等速度運動している場合を示す。運動モード選択部66により等速度運動と推定されたとき、後方参照フレーム205の参照動きベクトルMVPを、フレーム間の時間間隔に比例して配分することによって、符号化対象フレーム202〜204の係数α1〜α3を求めることができる。後方参照フレーム205の参照マクロブロック215の動きベクトルMVPは、後方参照フレーム205と前方参照フレーム201との時間差tの間に、参照マクロブロック215が動く量と方向を示すものであるから、マクロブロックが等速度運動していると推定された場合、符号化対象フレーム202〜204において、各符号化対象フレームと前方参照フレーム201の時間差trの間に、MVP×(tr/t)の動きを示すことが予測される。したがって、図4(a)に示すように、符号化対象フレームが3枚の場合には、B1フレーム202ではα1=0.25、B2フレーム203ではα2=0.5、B3フレーム204ではα3=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
このように、等速度運動モードにおいては係数α1〜α3を計算で求めることができるので、動きベクトルMVB1〜MVB3を符号化する代わりに、等速度運動モードについての情報と参照動きベクトルMVPとを符号化すればよい。 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の参照動きベクトルMVPを、フレーム間の時間間隔に基づいて配分することによって、符号化対象フレーム202〜204の係数α1〜α3を求めることができる。マクロブロックが等加速度運動していると推定された場合、符号化対象フレーム202〜204において、各符号化対象フレームと前方参照フレーム201の時間差trの間に、MVP×(tr2/t2)の動きを示すことが予測される。言い換えると、係数αはフレーム間の時間間隔の二乗に比例した値となる。したがって、図5(a)に示すように、符号化対象フレームが3枚の場合には、B1フレーム202ではα1=0.0625、B2フレーム203ではα2=0.25、B3フレーム204ではα3=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
このように、等加速運動モードにおいても係数α1〜α3を計算で求めることができるので、動きベクトルMVB1〜MVB3を符号化する代わりに、等加速度運動モードについての情報と参照動きベクトルMVPとを符号化すればよい。 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)は、マクロブロックが不規則運動している場合を示す。この場合は、係数α1〜α3を計算から求めることができないので、上述した比率c1〜c3を各符号化対象フレーム202〜204についての係数とみなす。すなわち、α1=c1、α2=c2、α3=c3である。不規則運動モードの場合には、動きベクトルMVB1〜MVB3を符号化する代わりに、係数α1〜α3と参照動きベクトルMVPを符号化する。 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は、調整ベクトルβの計算方法を説明する図である。B2フレーム203を例とすると、調整ベクトルβ2は、通常の手法で求められる動きベクトルMVB2 222と、参照動きベクトルMVPに係数α2を乗じて得られるα2・MVP 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
図8は、本実施の形態にしたがった動きベクトルの符号化方法を示すフローチャートである。まず、動き補償部60は、後方参照フレーム205内の各マクロブロックについて、前方参照フレーム201を基準とする参照動きベクトルMVPを計算し、これらを動きベクトル保持部62に格納する(S10)。ブロックマッチング部61は、後方参照フレーム205内のマクロブロックとのブロックマッチングによって、符号化対象フレーム202〜204内で動き補償予測の対象となるブロックをそれぞれ特定する(S11)。動きベクトル計算部63は、特定された各ブロックに対して、前方参照フレーム201を基準とした符号化対象動きベクトルMVB1〜MVB3を求める(S12)。比率計算部64は、複数の符号化対象フレームのそれぞれについて、符号化対象動きベクトルMVB1〜MVB3の成分と参照動きベクトルMVPの成分との比率c1〜c3を求める(S14)。運動解析部65は、比率c1〜c3を解析して、複数の符号化対象フレーム間における各ブロックの運動状態を推定し、運動モード選択部66は、推定された運動状態を表す運動モードを選択する(S16)。運動モード選択部66は、選択された運動モードにしたがって、参照動きベクトルMVPから符号化対象動きベクトルMVB1〜MVB3を求めるための係数α1〜α3を求める(S18)。さらに、誤差計算部67は、符号化対象動きベクトルMVB1〜MVB3と、参照動きベクトルMVPに係数α1〜α3を乗じて得られるベクトルとの誤差を表す調整ベクトルβ1〜β3を求める(S20)。運動モード、係数α、調整ベクトルβは、可変長符号化部90に出力されて、上述した手順にしたがって符号化され、それらの符号化情報は符号化ストリームに含められる(S22)。
FIG. 8 is a flowchart showing a motion vector encoding method according to the present embodiment. First, the
なお、上述したように、符号化対象動きベクトルの成分と参照動きベクトルの成分との比較は、水平方向と垂直方向の両方で行う。物体の運動が直線的な場合には、水平方向と垂直方向の比率はほぼ等しくなるので、運動モード、係数α、調整ベクトルβを同一のものとすることによって、さらに符号量を減らすことができる。物体の運動が直線的でない場合には、水平成分と垂直成分のそれぞれについて、運動モード、係数α、調整ベクトルβを符号化する。 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ビットの符号を与える。ここで、図中「通常」と表した運動モードは、従来の方法で検出される動きベクトルMVBをそのまま使用するモードである。
FIG. 9 shows an example of the correspondence between motion modes and codes. In this example, the variable
可変長符号化部90は、等速度運動モードおよび等加速度運動モードが選択されている場合には、係数αを符号化する必要はない。不規則運動モードの場合には、各符号化対象フレームについての係数αの全てを符号化する必要がある。
The variable
係数αは、そのまま符号化してもよいが、通常、係数αの値は小数となるため、符号化するとかえって符号量が増大してしまうおそれがある。そこで、係数αを符号化する際、可変長符号化部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-
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
可変長符号化部90は、運動モードの情報は複数のフレームに対してひとつだけ符号化すればよい。つまり、ひとつのGOP内のフレームについて、ある参照フレームに基づいて動きベクトルを求めているので、運動モードについては、GOP単位でひとつ定めれば十分である。係数αや調整ベクトルβについては、マクロブロック毎に符号化する必要がある。但し、マクロブロックの運動モードが等速度運動モードまたは等加速度運動モードの場合には、係数αを符号化する必要はない。
The variable
運動モードをまとめるのは、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
復号装置300は、符号化ストリームの入力を受け取り、符号化ストリームを復号して出力画像を生成する。
The
可変長復号部310は、入力された符号化ストリームを可変長復号し、復号された画像データを逆量子化部320に供給し、動きベクトル情報を動き補償部360に供給する。
The variable
逆量子化部320は、可変長復号部310により復号された画像データを逆量子化し、逆DCT部330に供給する。逆量子化部320により逆量子化された画像データはDCT係数である。逆DCT部330は、逆量子化部320により逆量子化されたDCT係数を逆離散コサイン変換(IDCT)することにより、元の画像データを復元する。逆DCT部330により復元された画像データは、加算器312に供給される。
The
加算器312は、逆DCT部330から供給された画像データがIフレームである場合、そのIフレームの画像データをそのまま出力するとともに、PフレームやBフレームの予測画像を生成するための参照画像として、フレームメモリ380に格納する。
When the image data supplied from the
加算器312は、逆DCT部330から供給された画像データがPフレームである場合、その画像データは差分画像であるから、逆DCT部330から供給された差分画像と動き補償部360から供給される予測画像を加算することにより、元の画像データを復元し出力する。
When the image data supplied from the
動き補償部360は、可変長復号部310から供給される動きベクトル情報と、フレームメモリ380に格納された参照画像を用いて、PフレームまたはBフレームの予測画像を生成し、加算器312に供給する。
The
図12は、動き補償部360の構成図である。以下、本実施の形態で符号化されたBフレームを復号するための動き補償部360の動作を説明する。動き補償部360は、後方参照フレームの動き補償を行ったときに、後方参照フレームの各マクロブロックの動きベクトルを検出しており、既に検出した後方参照フレームの動きベクトル情報やマクロブロックの情報を動きベクトル保持部364に保持しておく。
FIG. 12 is a configuration diagram of the
動きベクトル取得部361は、可変長復号部310から動きベクトル情報を取得する。この動きベクトル情報には、上述した運動モード、比例係数αおよび調整ベクトルβが含まれる。動きベクトル取得部361は、動きベクトル情報を動きベクトル計算部362に与える。運動モードを符号化ストリームに含めることによって、ひとつの符号化対象フレーム内に複数の運動モードが含まれていても、動き補償部360において、比例係数αおよび調整ベクトルβから元の動きベクトルを復元することができる。
The motion
動きベクトル計算部362は、動きベクトル保持部364から後方参照Pフレームのマクロブロックの動きベクトルを取得し、符号化対象フレームの動きベクトルを計算する。計算された動きベクトルは、動き補償予測部366に与えられるとともに、他のフレームの動きベクトルの計算に使用するために、動きベクトル保持部364に保持される。
The motion
動き補償予測部366は、受け取った動きベクトルを用いて符号化対象フレームの予測画像を生成して加算器312に出力する。
The motion
以上説明したように、本実施の形態によれば、後方参照フレーム(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
上述の実施形態では、比率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.
別の方法として、通常の手順で求められる動きベクトルMVBよりも差分画像の符号量が減少する場合にのみ、上述した運動モードにしたがった動きベクトルの符号化を実行するようにしてもよい。 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は、通常の動きベクトルMVBを計算し、図示しない符号量推定部は、動きベクトルMVBを利用して予測画像を生成したときの差分画像の符号量を算出する。続いて、動き補償予測部68は、等速度運動モードまたは等加速度運動モードにしたがって動きベクトルα・MVPを計算し、符号量推定部は、動きベクトルα・MVPを利用して予測画像を生成したときの差分画像の符号量を算出する。そして、2つの差分画像の符号量を比較して、等速度運動モードまたは等加速度運動モードの動きベクトルα・MVPの方が符号量が小さいときにのみ、等速度運動モードまたは等加速度運動モードのいずれかを選択する。
Specifically, first, the motion
上述の実施形態では、マクロブロック単位で動きベクトルを検出する場合について説明したが、ブロック(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を基準とする参照動きベクトルMVPを計算し、これらを動きベクトル保持部62に格納する。ブロックマッチング部61は、後方参照フレーム205内のスライスまたは注目領域とのマッチングによって、符号化対象フレーム202〜204内で動き補償予測の対象となるスライスまたは注目領域をそれぞれ特定する。動きベクトル計算部63は、特定された各スライスまたは注目領域に対して、前方参照フレーム201を基準とした符号化対象動きベクトルMVB1〜MVB3を求める。比率計算部64は、複数の符号化対象フレームのそれぞれについて、符号化対象動きベクトルMVB1〜MVB3の成分と参照動きベクトルMVPの成分との比率c1〜c3を求める。運動解析部65は、比率c1〜c3を解析して、複数の符号化対象フレーム間における各スライスまたは注目領域の運動状態を推定し、運動モード選択部66は、推定された運動状態を表す運動モードを選択する。運動モード選択部66は、選択された運動モードにしたがって、参照動きベクトルMVPから符号化対象動きベクトルMVB1〜MVB3を求めるための係数α1〜α3を求める。さらに、誤差計算部67は、符号化対象動きベクトルMVB1〜MVB3と、参照動きベクトルMVPに係数α1〜α3を乗じて得られるベクトルとの誤差を表す調整ベクトルβ1〜β3を求める。運動モード、係数α、調整ベクトルβは、可変長符号化部90に出力されて、上述した手順にしたがって符号化され、それらの符号化情報は、スライスまたは注目領域毎に符号化ストリームに含められる。
Specifically, the
さらに、符号化対象フレーム内のマクロブロック毎に運動モードを決定する代わりに、フレーム単位または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は、選択された運動モードにしたがって改めて符号化を実行し、この段階で符号化データが出力される。
手順2.動き補償部60は、候補となる運動モード毎に、フレーム単位またはGOP単位で符号化を実行する。つまり、ひとつの運動モードを全てのマクロブロックまたはフレーム内領域について適用して符号化を実行する。この段階では符号化データを出力しないが、符号化データそのものと符号化データの符号量とを符号量保持部に保持しておく。全ての運動モードについて符号化データの符号量を計算した後、運動モード選択部66は、符号量が最小となる運動モードを選択する。そして、選択された運動モードに対応する符号化データが符号量保持部から出力される。
手順1、2のうち、運動モードの選択後に改めて符号化をし直す分だけ、手順1の方が手順2よりも符号化に要する計算量が多くなる。しかし、手順2の方は、運動モード毎に符号化データ自体と符号量とを保持しておく必要があるため、手順1より多くの記憶領域が必要となる。このように、手順1と手順2とはトレードオフの関係にあるので、状況に応じて適切な方を選択すればよい。
Of the
さらに、上述の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
図示しない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
また、MCTF処理部は、階層1の低域フレーム112、114からさらに高域フレーム121と低域フレーム122とを生成する。これらを階層2と称する。MCTF処理部は、二枚の低域フレーム112、114から動きベクトルMV0を検出する。
The MCTF processing unit further generates a high-
なお、図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の動きベクトルMV0の半分であるので、動きも半分と推定される。そこで、動きベクトルMV1aとMV1bとを以下の計算式で算出する。
MV1a=(1/2)・MV0+βa
MV1b=(1/2)・MV0+βb
ここで、βa、βbは予測値とのずれを表す調整ベクトルである。したがって、階層1の動きベクトルMV1aとMV1bを符号化する代わりに、階層0の動きベクトルMV0と調整ベクトルβa、βbを符号化すればよい。
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
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
なお、上記計算式から分かるように、階層0の動きベクトルMV0が求められるまで階層1を符号化することはできない。そこで、階層0の動きベクトルMV0を求めるまでの間、階層1の動きベクトル情報と差分情報とを保持しておく必要がある。
As can be seen from the above equation,
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
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
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.
特定されたブロックについて、前記符号化対象動きベクトルを求めることを特徴とする請求項1に記載の符号化方法。 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.
前記係数は、前記第1の参照ピクチャと前記符号化対象ピクチャ間の時間間隔に基づいて決定されることを特徴とする請求項4に記載の符号化方法。 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の参照ピクチャと前記符号化対象ピクチャ間の時間間隔に基づいて決定されることを特徴とする請求項4に記載の符号化方法。 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.
第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.
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)
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 |
-
2006
- 2006-06-30 JP JP2006182516A patent/JP4169767B2/en not_active Expired - Fee Related
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 |