[go: up one dir, main page]

JPH11308617A - Digital image coder and motion vector detector used therefor - Google Patents

Digital image coder and motion vector detector used therefor

Info

Publication number
JPH11308617A
JPH11308617A JP11350298A JP11350298A JPH11308617A JP H11308617 A JPH11308617 A JP H11308617A JP 11350298 A JP11350298 A JP 11350298A JP 11350298 A JP11350298 A JP 11350298A JP H11308617 A JPH11308617 A JP H11308617A
Authority
JP
Japan
Prior art keywords
image data
motion vector
image
reference image
search range
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.)
Pending
Application number
JP11350298A
Other languages
Japanese (ja)
Inventor
Yuichi Okuda
裕一 奥田
Yukio Isobe
幸雄 磯部
Satoshi Motosu
聰 本巣
Tomoo Kobori
智生 小堀
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.)
Hitachi Ltd
Original Assignee
Hitachi 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 Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP11350298A priority Critical patent/JPH11308617A/en
Publication of JPH11308617A publication Critical patent/JPH11308617A/en
Pending legal-status Critical Current

Links

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

PROBLEM TO BE SOLVED: To reduce the power consumption of an MPEG2 coder by reducing the arithmetic operation amount for motion estimation, while minimizing deterioration in image quality and to attain motion estimate with high precision by panning information. SOLUTION: A motion vector detection section 7c retrieves a motion vector of an MB to be coded in an input image buffer 7a from reference image data in a reference image buffer 7b and selects a width of a retrieval range set to a motion vector detection section 7c, depending on whether or not a variance of the motion vector obtained by a variance calculation section 7h is smaller than a threshold level and applies an offset depending on the mean value of the motion vector which is obtained by a mean value calculation section 7g for a narrow retrieval range. Furthermore, when panning information is fed to a value latch section 7e via a CPU IF 8 externally, the retrieval range of the motion vector detection section 7c is made wide or narrow, depending on the panning information and an offset depending on the panning information is applied to the retrieval range, when the retrieval range is narrow.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、ディジタル画像信
号を高能率で符号化するディジタル画像信号符号化装置
と、これに用いられ、時間軸方向の冗長度を削減する動
き補償(フレーム間予測)に必要な動きベクトルを検出す
る動きベクトル検出装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a digital image signal encoding apparatus for encoding a digital image signal with high efficiency, and a motion compensation (inter-frame prediction) used in the digital image signal encoding apparatus for reducing redundancy in a time axis direction. The present invention relates to a motion vector detecting device that detects a motion vector required for a motion vector.

【0002】[0002]

【従来の技術】ディジタル画像信号符号化装置として、
従来、例えば、「ITU−Tホワイトブック、オーディオビ
ジュアル/マルチメディア関連(Hシリーズ)勧告集」財
団法人日本ITU協会 平成7年2月18日発行 pp.375〜595
(以下、文献1という)に規定されている動画像圧縮技
術H.262(通称、MPEG2方式)による符号化装置
が知られている。MPEG2方式は放送や通信,蓄積メ
ディアなどの多様なアプリケーションに適用されること
を前提とする汎用的な規格である。
2. Description of the Related Art As a digital image signal encoding device,
Conventionally, for example, “ITU-T White Book, Audiovisual / Multimedia-Related (H Series) Recommendations,” Japan ITU Association, published February 18, 1995, pp. 375-595
2. Description of the Related Art There is known an encoding apparatus based on a moving image compression technique H.262 (commonly referred to as an MPEG2 system) specified in (hereinafter, referred to as Document 1). The MPEG2 system is a general-purpose standard that is premised on being applied to various applications such as broadcasting, communication, and storage media.

【0003】MPEG2方式において、時間軸方向の冗
長度を削減するために、動き補償を行ない、高い圧縮効
率を得ている。動き補償とは、圧縮する画像(ピクチャ)
を16×16画素からなるマクロブロックMBに分割
し、マクロブロックMB毎に参照画像中の動きベクトル
によって示される16×16画素からなる画像データと
の差分をとり、その差分画像データを符号化するもので
ある。
[0003] In the MPEG2 system, in order to reduce the redundancy in the time axis direction, motion compensation is performed to obtain high compression efficiency. Motion compensation is the image to be compressed (picture)
Is divided into macroblocks MB consisting of 16 × 16 pixels, a difference between the macroblock MB and image data consisting of 16 × 16 pixels indicated by a motion vector in the reference image is obtained, and the difference image data is encoded. Things.

【0004】MPEG2方式では、、動きベクトルを用
いた動き補償によって差分画像データを符号化したマク
ロブロックMBをノンイントラ(フレーム間予測符号
化)MBという、動きベクトルを使用せずに差分をとら
ないで符号化したマクロブロックMBをイントラ(フレ
ーム内予測符号化)MBという。また、イントラMBの
みで構成されるピクチャをIピクチャといい、参照画像
データとして表示順で過去のピクチャの画像データのみ
を使用するピクチャをPピクチャといい、参照画像デー
タとして表示順で過去と未来の両方のピクチャの画像デ
ータを使用することができるピクチャをBピクチャとい
う。なお、このBピクチャの参照画像データとして使用
するのはIピクチャとPピクチャの画像データであり、
Bピクチャの画像データは参照画像データとして用いら
れない。
In the MPEG2 system, a macroblock MB obtained by encoding differential image data by motion compensation using a motion vector is called a non-intra (inter-frame predictive encoding) MB, and no difference is obtained without using a motion vector. The macroblock MB coded in (1) is called an intra (intra-frame predictive coding) MB. Also, a picture composed of only intra MBs is called an I picture, a picture that uses only image data of a past picture in display order as reference image data is called a P picture, and past and future pictures are displayed as reference image data in display order. A picture in which image data of both pictures can be used is called a B picture. Note that the image data of the I picture and the P picture are used as the reference image data of the B picture.
The image data of the B picture is not used as reference image data.

【0005】ここで、参照画像データとして用いること
ができるI,Pピクチャを参照画像ということにする
が、連続して配置されるx枚の画像(ピクチャ)毎に参
照画像が現れる場合、符号化されたMPEG2ビットス
トリームのm値はxであるという。
[0005] Here, I and P pictures that can be used as reference image data are referred to as reference images. When a reference image appears for every x images (pictures) arranged continuously, coding is performed. It is said that the m value of the MPEG2 bit stream thus obtained is x.

【0006】動き補償に用いる動きベクトルを検出する
ためには、符号化すべき入力画像データと参照画像デー
タとを8×8画素からなるブロック単位でマッチングを
とるブロックマッチングという手法が、主に、用いられ
ている。
In order to detect a motion vector used for motion compensation, a method called block matching in which input image data to be coded and reference image data are matched in blocks of 8 × 8 pixels is mainly used. Have been.

【0007】MPEG2方式での符号化では、この動き
ベクトルを探索する動き推定(Motion Estimation:以
下、MEという)の処理に必要な演算量が、一般に、そ
の他の演算である離散コサイン変換や量子化,可変長符
号化などと比較して、非常に多いものとなる。そして、
演算量の多さは消費電力の増加につながり、MPEG2
方式による符号化装置(以下、MPEG2符号化装置と
いう)における消費電力は、主に、ME処理に費やされ
る。
In the coding by the MPEG2 system, the amount of computation required for the processing of motion estimation (hereinafter referred to as ME) for searching for the motion vector generally involves discrete cosine transform or quantization which is other computation. , Variable length coding and the like. And
The large amount of calculation leads to an increase in power consumption, and MPEG2
Power consumption in a coding apparatus based on the scheme (hereinafter, referred to as an MPEG2 coding apparatus) is mainly spent on ME processing.

【0008】符号化された画像の画質劣化を押さえつ
つ、ME処理の演算量を削減するために、従来では、例
えば、「1997年電子情報通信学会総合大会C−12−34」
(以下、文献2という)で発表されているように、過去
の動きベクトルの履歴を利用して探索範囲の形を適応的
に変化させることにより、画質劣化をおさえつつ動きベ
クトルの探索範囲を狭くするという方法が知られてい
る。
In order to reduce the amount of calculation of the ME processing while suppressing the deterioration of the image quality of the encoded image, conventionally, for example, "1997 IEICE General Conference C-12-34"
(Hereinafter referred to as Reference 2), the shape of the search range is adaptively changed using the history of past motion vectors, thereby narrowing the search range of the motion vector while suppressing image quality deterioration. There is a known method.

【0009】[0009]

【発明が解決しようとする課題】近年のディジタル技術
の発展により、動画像を扱う機器はより小さく、より軽
くなっている。この小型・軽量化技術の発展により、今
後ますます携帯機器の需要が高まって行く。
With the recent development of digital technology, devices for handling moving images have become smaller and lighter. Due to the development of the technology for reducing the size and weight, the demand for portable devices will continue to increase.

【0010】ところで、これら携帯機器は電池によって
駆動されるので、電池の寿命をより長く持たせるために
は、より低消費電力の回路を使用することが望まれる。
MPEG2符号化装置では、演算量の大半はMEに当て
られているので、ここでの消費電力を低減するために
は、動きベクトルの探索範囲を縮小したり、探索を簡略
化したりしてMEの演算量を削減することが考えられる
が、このことは符号化された画質に悪影響を及ぼすとい
う第1の問題があった。
Incidentally, since these portable devices are driven by a battery, it is desirable to use a circuit with lower power consumption in order to extend the life of the battery.
In the MPEG2 encoding apparatus, most of the calculation amount is devoted to the ME. To reduce the power consumption, the search range of the motion vector is reduced or the search is simplified to reduce the ME. Although it is conceivable to reduce the amount of calculation, there is a first problem that this adversely affects the encoded image quality.

【0011】また、上記文献2に記載のように、動きベ
クトルの探索範囲の形を適応的に変化させる方法では、
探索範囲の形を複雑に制御することにより、大きな探索
範囲を持つ場合とほぼ同等の画質が得られるが、文献2
には、探索範囲の形を決定する制御方法が示されておら
ず、その機能を充分に使うことができないであろうこと
が考えられる。
Further, as described in the above reference 2, the method of adaptively changing the shape of the search range of the motion vector is as follows:
By controlling the shape of the search range intricately, an image quality almost equal to that having a large search range can be obtained.
Does not show a control method for determining the shape of the search range, and it is conceivable that the function may not be fully used.

【0012】一方、MPEG2符号化をシステム全体と
して考えたとき、パンが行なわれる場合、画面全体のパ
ンの情報はMPEG2符号化装置以外の手段によって検
出している場合がある。また、パンが行なわれていると
きには、動きベクトルがパンによって移動した先を表わ
している場合が多いので、ME処理を行なう装置が動き
ベクトルを探索する範囲は、パンによって移動した先の
周囲に限ってもよく、それ以外の場所を探索するのは無
駄が多いという第2の問題があった。
On the other hand, when panning is performed when MPEG2 encoding is considered as a whole system, pan information of the entire screen may be detected by means other than the MPEG2 encoding device. Also, when panning is performed, the motion vector often indicates the destination moved by panning, and therefore the range in which the apparatus performing the ME process searches for the motion vector is limited to the area around the destination moved by panning. However, there is a second problem that searching for other places is wasteful.

【0013】本発明の第1の目的は、上記第1の問題を
解消し、簡易な回路構成でもって、符号化された画像の
画質劣化を抑えつつMEの演算量を削減し、MPEG2
符号化装置の消費電力を低減することができるようにし
たディジタル画像符号化装置とこれに用いる動きベクト
ル検出装置を提供することにある。
A first object of the present invention is to solve the first problem and to reduce the amount of operation of the ME while suppressing the deterioration of the quality of an encoded image by using a simple circuit configuration.
An object of the present invention is to provide a digital image encoding device capable of reducing power consumption of an encoding device and a motion vector detecting device used for the digital image encoding device.

【0014】本発明の第2の目的は、上記第2の問題を
解消し、外部で検出されたパンの情報をMPEG2符号
化装置で有効に利用し、動きベクトルの無駄な探索動作
をなくすようにしたディジタル画像符号化装置とこれに
用いる動きベクトル検出装置を提供することにある。
A second object of the present invention is to solve the second problem and effectively utilize the information of the pan detected externally in the MPEG2 encoding apparatus so as to eliminate unnecessary search operations for motion vectors. It is another object of the present invention to provide a digital image encoding device and a motion vector detecting device used therefor.

【0015】[0015]

【課題を解決するための手段】上記第1の目的を達成す
るために、本発明は、MEを行なう回路ブロックに、動
きベクトルの探索範囲を制限するモードと該探索範囲に
オフセットをつける機能とこれらを自律的に初期状態に
戻す機能とを設けたものである。
In order to achieve the first object, the present invention provides a circuit block for performing ME, a mode for limiting a search range of a motion vector and a function for offsetting the search range. A function of autonomously returning these to the initial state is provided.

【0016】通常、動画像の時間軸方向の相関は高い
が、あるときは相関が低くなる。一般に、時間軸方向の
相関が高い動画像をMPEG2で符号化する場合には、
動きベクトルがほぼ同一の方向を指す場合が多い。一
方、時間軸方向の相関が低い動画像をMPEG2で符号
化する場合、動きベクトルはランダムな方向を指す。従
って、過去の参照画像データを用いた動きベクトルの探
索の結果、この動きベクトルの方向が似たようなところ
に集中しているときには、探索範囲を制限するモードを
設定するとともに、制限した探索範囲のオフセット(も
との広い探索範囲内での位置を決めるもの)を適宜設定
する。また、この制限された探索範囲が正しい動きベク
トルを検出できる範囲から外れているようであれば、自
律的に探索範囲を初期の広い状態に戻す。
Normally, the correlation of a moving image in the time axis direction is high, but in some cases, the correlation is low. Generally, when a moving image having a high correlation in the time axis direction is encoded by MPEG2,
In many cases, the motion vectors point in substantially the same direction. On the other hand, when a moving image having low correlation in the time axis direction is encoded by MPEG2, the motion vector points in a random direction. Therefore, as a result of a search for a motion vector using past reference image data, when the direction of the motion vector is concentrated in a similar place, a mode for limiting the search range is set, and (Which determines the position within the original wide search range) is set as appropriate. If the limited search range is out of the range in which a correct motion vector can be detected, the search range is returned to the initial wide state autonomously.

【0017】このようにすることにより、動きベクトル
の探索結果に大きな影響を与えることなく探索範囲を狭
くすることができ、この結果、MEの演算量が削減され
るので、符号化された画像の画質劣化を抑えつつMPE
G2符号化装置の低消費電力化を実現することができ
る。
By doing so, the search range can be narrowed without greatly affecting the search result of the motion vector, and as a result, the amount of calculation of the ME is reduced. MPE while suppressing image quality degradation
Low power consumption of the G2 encoding device can be realized.

【0018】上記第2の目的を達成するために、本発明
は、上記の探索範囲を制限するモードとこの探索範囲に
オフセットをつける機能とを外部から設定することがで
きるようするとともに、MPEG2符号化装置で検出さ
れた動きベクトルに関する情報を外部から参照すること
ができるようにした。
In order to achieve the second object, the present invention provides a mode for limiting the search range and a function for offsetting the search range from the outside. The information on the motion vector detected by the conversion device can be externally referred to.

【0019】MPEG2符号化装置の外部で検出したパ
ン情報からどのような動きベクトルが検出されるかを予
測し、その予測された値を上記のオフセット値として設
定する。また、実際に検出された動きベクトルに関する
情報から探索範囲を制限してもよいかどうか判断し、上
記の探索範囲を制限するモードを設定する。このように
することにより、外部で検出されたパンの情報をMPE
G2符号化装置で有効に利用することが可能になる。
A motion vector to be detected is predicted from pan information detected outside the MPEG2 coding apparatus, and the predicted value is set as the above-mentioned offset value. In addition, it is determined whether or not the search range may be limited based on information on the actually detected motion vector, and a mode for limiting the search range is set. By doing so, the information of the bread detected externally can be stored in the MPE.
It can be used effectively in the G2 encoding device.

【0020】[0020]

【発明の実施の形態】以下、本発明の実施形態を図面を
用いて説明する。図1は本発明によるディジタル画像符
号化装置の第1の実施形態を示すブロック図であって、
1は画像データの入力端子、2はMPEG2符号化装
置、3はSDRAM(同期式記憶保持動作が必要な随時
読出し,書込み動作が可能な半導体記憶素子)ブロッ
ク、4はCPU(中央処理ユニット)ブロック、5はビ
ットストリームの出力端子、6はVIDEO(ビデオ)
ブロック、7はME(動き推定処理)ブロック、8はC
PU IF(CPUインターフェース)ブロック、9は
MC(動き補償)ブロック、10はJUDGE(判定)
ブロック、11はDCT/IDCT(離散コサイン変換/
逆離散コサイン変換)ブロック、12はQ/IQ(量子
化/逆量子化)ブロック、13はRATE(レート制
御)ブロック、14はVLC(可変長符号化)ブロッ
ク、15はCODE(コード)ブロック、16はSDR
AMアドレスバス、17はSDRAMデータバスであ
る。
Embodiments of the present invention will be described below with reference to the drawings. FIG. 1 is a block diagram showing a first embodiment of a digital image encoding device according to the present invention.
1 is an image data input terminal, 2 is an MPEG2 encoding device, 3 is an SDRAM (semiconductor storage element that can be read and written at any time that requires a synchronous storage operation), and 4 is a CPU (central processing unit) block. , 5 is a bit stream output terminal, 6 is VIDEO (video)
Block, 7 is a ME (motion estimation processing) block, 8 is C
PU IF (CPU interface) block, 9 is MC (motion compensation) block, 10 is JUDGE (judgment)
Block 11 is DCT / IDCT (discrete cosine transform /
Inverse discrete cosine transform) block, 12 is a Q / IQ (quantization / inverse quantization) block, 13 is a RATE (rate control) block, 14 is a VLC (variable length coding) block, 15 is a CODE (code) block, 16 is SDR
An AM address bus 17 is an SDRAM data bus.

【0021】同図において、SDRAMブロック3は
I,Pピクチャの画像データが参照画像データとして格
納されており、SDRAMアドレスバス16から読出ア
ドレスが供給されることにより、SDRAMブロック3
でのこの読出アドレスによる領域から参照画像データが
読み出されてSDRAMデータバス17に出力される。
これをSDRAMブロック3からの読出しという。ま
た、SDRAMアドレスバス16から書込アドレスが、
SDRAMデータバス17から画像データが夫々供給さ
れると、SDRAMブロック3でのこの書込アドレスに
よる領域にこの画像データが書き込きれる。これをSD
RAMブロック3への書込みという。
Referring to FIG. 1, the SDRAM block 3 stores image data of I and P pictures as reference image data. When a read address is supplied from an SDRAM address bus 16, the SDRAM block 3
The reference image data is read from the area corresponding to the read address at step (1) and output to the SDRAM data bus 17.
This is called reading from the SDRAM block 3. Also, the write address from the SDRAM address bus 16 is
When the image data is supplied from the SDRAM data bus 17, respectively, the image data can be written in the area of the SDRAM block 3 corresponding to the write address. This is SD
This is called writing to the RAM block 3.

【0022】次に、MPEG2符号化装置2の各部の動
作について説明する。
Next, the operation of each unit of the MPEG2 encoder 2 will be described.

【0023】MPEG2方式では、画像(ピクチャ)の動
き補償を行なうための参照画像として、表示順で過去と
未来の両方の画像を使用可能とする。このために、画像
の入力順(即ち、表示順)と符号化順は必ずしも一致し
ない。例えば、図7(a)に示すように、ピクチャ
1,P2,P3,P4がその順に入力されたものとする
と、これらが符号化されたときには、図7(b)に示す
ように、ピクチャP1,P4,P2,P3の順となる。
In the MPEG2 system, both past and future images can be used in the display order as reference images for performing motion compensation of an image (picture). For this reason, the input order of the images (that is, the display order) does not always match the encoding order. For example, as shown in FIG. 7A, assuming that pictures P 1 , P 2 , P 3 , and P 4 are input in that order, when these are coded, as shown in FIG. Next, pictures P 1 , P 4 , P 2 , and P 3 are arranged in this order.

【0024】入力端子1から入力される各ピクチャの画
像データはVIDEOブロック6に供給されるが、この
VIDEOブロック6では、入力されるピクチャの順序
が、上記のように、符号化する順に並び替えられ、夫々
のピクチャ毎に輝度信号Yと2つの色差信号(R−Y)
,(B−Y)とに分離されるとともに、これら夫々の信
号毎にマクロブロックMBに分割される。ここで、マク
ロブロックMB中の輝度信号は16×16画素からな
り、マクロブロックMB中の色差信号(R−Y),(B
−Y)(なお、これらをまとめて、色差信号Cという)
は、水平,垂直とも1/2に間引かれて8×8画素から
なっている。かかる輝度信号YはマクロブロックMB毎
に順次MEブロック7,MCブロック9及びJUDGE
ブロック10に供給され、また、2つの色差信号Cもマ
クロブロックMB毎にMCブロック9に供給される。
The image data of each picture input from the input terminal 1 is supplied to the VIDEO block 6. In the VIDEO block 6, the order of the input pictures is rearranged in the encoding order as described above. And a luminance signal Y and two color difference signals (RY) for each picture.
, (BY), and each signal is divided into macroblocks MB. Here, the luminance signal in the macro block MB is composed of 16 × 16 pixels, and the color difference signals (R−Y), (B
-Y) (these are collectively referred to as a color difference signal C)
Is composed of 8 × 8 pixels thinned out in both the horizontal and vertical directions. The luminance signal Y is sequentially supplied to the ME block 7, the MC block 9, and the JUDGE for each macro block MB.
The two color difference signals C are also supplied to the MC block 9 for each macroblock MB.

【0025】MEブロック7は、マクロブロックMB毎
に、VIDEOブロック6からの輝度信号YとSDRA
Mブロック3から読み出された参照画像データD4を用
いて動きベクトルMVを探索し、MCブロック9に供給
する。そこで、MCブロック9は、この探索された動き
ベクトルMVを用いて、マクロブロックMB毎に、VI
DEOブロック6からの輝度信号Yとこのマクロブロッ
クMBに対応するSDRAMブロック3から読み出した
参照画像データD4の輝度成分のマクロブロックMBと
の差分画像データD2を生成する。JUDGEブロック
10は、マクロブロックMB毎に、この差分画像データ
2とVIDEOブロック6からの輝度信号Yとの夫々
の分散値を算出し、これら分散値のうちの小さい方がよ
り少ない符号量で符号化できると判定して、その判定結
果をイントラMB判定信号S4としてMEブロック7,
MCブロック9及びCPU IFブロック8に供給す
る。
The ME block 7 includes a luminance signal Y from the VIDEO block 6 and an SDRA for each macro block MB.
The motion vector MV is searched using the reference image data D 4 read from the M block 3 and supplied to the MC block 9. Thus, the MC block 9 uses the searched motion vector MV to generate a VI
It generates difference image data D 2 between the luminance signal Y and the macro block MB of a luminance component of the reference image data D 4 read from SDRAM block 3 corresponding to this macro block MB from DEO block 6. The JUDGE block 10 calculates the variance of each of the difference image data D 2 and the luminance signal Y from the VIDEO block 6 for each macro block MB, and the smaller one of these variances has a smaller code amount. it is determined that can be coded, ME block 7 the determination result as an intra-MB determination signal S 4,
It is supplied to the MC block 9 and the CPU IF block 8.

【0026】そこで、MCブロック9は、このイントラ
MB判定信号S4からして、輝度信号Yの分散値の方が
小さいと判定されているときには、VIDEOブロック
6から供給されるマクロブロックMBの輝度信号Yの1
6×16画素を、さらに、夫々が8×8画素からなる4
個のブロックに分割し、また、VIDEOブロック6か
ら供給されるマクロブロックMBの色差信号C夫々の8
×8画素をそのままブロックとし、これら6個のブロッ
クを時分割多重してブロックデータD3としてDCT/I
DCTブロック11に供給する。また、差分画像データ
2の分散値の方が小さいと判定されているときには、
この差分画像データD2を夫々8×8画素からなる4個
のブロックに分割し、また、VIDEOブロック6から
供給される2つの色差信号Cと、SDRAMブロック3
から読み出される参照画像データD4の上記動きベクト
ルMVで決まる8×8画素との夫々の色差信号との差分
画像データを生成し、これらをそのままブロックとし
て、これら4個の輝度信号Yのブロックと色差信号Cの
2個のブロックとからなる6個の8×8画素からなるブ
ロックを時分割多重し、ブロックデータD3としてDC
T/IDCTブロック11に供給する。
When the variance of the luminance signal Y is determined to be smaller based on the intra MB determination signal S 4 , the MC block 9 determines the luminance of the macro block MB supplied from the VIDEO block 6. 1 of signal Y
6 × 16 pixels and 4 × 8 × 8 pixels each
Of the macro block MB supplied from the VIDEO block 6 and each of the 8 color difference signals C of the macro block MB.
× 8 pixels are directly used as blocks, and these six blocks are time-division multiplexed to obtain DCT / I as block data D 3.
Supply to DCT block 11. When it is determined that the variance of the difference image data D 2 is smaller,
This difference image data D 2 is divided into four blocks each consisting of 8 × 8 pixels, and two color difference signals C supplied from the VIDEO block 6 and the SDRAM block 3
From the reference image data D 4 read out from the image data and the respective color difference signals of 8 × 8 pixels determined by the motion vector MV, and these are used as blocks as they are, and these four blocks of luminance signals Y time division multiplexing the blocks of two six 8 × 8 pixels comprising a block of the color difference signal C, DC as block data D 3
Supply to T / IDCT block 11.

【0027】以上のようなブロックデータD3は、DC
T/IDCTブロック11で離散コサイン変換され、Q/
IQブロック12で量子化された後、VLCブロック1
4で可変長符号化されてMPEG2ビットストリームと
なる。このMPEG2ビットストリームは、CODEブ
ロック15で送信バッファに一旦蓄積されて読出しが制
御されることにより、所定の一定ビットレートに平滑化
されて出力端子5から出力される。
The block data D 3 as described above is a DC data
The discrete cosine transform is performed by the T / IDCT block 11, and Q /
After being quantized in the IQ block 12, the VLC block 1
4 and is subjected to variable length encoding to form an MPEG2 bit stream. This MPEG2 bit stream is temporarily stored in a transmission buffer by the CODE block 15 and read-out is controlled, so that it is smoothed to a predetermined constant bit rate and output from the output terminal 5.

【0028】また、VLCブロック14で生成した画像
データの符号量の情報がRATEブロック13に供給さ
れ、これと予め設定されたビットレート情報とから、出
力端子5から出力されるMPEG2ビットストリームの
ビットレートを一定に保つためには、Q/IQブロック
12でどの程度粗く量子化をかけるべきかを算出し、Q
/IQブロック12はこの算出値に応じた量子化を行な
う。また、RATEブロック13は、この一定のビット
レートが破綻しないために許容できる1マクロブロック
MB当りの発生符号量を算出し、VLCブロック14
は、この算出値に応じて、1MB当りの発生符号量がこ
のビットレートを破綻させない値を超えないように符号
化処理が制御される。
Further, information on the code amount of the image data generated by the VLC block 14 is supplied to the RATE block 13, and from this and the preset bit rate information, the bit rate of the MPEG2 bit stream output from the output terminal 5 is determined. In order to keep the rate constant, the Q / IQ block 12 calculates how coarsely the quantization should be applied.
The / IQ block 12 performs quantization according to the calculated value. Further, the RATE block 13 calculates a generated code amount per one macroblock MB that can be allowed so that the fixed bit rate does not fail, and calculates the VLC block 14.
The encoding process is controlled according to the calculated value so that the generated code amount per MB does not exceed a value that does not break down the bit rate.

【0029】ところで、MPEG2方式では、非可逆符
号化を行なうため、入力端子1から入力されるもとの画
像(入力画像)と出力端子5から出力されたMPEG2
ビットストリームを復号した画像とは異なったものにな
る。このMPEG2ビットストリームを復号する受信側
の復号器では、差分画像データから元の画像データを再
生するために、参照画像データとして、復号された画像
データを使用するので、送信側のMPEG2符号化装置
2において、MCブロック9で差分画像データを生成す
る際に、入力画像データをそのまま参照画像データとし
て使用すると、このMPEG2符号化装置での参照画像
データと受信側の復号器での参照画像データとの間の差
が問題となる。この差をなくすために、MPEG2符号
化装置2側でも、このMPEGビットストリームを復号
した画像データを参照画像データとして用いるようにし
なければならない。これをローカルデコードという。
By the way, in the MPEG2 system, in order to perform irreversible encoding, the original image (input image) input from the input terminal 1 and the MPEG2 image output from the output terminal 5 are output.
It will be different from the image obtained by decoding the bit stream. The decoder on the receiving side that decodes this MPEG2 bit stream uses the decoded image data as reference image data in order to reproduce the original image data from the differential image data. 2, when the difference image data is generated by the MC block 9, if the input image data is used as it is as the reference image data, the reference image data in the MPEG2 encoding device and the reference image data in the decoder on the receiving side are used. The difference between is important. In order to eliminate this difference, the MPEG2 encoder 2 must use the image data obtained by decoding the MPEG bit stream as reference image data. This is called local decoding.

【0030】このローカルデコードは、次のようにして
行なわれる。即ち、上記のように、VLCブロック14
では、ビットレート制御のために、1MB当りの発生符
号量を制限しており、それを超える画像データは可変長
符号化されない。このために、Q/IQブロック12か
ら出力された画像データの一部が可変長符号化されない
場合がある。そこで、MPEG2ビットストリームをデ
コードした値とローカルデコードの値とを一致させるた
めに、VLCブロック14から可変長符号化した分の画
像データをQ/IQブロック12に供給して逆量子化
し、さらに、DCT/IDCTブロック11で逆離散コ
サイン変換してMCブロック9に供給する。MCブロッ
ク9では、ノンイントラMBの差分画像データは参照画
像データが加算されて画像データに戻され、イントラM
Bのデータはそのままで復号画像データが生成され、I
ピクチャとPピクチャの復号画像データが参照画像デー
タD1 として、SDRAMデータバス17を介し、SD
RAMブロック3に保存される。
This local decoding is performed as follows. That is, as described above, the VLC block 14
In this document, the generated code amount per MB is limited for bit rate control, and image data exceeding that amount is not subjected to variable length coding. For this reason, a part of the image data output from the Q / IQ block 12 may not be subjected to the variable length coding. Therefore, in order to match the value obtained by decoding the MPEG2 bit stream with the value obtained by local decoding, the image data obtained by the variable length coding from the VLC block 14 is supplied to the Q / IQ block 12 and dequantized. The DCT / IDCT block 11 performs an inverse discrete cosine transform and supplies the result to the MC block 9. In the MC block 9, the reference image data is added to the difference image data of the non-intra MB, and the difference image data is returned to the image data.
The decoded image data is generated with the data of B
As decoded image data is reference image data D 1 of the picture and P-pictures, via the SDRAM data bus 17, SD
It is stored in the RAM block 3.

【0031】図2は図1における動きベクトル検出装置
としてのMEブロック7の第1の実施形態を示すブロッ
ク図であって、7aは入力画像バッファ、7bは参照画
像バッファ、7cは動きベクトル検出部、7dは参照画
像読出アドレス発生部、7eは値保持部、7fは判定計
数部、7gは平均値算出部、7hは分散値算出部であ
り、図1に対応する部分には同一符号をつけて重複する
説明を省略する。
FIG. 2 is a block diagram showing a first embodiment of the ME block 7 as the motion vector detecting device in FIG. 1, wherein 7a is an input image buffer, 7b is a reference image buffer, and 7c is a motion vector detecting unit. , 7d is a reference image read address generation unit, 7e is a value holding unit, 7f is a judgment and counting unit, 7g is an average value calculation unit, and 7h is a variance value calculation unit. Parts corresponding to those in FIG. And a duplicate description will be omitted.

【0032】VIDEOブロック6(図1)から供給さ
れる輝度信号Yの16×16画素からなるマクロブロッ
クMBは入力画像バッファ7aに格納され、また、この
マクロブロックMBに対してSDRAMブロック3から
読み出された参照画像データD4は参照画像バッファ7
bに格納される。ここで、参照画像バッファ7bは、水
平128画素×垂直56画素の参照画像データD4を格
納する。
A macroblock MB composed of 16 × 16 pixels of the luminance signal Y supplied from the VIDEO block 6 (FIG. 1) is stored in the input image buffer 7a, and the macroblock MB is read from the SDRAM block 3 The output reference image data D 4 is stored in the reference image buffer 7.
b. Here, the reference image buffer 7b stores the horizontal 128 pixels × vertical 56 pixels of the reference image data D 4.

【0033】この参照画像バッファ7bからは、入力画
像バッファ7aに格納されたマクロブロックMBに対す
る動きベクトルMVの探索範囲の参照画像データが読み
出され、入力画像バッファ7aから読み出されるマクロ
ブロックMBの画像データとともに、動きベクトル検出
部7cに供給されるのであるが、動きベクトルの探索範
囲は、後述するように、通常の広い探索範囲と制限され
た狭い探索範囲とに設定可能である。ここで、通常の広
い探索範囲は、入力画像バッファ7aから読み出される
マクロブロックMBに対応する位置を中心として、水平
方向で−56〜+56画素,垂直方向で−20〜+20
画素からなる範囲であり(マクロブロックMBに対応す
る領域(16×16画素)の領域も含めると、水平12
8画素×垂直56画素の大きさ)、また、制限された狭
い探索範囲は、水平方向で−24〜+24画素,垂直方
向で−8〜+8画素からなる範囲である(マクロブロッ
クMBに対応する領域の領域も含めると、水平64画素
×垂直32画素の大きさとなる)。
From this reference image buffer 7b, reference image data in the search range of the motion vector MV for the macro block MB stored in the input image buffer 7a is read, and the image of the macro block MB read from the input image buffer 7a is read. The search range of the motion vector is supplied to the motion vector detection unit 7c together with the data. The search range of the motion vector can be set to a normal wide search range and a limited narrow search range, as described later. Here, the normal wide search range is -56 to +56 pixels in the horizontal direction and -20 to +20 in the vertical direction, centering on the position corresponding to the macroblock MB read from the input image buffer 7a.
This is a range composed of pixels (including the region (16 × 16 pixels) corresponding to the macroblock MB,
The limited narrow search range is a range of −24 to +24 pixels in the horizontal direction and −8 to +8 pixels in the vertical direction (corresponding to the macroblock MB). Including the region, the size is 64 pixels horizontally × 32 pixels vertically).

【0034】動きベクトル検出部7cでは、入力画像バ
ッファ7aから供給されるマクロブロックMBの画像デ
ータと参照画像バッファ7bからの探索範囲の画像デー
タとのブロックマッチングをとることにより、このマク
ロブロックMVに対する動きベクトルMVを検出する。
このブロックマッチングは、輝度信号Yの場合、16×
16画素からなるマクロブロックMBに対して探索範囲
を上下左右に移動させることにより、夫々の移動位置毎
の16×16画素の領域との相関(予測誤差)を求める
ものである。
The motion vector detecting section 7c performs block matching between the image data of the macroblock MB supplied from the input image buffer 7a and the image data in the search range from the reference image buffer 7b to obtain the macroblock MV. A motion vector MV is detected.
This block matching is 16 ×
By moving the search range up, down, left, and right with respect to a macroblock MB consisting of 16 pixels, a correlation (prediction error) with a 16 × 16 pixel area at each moving position is obtained.

【0035】このようにして、入力画像の1つのマクロ
ブロックMBについて動きベクトルMVが求まると、次
のマクロブロックMBの動きベクトルMVの探索を行な
うのであるが、このマクロブロックMBに対する探索範
囲はその1つ前のマクロブロックMBに対する探索範囲
とは異なる。このため、次のマクロブロックMBの動き
ベクトルMVの探索を行なうときには、これに対する探
索範囲を設定するために、SDRAMブロック3から参
照画像データの読出しが行なわれるが、続けて動きベク
トルMVの探索を行なう2つのマクロブロックMBに対
する探索範囲は大部分が重なり合っており、1つ前のマ
クロブロックMBの動きベクトルMVの探索に使用した
探索範囲の参照画像データの一部を再使用することがで
きる。このため、SDRAMブロック3から読み出して
参照画像バッファ7bに取り込む参照画像データの範囲
は、上記通常の広い探索範囲では、水平16画素×垂直
56画素の範囲であり、上記制限された狭い探索範囲で
は、水平16画素×垂直32画素の範囲である。
When the motion vector MV is obtained for one macroblock MB of the input image in this way, the search for the motion vector MV of the next macroblock MB is performed. The search range for this macroblock MB is as follows. The search range is different from the search range for the immediately preceding macroblock MB. For this reason, when searching for the motion vector MV of the next macroblock MB, reference image data is read from the SDRAM block 3 in order to set a search range for the motion vector MV. Most of the search ranges for the two macroblocks MB to be performed overlap, and a part of the reference image data in the search range used for searching for the motion vector MV of the immediately preceding macroblock MB can be reused. For this reason, the range of the reference image data read from the SDRAM block 3 and taken into the reference image buffer 7b is a range of 16 horizontal pixels × 56 vertical pixels in the above-described ordinary wide search range, and is in the limited narrow search range. , 16 horizontal pixels × 32 vertical pixels.

【0036】参照画像読出アドレス発生部7dは、SD
RAMブロック3から参照画像データの読出範囲を制限
するモードと、この読出位置にオフセットをつける機能
とを備えており、これらモードと機能との設定はCPU
IFブロック8によって行なわれる。
The reference image read address generating section 7d is an SD
A mode for limiting the read range of the reference image data from the RAM block 3 and a function for offsetting the read position are provided. These modes and functions are set by the CPU.
This is performed by the IF block 8.

【0037】次に、CPU IFブロック8による参照
画像読出アドレス発生部7dのかかるモードと機能につ
いて説明するが、その前に、図3〜図6により、符号化
する入力画像,参照画像間の相関と動きベクトルやその
探索範囲との関係について説明する。但し、図3は入力
画像と参照画像との相関が低い場合の動きベクトルの分
布図、図4は入力画像と参照画像との相関が高い場合の
動きベクトルの分布図、図5は入力画像と参照画像との
相関が高い場合の探索範囲の制限とオフセットとの説明
図、図6は探索範囲が制限された状態で符号化する入力
画像と参照画像との相関が低い場合の説明図である。
Next, the modes and functions of the reference image read address generator 7d by the CPU IF block 8 will be described. Before that, the correlation between the input image to be encoded and the reference image will be described with reference to FIGS. The relationship between the motion vector and the motion vector and its search range will be described. 3 is a distribution diagram of motion vectors when the correlation between the input image and the reference image is low, FIG. 4 is a distribution diagram of motion vectors when the correlation between the input image and the reference image is high, and FIG. FIG. 6 is an explanatory diagram of the limitation of the search range and the offset when the correlation with the reference image is high, and FIG. 6 is an explanatory diagram of the case where the correlation between the input image and the reference image to be encoded with the search range limited is low. .

【0038】なお、これに図3〜図6において、範囲α
−βは通常の広い探索範囲を表わしており、この探索範
囲α−βの縦軸が立てられている中心がこの探索範囲α
−βでの符号化する入力画像データのマクロブロックM
Bの位置とするものである。動きベクトルを探索する場
合には、相対的に上記のような画素範囲を持つ探索範囲
内でマクロブロックMBを、例えば、半画像分ずつ移動
させることにより、高い相関部分を探索するものである
が、図3〜図6における縦軸の「動きベクトルの分布密
度」とは、複数のMBに対して検出された動きベクトル
の分布の程度を示すものである。例えば、図3の場合に
は、入力画像,参照画像間の相関が低く、動きベクトル
がランダムに検出されていることを示している。また、
図4の場合には、動きベクトルが検出される率が高いこ
とを示している。
In FIGS. 3 to 6, the range α
-Β represents an ordinary wide search range, and the center of the vertical axis of the search range α-β is set in the search range α.
Macroblock M of input image data to be encoded by -β
B position. When searching for a motion vector, a macroblock MB is relatively moved within a search range having a pixel range as described above, for example, by a half image, thereby searching for a highly correlated portion. The “distribution density of motion vectors” on the vertical axis in FIGS. 3 to 6 indicates the degree of distribution of motion vectors detected for a plurality of MBs. For example, in the case of FIG. 3, the correlation between the input image and the reference image is low, indicating that a motion vector is randomly detected. Also,
FIG. 4 shows that the rate of detecting the motion vector is high.

【0039】符号化する入力画像と参照画像の相関が低
い場合には、動きベクトルは、図3に示すように、動き
ベクトル検出部7cでの探索範囲α−βに万遍なく検出
される。そして、入力画像と参照画像との相関が低い
と、これらの差分画像の分散が大きくなる傾向にあるの
で、JUDGEブロック10での判定結果はイントラM
Bが多いということになる。
When the correlation between the input image to be encoded and the reference image is low, the motion vectors are uniformly detected in the search range α-β in the motion vector detecting section 7c as shown in FIG. If the correlation between the input image and the reference image is low, the variance of these difference images tends to be large. Therefore, the determination result in the JUDGE block 10 is
This means that there are many B's.

【0040】逆に、例えば、単純なパンを行なっている
ような画像のように、入力画像と参照画像との相関が高
い場合には、検出される動きベクトルは、図4で示すよ
うに、パンによる画像の移動を表わすベクトルを中心と
する領域に集まり、JUDGEブロック10の判定結果
はノンイントラMBが多いということになる。
Conversely, when the correlation between the input image and the reference image is high, for example, as in an image in which simple panning is performed, the detected motion vector is as shown in FIG. It gathers in the area centered on the vector representing the movement of the image by panning, and the judgment result of the JUDGE block 10 indicates that there are many non-intra MBs.

【0041】このように、探索範囲α−β内での狭い範
囲に動きベクトルが集まっている場合には、図5で示す
ように、その位置を表わす動きベクトルの平均値Vaに
対する探索範囲でのオフセット値NOFを指定し、探索範
囲をこの動きベクトルの大半が含まれる狭い探索範囲
(即ち、探索範囲α’−β’)に制限しても、符号化し
た画像の画質に大きな影響は与えない。なお、この制限
された狭い探索範囲α’−β’に対し、上記の探索範囲
α−βが上記通常の広い探索範囲となる。
As described above, when the motion vectors are concentrated in a narrow range within the search range α-β, as shown in FIG. 5, the motion vector in the search range with respect to the average value Va of the motion vector representing the position is obtained. Even if the offset value N OF is specified and the search range is limited to a narrow search range including most of the motion vectors (that is, the search range α′−β ′), the image quality of the encoded image is greatly affected. Absent. Note that, with respect to this limited narrow search range α′-β ′, the above-described search range α-β becomes the normal wide search range.

【0042】また、エンコード中、シーンの切り替えな
どによって入力画像と参照画像との相関が低くなった
り、パンの方向が変化したりして、動きベクトルが集中
する場所が制限れた狭い探索範囲α’−β’からはずれ
た場合には、探索範囲をもとの通常の広い範囲α−βに
戻さなくてはならない。
Further, during encoding, a narrow search range α in which the location where the motion vector is concentrated is limited because the correlation between the input image and the reference image is reduced due to scene switching or the like and the pan direction is changed. If it deviates from '-β', the search range must be returned to the original wide range α-β.

【0043】図6は上記の制限された狭い探索範囲α’
−β’が設定されているときに、入力画像と参照画像と
の相関が低くなった場合を示すものであるが、このとき
には、探索範囲α’−β’外の斜線部で検出されるはず
の動きベクトルが正しく検出されず、イントラMBの判
定が非常に多くなる。従って、制限された狭い探索範囲
が設定されているときにイントラMBが多いという判定
があった場合には、図3に示す通常の広い探索範囲α−
βに戻す必要がある。
FIG. 6 shows the limited narrow search range α ′.
This indicates a case where the correlation between the input image and the reference image is low when −β ′ is set. In this case, it should be detected in a hatched portion outside the search range α′−β ′. Is not correctly detected, and the number of intra MB determinations becomes very large. Therefore, when it is determined that the number of intra MBs is large when the limited narrow search range is set, the normal wide search range α− shown in FIG.
It is necessary to return to β.

【0044】以上のように、広い探索範囲と狭い探索範
囲の設定と、狭い範囲の探索範囲のオフセットの設定と
が行なわれるものであるが、まず、図2において、外部
設定有効モード設定信号S3 の値が0であり、CPU
IFブロック 8からの参照画像読出アドレス発生部7
dの設定を行なわない場合について説明する。
As described above, the setting of the wide search range and the narrow search range and the setting of the offset of the narrow search range are performed. First, in FIG. The value of 3 is 0 and the CPU
Reference image read address generator 7 from IF block 8
The case where d is not set will be described.

【0045】動きベクトルの探索範囲を上記の広い探索
範囲にするか、狭い探索範囲に制限するかは、以下のよ
うにして、Pピクチャの符号化の際に決定される。
Whether the search range of a motion vector is set to the above-described wide search range or limited to a narrow search range is determined at the time of encoding a P-picture as follows.

【0046】即ち、Pピクチャに符号化しているとき
に、動きベクトル検出部7cで検出された動きベクトル
MVの平均値Va(図5)を平均値算出部7gで算出
し、動きベクトルMVの分散値を分散値算出部7hで算
出して夫々値保持部7eに供給する。また、JUDGE
ブロック10のイントラ/ノンイントラ判定結果から判
定計数部7fがこのPピクチャ内のイントラMBの個数
を計数し、その計数値を値保持部7eに供給する。
That is, the average value Va (FIG. 5) of the motion vector MV detected by the motion vector detecting unit 7c is calculated by the average value calculating unit 7g during encoding into the P picture, and the variance of the motion vector MV is calculated. The values are calculated by the variance value calculation unit 7h and supplied to the value holding units 7e. Also, JUDGE
The decision counting unit 7f counts the number of intra MBs in the P picture from the intra / non-intra decision result of the block 10, and supplies the counted value to the value holding unit 7e.

【0047】このPピクチャの符号化が終了すると、値
保持部7eは取り込んだ平均値Vaから読出位置のオフ
セット値NOFを算出し、この結果を読出位置オフセット
信号S5として動きベクトル検出部7cと参照画像読出
アドレス発生部7dとに供給する。この読出位置オフセ
ットS5の算出法は後述する。また、分散値算出部7h
で算出された分散値が予め設定された閾値以下であると
きには、参照画像データの読出範囲(即ち、探索範囲)
を制限してもよいと判断し、読出範囲制限信号S6を動
きベクトル検出部7cと参照画像読出アドレス発生部7
dと参照バッファ7bとに供給する。この場合には、参
照画像読出アドレス発生部7dは、この読出範囲制限信
号S6により、SDRAM3からの参照画像データの読
出範囲を、入力画像バッファ7aに格納されたマクロブ
ロックMBに対応した位置を中心とした狭い探索範囲に
対するように、狭く制限する。
[0047] When the coding of the P-picture is completed, the value held unit 7e calculates an offset value N OF readout position from the average value Va taken, the motion vector detecting section 7c this result as a read position offset signal S 5 And the reference image read address generation unit 7d. Calculation of the read position offset S 5 will be described later. Also, the variance calculation unit 7h
When the variance value calculated in step (b) is equal to or less than a preset threshold, the readout range of the reference image data (that is, the search range)
May be limited, and the read-out range limiting signal S 6 is sent to the motion vector detecting unit 7 c and the reference image read address generating unit 7.
d and the reference buffer 7b. In this case, the reference image read address generator 7d is by the read range limit signal S 6, the read area of the reference image data from the SDRAM 3, the position corresponding to the macro block MB is stored in the input image buffer 7a Restrict narrowly, as for a narrow search center.

【0048】また、値保持部7eから読出範囲制限信号
6が出力されているときに、読出位置オフセットS5
出力されるときには、この読出位置オフセットS5に応
じて、SDRAM3からの参照画像データの読出範囲の
位置を設定する。この読出位置オフセットS5がない場
合には、SDRAM3での参照画像データの読出範囲
は、入力画像バッファ7aに格納されたマクロブロック
MBに対応する位置が中心位置となる範囲であるが、読
出位置オフセットS5があると、この中心位置がこの読
出位置オフセットS5が表わすオフセット値NOFに応じ
た量だけずれたものとなる。また、参照画像バッファ7
bでは、参照画像読出アドレス発生部7dによって設定
されたSDRAM3での読出範囲の参照画像データが書
き込まれて狭い探索範囲の参照画像データが格納される
ことになり、読出範囲制限信号S6に応じてかかる参照
画像データが読み出されて動きベクトル検出部7cに供
給される。このようにして、動きベクトル検出部7c
は、例えば、図5に示すように、読出位置オフセットS
5 に応じたオフセット値NOFを持つ制限された狭い探索
範囲α’−β’が設定されることになる。
[0048] Further, when the read area limit signal S 6 from the value holding section 7e is output, when the even read position offset S 5 is output, in response to the read position offset S 5, the reference image from SDRAM3 Set the position of the data read range. If the absence of read position offset S 5 are read area of the reference image data in SDRAM3 is the position corresponding to the macro block MB is stored in the input image buffer 7a is in the range of the center position, the read position If there is an offset S 5, it becomes this center position is shifted by an amount corresponding to the offset value N oF represented by the read position offset S 5. The reference image buffer 7
In b, will be the reference image data of the narrow search range read area of the reference image data is written in SDRAM3 set by the reference image read address generation section 7d is stored, according to the read range limit signal S 6 The reference image data is read and supplied to the motion vector detection unit 7c. Thus, the motion vector detecting unit 7c
Is, for example, as shown in FIG.
A limited narrow search range α′−β ′ having an offset value N OF corresponding to 5 is set.

【0049】なお、判定計数部7fが一定以上の計数値
を出力しているときには(即ち、イントラMBの個数が
多いときには)、読出位置オフセット信号S5は0とな
り、また、読出範囲制限信号S6も出力されない。ま
た、分散値算出部7hで算出される分散値が上記閾値よ
りも大きいときにも、同様に、読出位置オフセット信号
5と読出範囲制限信号S6が出力されない。この場合に
は、参照画像読出アドレス発生部7dは、入力画像バッ
ファ7aに格納されたマクロブロックMBに対応した位
置を中心とした広い探索範囲に対するように、参照画像
データを読み出すようにし、これを参照画像バッファ7
bに格納させる。また、動きベクトル検出部7cでは、
参照画像バッファ7bから参照画像データを読み取っ
て、図3に示す通常の広い探索範囲α−βのように、入
力画像バッファ7aに格納されたマクロブロックMBに
対応した位置を中心とした広い探索範囲が設定される。
[0049] Incidentally, when the determination count portion 7f is outputting a constant or count values (i.e., when the number of intra MB is large), the read position offset signal S 5 is 0 also, the reading range limit signal S 6 is not output. Further, when the dispersion value calculated by the variance calculation section 7h is greater than the threshold value are likewise read position offset signal S 5 and the read range limit signal S 6 is not output. In this case, the reference image read address generation unit 7d reads out the reference image data so as to read a wide search range centered on the position corresponding to the macroblock MB stored in the input image buffer 7a. Reference image buffer 7
b. In the motion vector detecting section 7c,
The reference image data is read from the reference image buffer 7b, and a wide search range centered on a position corresponding to the macroblock MB stored in the input image buffer 7a, like a normal wide search range α-β shown in FIG. Is set.

【0050】探索範囲を制限された狭い探索範囲α’−
β’とするモードでは、通常の広い探索範囲α−βであ
る場合に比べ、参照画像バッファ7bからの参照画像デ
ータの読出範囲が縦横夫々1/2となり、動きベクトル
検出部7cの動作時間が1/4となる。また、次のマク
ロブロックMBでの動きベクトルの探索のためにSDR
AMブロック3から参照画像データを読み出すためのS
DRAMブロック3へのアクセス量も減少し、MEブロ
ック7の消費電力を低減することができる。また、かか
るモードにあるときに広い探索範囲α−βが必要になっ
たときには、上記のように、自律的にこの広い探索範囲
α−βを戻すので、符号化された画像への影響は最小限
に押さえられる。
A narrow search range α'- with a limited search range
In the mode of β ′, the readout range of the reference image data from the reference image buffer 7b is 縦 each in the vertical and horizontal directions, and the operation time of the motion vector detection unit 7c is shorter than in the case of the normal wide search range α−β. It becomes 1/4. In addition, SDR is used to search for a motion vector in the next macroblock MB.
S for reading reference image data from AM block 3
The amount of access to the DRAM block 3 is also reduced, and the power consumption of the ME block 7 can be reduced. Also, when a wide search range α-β is required in such a mode, as described above, the wide search range α-β is returned autonomously, so that the influence on the encoded image is minimized. It is held down to the limit.

【0051】次のピクチャの符号化時には、参照画像読
出アドレス発生部7dは、読出範囲制限信号S6が0で
なければ、読出範囲を制限して、さらに、読出位置オフ
セット信号S5が0でなければ、これに応じてこの読出
位置をオフセットしてSDRAMブロック3から参照画
像データを読み出し、また、読出範囲制限信号S6が0
であれば、通常の広い読出範囲でSDRAMブロック3
から参照画像データを読み出す。
[0051] During the encoding of the next picture, the reference image read address generator 7d is unless the read range limit signal S 6 is 0, limits the read range, further, at the read position offset signal S 5 0 without reads reference image data from the SDRAM block 3 the read position offset accordingly, also the read range limit signal S 6 0
, The SDRAM block 3 in the normal wide read range
From the reference image data.

【0052】ここで、エンコードされる動画像のm値が
一定であるならば、次のPピクチャでの読出位置オフセ
ットは動きベクトルの平均値Vaとしてよい。このm値
が変化した場合には、m値に応じてスケーリングする。
Here, if the m value of the moving picture to be encoded is constant, the read position offset in the next P picture may be the average value Va of the motion vector. When the m value changes, scaling is performed according to the m value.

【0053】次に、Bピクチャにおける読出位置オフセ
ットの決定について説明する。図7はこの第1の実施形
態における動きベクトルのスケーリングの説明図であっ
て、図7(a)は表示順(入力順)でのピクチャの並び
を、図7(b)は符号化順でのピクチャの並びを夫々示
している。
Next, the determination of the read position offset in the B picture will be described. FIGS. 7A and 7B are explanatory diagrams of the scaling of the motion vector in the first embodiment. FIG. 7A shows the arrangement of pictures in display order (input order), and FIG. Are shown, respectively.

【0054】図7(a)において、いま、順番に入力され
る4個のピクチャP1,P2,P3,P4に着目し、これ
らピクチャ中の特定の画像がピクチャP1,P2,P3
4の順に位置を変えていくものとし、これら夫々のピ
クチャにおいて、この特定の画像に含まれるマクロブロ
ックMBをピクチャP1でマクロブロックMB1とし、ピ
クチャP2でマクロブロックMB2とし、ピクチャP3
マクロブロックMB3とし、ピクチャP4でマクロブロッ
クMB4とする。ここでは、パンが行なわれているもの
とし、このために、画像全体が同方向に同速度で移動す
る。図7では、この特定の画像のの表示位置のマクロブ
ロックMBが、ピクチャP1,P2,P3,P4の順に、左
下隅から右上隅へマクロブロックMB1,MB2,M
3,MB4と移動していく状態を示している。これらマ
クロブロックMB1〜MB4の画像は互いに相関が非常に
高い。なお、説明の便宜上、これらマクロブロックMB
1〜MB4間の間隔を誇張して示している。
[0054] In FIG. 7 (a), now paying attention to the four pictures P 1, P2, P 3, P 4 inputted sequentially, a specific image is a picture P 1 in these pictures, P 2, P 3 ,
Shall will change the position in the order of P 4, in these respective pictures, the macro block MB included in the specific image and the macro block MB 1 in picture P 1, and the macro block MB 2 in pictures P 2, picture a macroblock MB 3 at P 3, and the macro block MB 4 in picture P 4. Here, it is assumed that panning is being performed, and therefore, the entire image moves in the same direction and at the same speed. In Figure 7, the macro blocks MB of the display position of the specific image, picture P 1, P 2, P 3 , in the order of P 4 macroblock MB 1 from the lower left corner to the upper right corner, MB 2, M
It shows a state in which it moves to B 3 and MB 4 . These macro blocks MB 1 to MB 4 image is very highly correlated with each other. For convenience of explanation, these macro blocks MB
It is shown in an exaggerated spacing between 1 to MB 4.

【0055】かかるピクチャP1〜P4は、ピクチャP1
がIピクチャとして、ピクチャP4がPピクチャとし
て、また、ピクチャP2,P3がBピクチャとして夫々符
号化されると、図7(b)に示すように、Iピクチャに
符号化されたピクチャP1,Pピクチャに符号化された
ピクチャP4,Bピクチャに符号化されたピクチャP2
Bピクチャに符号化されたピクチャP3 の順に配列され
ることになる。従って、この場合のMPEG2ビットス
トリームのm値は3である。
The pictures P 1 to P 4 correspond to the picture P 1
Picture but as an I picture, a picture P 4 is P picture, and if the picture P 2, P 3 are respectively coded as a B-picture, as shown in FIG. 7 (b), which is coded to an I picture P 1 , a picture P 4 encoded into a P picture, a picture P 2 encoded into a B picture,
It will be arranged in the order of the picture P 3, which is encoded into B pictures. Accordingly, the m value of the MPEG2 bit stream in this case is 3.

【0056】このようにピクチャP1〜P4を符号化する
場合には、ピクチャP1 は、Iピクチャとして符号化さ
れるので、この符号化に動きベクトルは関係ない。
When the pictures P 1 to P 4 are encoded as described above, since the picture P 1 is encoded as an I picture, no motion vector is involved in this encoding.

【0057】次に、ピクチャP4をPピクチャに符号化
する場合には、このピクチャP4のマクロブロックMB4
に対して、このマクロブロックMB4に応じた範囲のピ
クチャP1の画像データがSDRAM3から読み出され
て、参照画像データD4として、参照画像バッファ7b
に格納されている。そして、この場合、値保持部7eか
らは読出位置オフセット信号S5も読出範囲制限信号S6
も出力されていないものとすると、参照画像バッファ7
dからは、このマクロブロックMB4の位置を中心とす
る通常の広い範囲の探索範囲を含む読出範囲の参照画像
データが読み出されて動きベクトル検出部7cに供給さ
れ、この探索範囲でマクロブロックMB4に対する動き
ベクトルMVの探索が行なわれる。
Next, when the picture P 4 is encoded into a P picture, the macro block MB 4 of the picture P 4 is encoded.
Respect, the image data of the picture P 1 of the range corresponding to the macroblock MB 4 is read from the SDRAM 3, the reference image data D 4, reference image buffer 7b
Is stored in In this case, also read area read position offset signal S 5 from the value holding section 7e limit signal S 6
Is not output, the reference image buffer 7
From d, the reference image data of the read range including the search range of normal broad range around the position of the macro block MB 4 is supplied to the read and motion vector detection unit 7c, a macroblock in this search range a search for a motion vector MV is performed for MB 4.

【0058】ここで、動きベクトルMV1がこの探索範
囲内にあるとすると、ピクチャP1,P4は相関が非常に
高いものであるから、この場合の動きベクトルの分布密
度は、図4で示したように、MV1付近に集中すること
となる。この場合の平均値算出部7gで算出される動き
ベクトルの平均値VaはMV1に近い値であり、また、
分散値算出部7hで算出される動きベクトルの分散値は
予め設定されている閾値よりも低いものとする。
Here, assuming that the motion vector MV 1 is within this search range, the pictures P 1 and P 4 have very high correlation, and the distribution density of the motion vector in this case is shown in FIG. as indicated, so that the concentrated around MV 1. Average value Va of the motion vector calculated by the average value calculating section 7g in this case is close to MV 1, also
It is assumed that the variance of the motion vector calculated by the variance calculator 7h is lower than a preset threshold.

【0059】次のBピクチャに符号化するピクチャP2
のマクロブロックMB2を符号化する場合には、入力が
先行したピクチャP1の画像データを参照画像データと
する動きベクトルMV2(これを前方向動きベクトルと
いう)の探索(前方向動きベクトル探索)と、入力順序
が後のピクチャP4の画像データを参照画像データとす
る動きベクトルMV3の探索(後方向動きベクトル探
索)とが行なわれる。
Picture P 2 to be encoded into the next B picture
When encoding a macroblock MB 2, the search (forward motion vector search of a motion vector MV 2 as an input a preceding image data reference image data of the picture P 1 (referred forward motion vector this) ) and the search for the motion vector MV 3 to a reference image data to the image data of the picture P 4 after the input order and (backward motion vector search) is performed.

【0060】まず、前方向動きベクトルMV2の探索で
は、探索範囲のオフセット値NOF(図5)やSDRAM
3からの参照画像データの読出位置オフセット値は、先
に求めたピクチャP4の動きベクトルMV1の平均値Va
の1/3の大きさでこの動きベクトルMV1と同方向に設
定される。
First, in the search for the forward motion vector MV 2 , the search range offset value N OF (FIG. 5) and the SDRAM
Read position offset value of the reference image data from the 3, the average value Va of the motion vector MV 1 picture P 4 obtained above
Size of 1/3 in this motion vector MV 1 is set in the same direction.

【0061】次に、後方向動きベクトルMV3の探索が
行なわれるのであるが、この場合には探索範囲のオフセ
ット値NOF(図5)やSDRAM3からの参照画像デー
タの読出位置オフセット値は、先に求めたピクチャP4
の動きベクトルMV1の平均値Vaの2/3の大きさでこ
の動きベクトルMV1 と逆方向に設定される。
Next, the search for the backward motion vector MV 3 is performed. In this case, the offset value N OF of the search range (FIG. 5) and the read position offset value of the reference image data from the SDRAM 3 are: Picture P 4 obtained earlier
2/3 the size of the average value Va of the motion vector MV 1 and the motion vector MV 1 is set in the reverse direction.

【0062】さらに、次のピクチャP3でのマクロブロ
ックMB3を符号化するときには、ピクチャP2の場合と
同様にして、ピクチャP1の画像データを参照画像デー
タとする前方向動きベクトルMV4の探索を行なう前方
向動きベクトル探索と、ピクチャP4 の画像データを参
照画像データとする後方向動きベクトルMV5の探索を
行なう後方向動きベクトル探索とが行なわれる。
[0062] Further, when encoding a macroblock MB 3 at the next picture P 3, as in the case of the picture P 2, motion vector MV 4 before the reference image data to the image data of the picture P 1 a forward motion vector search of performing the search, the motion vector search after performing a search of motion vector MV 5 after a reference image data to the image data of the picture P 4 is performed.

【0063】この場合には、前方向動きベクトルMV4
の探索では、探索範囲のオフセット値NOF(図5)やS
DRAM3からの参照画像データの読出位置オフセット
値は、先に求めたピクチャP4 の動きベクトルMV1
平均値Vaの2/3の大きさでこの動きベクトルと同方
向に設定される。
In this case, the forward motion vector MV 4
In the search for, the offset value N OF of the search range (FIG. 5) and S
Read position offset value of the reference image data from DRAM3 is set to the motion vector in the same direction at 2/3 the size of the average value Va of the motion vector MV 1 picture P 4 obtained previously.

【0064】また、同様にして、後方向動きベクトルM
5の探索が行なわれるのであるが、この場合には、探
索範囲のオフセット値NOF(図5)やSDRAM3から
の参照画像データの読出位置オフセット値は、先に求め
たピクチャP4の動きベクトルMV1の平均値Vaの1/
3の大きさでこの動きベクトルVaと逆方向に設定され
る。
Similarly, the backward motion vector M
While the search for V 5 is than is carried out, in this case, the read position offset value of the reference image data from the offset value N OF (Fig. 5) and SDRAM3 search range, the motion of the picture P 4 obtained above the average value Va of the vector MV 1 1 /
The motion vector Va is set in a direction opposite to the motion vector Va at a size of 3.

【0065】MPEG2ビットストリームのm値が3の
場合、ピクチャP4の次に続くピクチャP5,P6(図7
に図示せず)を飛び越えて、ピクチャP7(図7に図示
せず)を、ピクチャP4の画像データを参照画像データ
として、Pピクチャに符号化する。この場合にも、値保
持部7eにピクチャP4の動きベクトルMV1の平均値V
aが保持され、また、ピクチャP4で算出された動きベ
クトルMV1の分散値は閾値よりも低いので、値保持部
7eから、これら平均値Vaと分散値に応じて、読出位
置オフセット信号S5と読出範囲制限信号S6が出力さ
れ、動きベクトル検出部7eに制限された狭い探索範囲
が設定され、この場合の探索範囲のオフセット値N
OF(図5)やSDRAM3からの参照画像データの読出
位置オフセット値は、先に求めたピクチャP4の動きベ
クトルMV1の平均値Vaと同じ大きさで、この動きベ
クトルMV1と同方向に設定される。ここでMPEG2
ビットストリームのm値が3以外に変化した場合、この
場合の探索範囲のオフセット値NOF(図5)やSDRA
M3からの参照画像データの読出位置オフセット値は、
ピクチャP4の動きベクトルMV1の平均値Va×m値/
3の大きさで、この動きベクトルMV1と同方向に設定
される。
When the m value of the MPEG2 bit stream is 3, the pictures P 5 and P 6 following the picture P 4 (FIG. 7)
(Not shown in FIG. 7), and encodes the picture P 7 (not shown in FIG. 7) into a P picture using the image data of the picture P 4 as reference image data. In this case, the average value V of the motion vector MV 1 picture P 4 to the value holding section 7e
a is held, also, since the variance value of the motion vector MV 1 calculated at the picture P 4 is lower than the threshold value, from the value holding unit 7e, according to the dispersion value and these average values Va, read position offset signal S 5 and the read range limit signal S 6 is output, a narrow search range is limited to the motion vector detecting portion 7e is set, the offset value N of the search range in this case
OF (Fig. 5) and read position offset value of the reference image data from SDRAM3 is the same size as the average value Va of the motion vector MV 1 picture P 4 obtained above, in the same direction as the motion vector MV 1 Is set. Where MPEG2
When the m value of the bit stream changes to a value other than 3, the search range offset value N OF (FIG. 5) or SDRA
The read position offset value of the reference image data from M3 is
Average value Va × m value of motion vector MV 1 of picture P 4 /
3 in size, are set in the same direction as the motion vector MV 1.

【0066】かかるピクチャP7の符号化で動きベクト
ルMVの平均値Vaが新たに変化すると、値保持部7e
では、この新たな平均値Vaに更新され、次のPピクチ
ャの符号化で更新されるまでこの平均値Vaが保持され
る。
When the average value Va of the motion vector MV newly changes in the encoding of the picture P 7 , the value holding unit 7 e
In this case, the average value Va is updated to the new average value Va, and the average value Va is held until the new average value Va is updated in the encoding of the next P picture.

【0067】以上の動きベクトルMVの探索において、
分散値算出部7hで算出された分散値が閾値よりも高い
ときには、値保持部7eからは読出位置オフセット信号
5と読出範囲制限信号S6が出力されず(この場合で
も、値保持部7eでは、平均値Vaがそのまま保持され
ている)、従って、SDRAM3からの画像の読出範囲
も広げられて、動きベクトル検出部7cには、通常の広
い探索範囲が設定される。
In the above search for the motion vector MV,
When the dispersion value calculated by the variance calculation section 7h is higher than the threshold value, the read position offset signal S 5 and the read range limit signal S 6 is not output from the value holding section 7e (Even in this case, the value holding section 7e In this case, the average value Va is held as it is.) Therefore, the range of reading the image from the SDRAM 3 is also expanded, and a normal wide search range is set in the motion vector detection unit 7c.

【0068】なお、以上の説明はMPEG2ビットスト
リームのm値が3の場合であるが、このm値が2の場合
(2ピクチャ毎に1つの参照画像(IまたはPピクチャ)
となる)でも、Bピクチャに符号化されるピクチャの前
方向動きベクトル探索でのSDRAM3の参照画像デー
タ読出位置オフセット値NOFは、先行して入力されたP
ピクチャの動きベクトルMVの平均値Vaの1/2の大
きさでこの動きベクトルMVと同方向に設定され、後方
向動きベクトル探索でのSDRAM3の参照画像データ
の読出位置オフセット値NOFは、Pピクチャの動きベク
トルMVの平均値Vaの1/2 の大きさでこの動きベク
トルMVと逆方向に設定される。これ以外については、
上記と同様である。
The above description is for the case where the m value of the MPEG2 bit stream is 3, but when the m value is 2 (one reference picture (I or P picture) for every two pictures)
However, the reference image data read position offset value N OF of the SDRAM 3 in the forward motion vector search of the picture coded into the B picture is equal to the previously input P
The motion vector MV is set in the same direction as the motion vector MV at half the average value Va of the motion vector MV of the picture, and the read position offset value N OF of the reference image data of the SDRAM 3 in the backward motion vector search is P The motion vector MV is set in a direction opposite to the motion vector MV at a half of the average value Va of the motion vector MV of the picture. Otherwise,
Same as above.

【0069】次に、CPU IFブロック8からの外部
設定有効モード信号S3の値が1である場合の動作につ
いて説明する。
Next, the operation when the value of the external setting valid mode signal S 3 from the CPU IF block 8 is 1 will be described.

【0070】図1において、CPUブロック4は、CP
U IFブロック8から、マクロブロックMB毎に、動
きベクトルMVの検出結果とイントラMB判定信号S4
の値とを受け取り、ユーザ定義のアルゴリズムを用い
て、SDRAM3の参照画像データ読出位置オフセット
値とベクトル探索範囲制限信号S1の値とを算出する
(ここでは、例えば、上記の平均値Vaの代わりに最頻
値を、分散値の代わりに絶対値差分和を夫々用いるアル
ゴリズムが考えられる)。
In FIG. 1, the CPU block 4 includes a CP
From the U IF block 8, the detection result of the motion vector MV and the intra MB determination signal S 4
Receipt and values, using a user-defined algorithm, the calculated and reference values of the image data read position offset value and a vector search range limited signals S 1 of SDRAM 3 (wherein, e.g., instead of the average value Va of the An algorithm that uses a mode value and a sum of absolute value differences instead of a variance value can be considered.)

【0071】そして、外部設定有効モード信号S3の値
を1とし、オフセット値設定信号S2の値を上記の算出
した参照画像データ読出位置オフセットとし、ベクトル
探索範囲制限信号S1の値を、ベクトル探索範囲制限を
行なう場合には、1として、夫々CPU IFブロック
8に設定する。
Then, the value of the external setting valid mode signal S 3 is set to 1, the value of the offset value setting signal S 2 is set to the calculated reference image data reading position offset, and the value of the vector search range limiting signal S 1 is When the vector search range is limited, it is set to 1 in each of the CPU IF blocks 8.

【0072】図2において、値保持部7eでは、読出範
囲制限信号S6の値をCPU IFブロック8からのベク
トル探索範囲制限信号S1の値に、読出位置オフセット
信号S5の値をオフセット値設定信号S2の値に夫々設定
して出力する。このように、参照画像データ読出位置オ
フセット値とベクトル探索範囲制限信号S1の値とをC
PUブロック4から設定することができるようにするこ
とにより、外部で検出されたパンの情報などをMPEG
2符号化装置2で利用することができる。
[0072] In FIG. 2, the value holding section 7e, the value of the read range limit signal S 6 to the value of the vector search range limited signals S 1 from the CPU IF block 8, the offset value the value of the read position offset signal S 5 the value of the setting signal S 2 respectively set to be output to. Thus, the reference image data read position offset value and a vector search range limited signals S 1 and the value C
By enabling the setting from the PU block 4, information on the pan detected from the outside can be stored in the MPEG format.
2 can be used in the encoding device 2.

【0073】なお、この第1の実施形態では、上記のよ
うに、平均値と分散値を用いたが、これは、ほかの計算
法、例えば、平均値の代わりに最頻値を、分散値の代わ
りに絶対値差分和を夫々用いるようにしてもよい。
In the first embodiment, as described above, the average value and the variance value are used. However, this calculation is performed by another calculation method, for example, the mode value is replaced with the variance value instead of the average value. May be used instead of the absolute value difference sum.

【0074】また、この第1の実施形態では、参照画像
データ読出位置オフセットと探索範囲との制限をPピク
チャが符号化されたときに更新するようにしたが、各ピ
クチャ毎に参照画像データ読出位置オフセットや探索範
囲の制限を計算して更新するようにすることも可能であ
る。また、ピクチャ単位ではなく、過去の決められた個
数のマクロブロックMBでの動きベクトルMVの平均値
や分散値の情報をもとにして、マクロブロックMB毎や
複数のマクロブロックMB毎に参照画像データ読出位置
オフセットと探索範囲の制限を更新していくようにする
ことも可能である。
In the first embodiment, the restriction between the reference image data read position offset and the search range is updated when a P picture is coded. It is also possible to calculate and update the position offset and the limit of the search range. In addition, based on the information of the average value and the variance value of the motion vectors MV in the past determined number of macroblocks MB, instead of the picture unit, the reference image is set for each macroblock MB or for each of a plurality of macroblocks MB. It is also possible to update the data reading position offset and the limit of the search range.

【0075】さらに、この第1の実施形態では、探索範
囲として広いモードと制限された狭いモードとの2種類
としたが、探索範囲を大きさが異なる3以上のモードを
選択制御するようにすることもできる。
Further, in the first embodiment, the search range is set to two types, that is, a wide mode and a restricted narrow mode. However, the search range is selectively controlled to three or more modes having different sizes. You can also.

【0076】図8は本発明によるディジタル画像符号化
装置に用いる動きベクトル検出装置の第2の実施形態を
示すブロック図であって、7iは探索ポイントカウン
タ、7jは探索範囲判定結果保持部であり、図2に対応
する部分には同一符号をつけて重複する説明を省略す
る。この実施形態も、図1におけるME部7として用い
ることができる。
FIG. 8 is a block diagram showing a second embodiment of the motion vector detecting device used in the digital image encoding device according to the present invention, wherein 7i is a search point counter, and 7j is a search range judgment result holding unit. 2 are denoted by the same reference numerals, and redundant description will be omitted. This embodiment can also be used as the ME unit 7 in FIG.

【0077】同図において、MEブロック7は、全探索
モードと狭探索モードの2つのモードを有しており、狭
探索モードは5つの探索ポイント(探索範囲)がある。
In the figure, the ME block 7 has two modes, a full search mode and a narrow search mode, and the narrow search mode has five search points (search ranges).

【0078】図9はこのMEブロック7の探索範囲を示
すものであって、同図(a)はPピクチャ符号化時の探
索範囲を、同図(b)はBピクチャ符号化時の探索範囲
を夫々示している。
FIGS. 9A and 9B show the search range of the ME block 7. FIG. 9A shows the search range when encoding a P picture, and FIG. 9B shows the search range when encoding a B picture. Are shown respectively.

【0079】図9(a)において、Pピクチャ符号化時の
全探索モードでの探索範囲は、(イ)として示すよう
に、水平−56〜+56画素,垂直−20〜+20画素
(マクロブロックMBに対応する位置での16×16画
素の領域も含めて水平128画素×垂直56画素の大き
さ)の非常に広い探索範囲SP1であり、同じく狭探索
モード時での探索範囲は、(ロ)として示すように、水
平−24〜+24画素,垂直−6〜+6画素(マクロブ
ロックMBに対応する位置での16×16画素の領域も
含めて水平64画素×垂直28画素)の探索ポイントが
(1,1)の狭い探索範囲SP21である。この狭探索モ
ードでは、この探索範囲SP21の他に、(ハ)として示す
ように、広い探索範囲SP1に対し、左半部の中央部の
探索ポイントを(0,1)とする探索範囲SP22と、中央
部の上半部の探索ポイントを(1,0)する狭い探索範囲
SP23と、右半部の中央部の探索ポイントを(2,1)と
する狭い探索範囲SP24と、中央部の下半部の探索ポイ
ントを(1,2)とする狭い探索範囲SP25との4個もあ
り、これら5個の探索範囲SP21〜SP25は水平,垂直
で同じ画素数の範囲である。
In FIG. 9A, the search range in the full search mode at the time of P-picture coding is as follows: (a), horizontal -56 to +56 pixels, vertical -20 to +20 pixels (macro block MB very a wide search range SP 1, also the search range in the narrow search mode of 16 × 16 pixel region be included horizontal 128 pixels × vertical 56 pixels in size) of at a position corresponding to the (b ), The search points of horizontal −24 to +24 pixels and vertical −6 to +6 pixels (horizontal 64 pixels × vertical 28 pixels including the 16 × 16 pixel area at the position corresponding to the macroblock MB)
A narrow search range SP 21 of (1,1). In this narrow search mode, in addition to the search range SP 21, as shown as (c), with respect to a wide search range SP 1, the search range of a search point in the central portion of the left half portion and (0,1) and SP 22, the search point of the top half of the central part and a narrow search range SP 23 to (1,0), a narrow search range SP 24 that the search point in the central portion of the right half and (2,1) , also four narrow search range SP 25 that the search point lower half of the central portion (1,2), these five search range SP 21 to SP 25 are horizontal, the number of the same pixel in the vertical Range.

【0080】図9(b)において、Bピクチャ符号化時の
全探索モードでの探索範囲は、(イ)として示すよう
に、水平−29〜+29画素,垂直−20〜+20画素
(マクロブロックMBに対応する位置での16×16画
素の領域も含めて水平64画素×垂直56画素)の広い
探索範囲SB1であり、狭探索モード時の探索範囲は水
平−8〜+8画素,垂直−6〜+6画素(マクロブロッ
クMBに対応する位置での16×16画素の領域も含め
て水平32画素×垂直28画素)の非常に狭い探索範囲
である。この狭探索モードでの探索範囲は、全探索モー
ドでの探索範囲SB1に対する位置関係及び探索ポイン
トがPピクチャ符号化時の狭探索モード時と同様であっ
て、(ロ),(ハ) として示すように、5個の探索範囲SB
21,SB22,SB23,SB24,SB25がある。
In FIG. 9 (b), the search range in the full search mode at the time of B picture encoding is as shown in FIG.
(Macro area of 16 × 16 pixels at a position corresponding to the block MB be included horizontal 64 pixels × vertical 56 pixels) is a broad search range SB 1 of the search range in the narrow search mode horizontal -8 + 8 pixels , Vertical -6 to +6 pixels (32 horizontal pixels × 28 vertical pixels including a 16 × 16 pixel area at a position corresponding to the macroblock MB). Search range in the narrow search mode, the positional relationship and the search points for the search range SB 1 in all search mode is a same manner as in the narrow search mode at the time of P-picture coding, (ii), as (c) As shown, five search ranges SB
21, there is SB 22, SB 23, SB 24 , SB 25.

【0081】まず、図8において、MEブロック7が全
探索モードで動作している場合について説明する。
First, the case where the ME block 7 operates in the full search mode will be described with reference to FIG.

【0082】探索ポイントカウンタ7i内には、狭探索
モードの各探索ポイントに夫々1つずつカウンタが設け
られており、各探索ポイントに入る動きベクトルの発生
数を夫々のカウンタでカウントしておき、各探索ポイン
トの計数結果S9をピクチャ単位でCPU IFブロック
8を通してCPUブロック4にレポートする。
In the search point counter 7i, a counter is provided for each search point in the narrow search mode, and the number of occurrences of motion vectors entering each search point is counted by each counter. The counting result S 9 of each search point is reported to the CPU block 4 through the CPU IF block 8 on a picture basis.

【0083】MPEG2方式では、ピクチャとしてフィ
ールドピクチャとフレームピクチャの2種類があるが、
フレームピクチャの場合には、フレーム動きベクトルと
フィールド動きベクトルの2種類の動きベクトルがあ
る。このため、動きベクトル検出部7cでフィールド動
きベクトルが検出された場合、探索ポイントカウンタ7
iはこれをフレーム動きベクトルに変換してカウントす
る。
In the MPEG2 system, there are two types of pictures, field pictures and frame pictures.
In the case of a frame picture, there are two types of motion vectors, a frame motion vector and a field motion vector. Therefore, when the motion vector detecting unit 7c detects a field motion vector, the search point counter 7
i converts this into a frame motion vector and counts it.

【0084】また、Bピクチャの場合、前方向動きベク
トルと後方向動きベクトルとがあるが、後方向動きベク
トルは探索範囲の中心に関して対称となる位置の探索ポ
イントに入るものとして加算される。例えば、探索ポイ
ント(0,1)に後方向動きベクトルが検出されると、
探索範囲の中心に関してこの探索ポイント(0,1)と
は対称な位置の探索ポイント(2,1)のカウンタに加
算する。
In the case of a B picture, there are a forward motion vector and a backward motion vector, and the backward motion vector is added as being included in a search point at a position symmetrical with respect to the center of the search range. For example, when a backward motion vector is detected at the search point (0, 1),
The search point (0, 1) is added to the counter of the search point (2, 1) symmetrical with respect to the center of the search range.

【0085】さらに、探索ポイントが重なっている領域
で動きベクトルが検出された場合には、その動きベクト
ルが属する全ての探索ポイントのカウンタで重複してカ
ウントする。
Further, when a motion vector is detected in an area where search points overlap, the counters of all search points to which the motion vector belongs are counted in duplicate.

【0086】次に、CPUブロック4における探索モー
ドの判定処理について説明する。
Next, the determination process of the search mode in the CPU block 4 will be described.

【0087】斜め方向の動きベクトル発生頻度が高い場
合(どの探索ポイントにも属さない動きベクトルが多
い)には、次のピクチャを全探索モードのピクチャとす
る。いずれかの探索ポイントで動きベクトル発生頻度が
事前に設定されたた閾値以上であれば、次のピクチャを
狭探索モードとしてもよいが、むやみに狭探索モードへ
遷移することを防ぐために、過去の連続する数個のピク
チャでの判定結果を保存しておき、該当する狭探索ポイ
ントが判定された割合が一定以上であれば、狭探索モー
ドへ遷移する。このとき、複数の探索ポイントで同一の
発生頻度であれば、探索ポイント(1,1)が最も優先
度が高く、以下(0,1)、(2,1)、(1,0)、
(1,2)の順で優先度が低くなる。
If the frequency of occurrence of the motion vector in the diagonal direction is high (there are many motion vectors that do not belong to any search point), the next picture is set as the picture in the full search mode. If the motion vector occurrence frequency at any of the search points is equal to or greater than a preset threshold, the next picture may be set to the narrow search mode, but in order to prevent transition to the narrow search mode unnecessarily, The determination results for several consecutive pictures are stored, and if the rate at which the corresponding narrow search point is determined is equal to or higher than a certain value, the mode transits to the narrow search mode. At this time, if the frequency of occurrence is the same among a plurality of search points, the search point (1, 1) has the highest priority, and the following (0, 1), (2, 1), (1, 0),
The priority becomes lower in the order of (1, 2).

【0088】以上の判定によって狭探索モードへの遷移
が決定すると、次のピクチャでは、狭探索モードとし、
探索ポイントは最も動きベクトル発生頻度の高かった探
索ポイントとする。この結果は、CPU IFブロック
8を通し、探索範囲選択信号S8としてMEブロック7
の判定結果保持部7jに供給される。判定結果保持部7
jは、この探索範囲選択信号S8を適切なタイミングで
保持し、探索範囲信号S7として参照バッファ7b,動
きベクトル検出部7c及び参照画像読出アドレス発生部
7dに供給する。次のピクチャでは、参照画像読出アド
レス発生部7dは、探索範囲信号S7 で指定された探索
ポイントを読み出し、動きベクトル検出部7cは探索範
囲信号S7で指定された探索ポイントのみを探索する。
When the transition to the narrow search mode is determined by the above determination, the next picture is set to the narrow search mode,
The search point is the search point with the highest motion vector occurrence frequency. This result, through the CPU IF block 8, ME block 7 as a search range selection signal S 8
Is supplied to the judgment result holding unit 7j. Determination result holding unit 7
j supplies the search range selection signal S 8 held at the right time, the reference buffer 7b as the search range signal S 7, the motion vector detecting section 7c and the reference image read address generation unit 7d. In the next picture, the reference image read address generator 7d reads the search point specified by the search range signal S 7, the motion vector detecting section 7c searches only search point specified by the search range signal S7.

【0089】MEブロック7が狭探索モードで動作して
いるときに、図2に示したME7と同様、シーンの切り
替えなどで入力画像と参照画像との相関が低くなった
り、パンの方向が変化したりして、動きベクトルMVの
集中する場所が探索範囲からはずれてしまう場合、全探
索モードへの復帰が必要である。ここで、1ピクチャ中
の同じ水平方向の配列での左端のマクロブロックMBか
ら右端のマクロブロックMBまでのマクロブロックMB
の列をマクロブロックMBラインというとすると、全探
索モードへの復帰を判定するために、予めいくつかのマ
クロブロックMBラインでは、全探索モードで動きベク
トルを検出することにしておき(以下、かかるマクロブ
ロックMBラインを全探索マクロブロックMBラインと
いう)、狭探索モードの各探索ポイント内の動きベクト
ル発生数をカウントする。CPUブロック4は全探索マ
クロブロックMBラインであることを判断し、狭探索モ
ードが判定されていても、そのマクロブロックMBライ
ンでは、判定結果保持部7jに対して全探索モードを指
定する。これにより、このマクロブロックMBラインで
は、MEブロック7が全探索モードで動作する。
When the ME block 7 is operating in the narrow search mode, as in the case of the ME 7 shown in FIG. 2, the correlation between the input image and the reference image becomes lower due to scene switching or the like, and the pan direction changes. If, for example, the place where the motion vector MV concentrates deviates from the search range, it is necessary to return to the full search mode. Here, macroblocks MB from the leftmost macroblock MB to the rightmost macroblock MB in the same horizontal arrangement in one picture
Is referred to as a macroblock MB line, in order to determine the return to the full search mode, in some macroblock MB lines, a motion vector is detected in advance in the full search mode (hereinafter, such a motion vector is referred to as a macroblock MB line). The number of motion vectors generated in each search point in the narrow search mode is counted. The CPU block 4 determines that it is the full search macroblock MB line, and specifies the full search mode for the determination result holding unit 7j in the macroblock MB line even if the narrow search mode is determined. Thus, in this macro block MB line, the ME block 7 operates in the full search mode.

【0090】探索ポイントカウンタ7iは、全探索マク
ロブロックMBラインで、各探索ポイントに入る動きベ
クトルの発生数をマクロブロックMBライン単位でカウ
ントし、その結果を探索ポイント計数結果S9としてC
PUプロック4にレポートする。CPUブロック4は、
探索ポイント計数結果S9を受け取り、現ピクチャで指
定された探索ポイントでの動きベクトル発生数が閾値以
上であれば、引き続き狭探索モードで同じ探索ポイント
での動きベクトル探索を指定する。それ以外であれば、
現ピクチャ内の次のマクロブロックMBラインからは、
全探索モードで動きベクトルの探索を指定する。ピクチ
ャ内での狭探索モードでの探索ポイントの変更や全探索
モードから狭探索モードへの変更は、画質に与える影響
が大きいので、行なわない。
[0090] search point counter 7i is a full search macroblock MB lines, the number of occurrences of motion vectors entering each search point is counted by the macro block MB line units, C the result as the search point counting result S 9
Report to PU block 4. The CPU block 4
Search point counting result receives S 9, to specify the motion vector search when motion is vector number generated is equal to or greater than the threshold of the search point specified in the current picture, subsequently in the narrow search mode in the same search points. Otherwise,
From the next macroblock MB line in the current picture,
Specify search of motion vector in full search mode. The change of the search point in the narrow search mode in the picture or the change from the full search mode to the narrow search mode is not performed because it greatly affects the image quality.

【0091】また、CPUブロック4は、JUDGEブ
ロック10(図2)からのイントラ/ノンイントラMB
の判定結果を受け取っており、全探索マクロブロックM
Bライン以外であっても、マクロブロックMBライン単
位でイントラMBの割合が多くなった場合、次のマクロ
ブロックMBラインから全探索モードへ復帰させる。
Further, the CPU block 4 receives the intra / non-intra MB from the JUDGE block 10 (FIG. 2).
Has been received, and all the search macro blocks M
Even if it is other than the B line, when the ratio of the intra MB increases in macroblock MB line units, the mode is returned to the full search mode from the next macroblock MB line.

【0092】なお、この実施形態では、狭探索モードで
の探索ポイント(狭探索ポイント:狭い探索範囲)を5
個としたが、探索ポイントの個数は、これに限らず、5
個よりも多くてもよいし、少なくてもよい。
In this embodiment, the number of search points in the narrow search mode (narrow search point: narrow search range) is five.
However, the number of search points is not limited to this and may be 5
It may be more or less than the number.

【0093】また、この実施形態では、狭探索ポイント
を互いに一部が重なるように設定したが、広い探索範囲
を複数の領域に区切り、区切られた夫々の領域を狭探索
ポイントとしてもよい。
In this embodiment, the narrow search points are set so as to partially overlap each other. However, a wide search range may be divided into a plurality of areas, and each of the divided areas may be set as a narrow search point.

【0094】さらに、この実施形態では、1回の探索で
使用できる狭探索ポイントは1つであったが、複数の狭
探索ポイントで探索するようにしてもよい。
Further, in this embodiment, one narrow search point can be used in one search, but a search may be performed using a plurality of narrow search points.

【0095】さらにまた、この実施形態では、各探索ポ
イントに入る動きベクトルの発生数をカウントしてお
き、そのカウント値が高い狭探索ポイントを選択するも
のであったが、カウント値が低い狭探索ポイントでの動
きベクトルの探索を行なわないというアルゴリズムも考
えられる。
Furthermore, in this embodiment, the number of occurrences of motion vectors entering each search point is counted, and a narrow search point having a high count value is selected. An algorithm that does not search for a motion vector at a point is also conceivable.

【0096】上記の例をいくつか組み合わせて、例え
ば、全探索モードの探索範囲を4×4=16個の領域に
分割し、夫々を狭探索ポイントとする。各狭探索ポイン
トでの動きベクトルの発生数をカウントしておき、動き
ベクトルの95%以上が含まれるように狭探索ポイント
を複数個選び、それを次からの動き推定に用いるといっ
た実施形態も考えられる。
By combining some of the above examples, for example, the search range in the full search mode is divided into 4 × 4 = 16 areas, each of which is a narrow search point. An embodiment in which the number of occurrences of motion vectors at each narrow search point is counted, a plurality of narrow search points are selected so as to include 95% or more of the motion vector, and the narrow search point is used for subsequent motion estimation is also considered. Can be

【0097】図10は本発明によるディジタル画像符号
化装置の携帯型ビデオカメラへの一応用例を示すブロッ
ク図である。18はMPEG2エンコーダ(本発明によ
るディジタル画像符号化装置)、19は撮像部、20は
手ぶれ補正部、21はパン検出センサ、22はCPUブ
ロック、23aは磁気テープによる記録部、23bは固
定ディスク装置による記録部、24はCPUバスであ
る。
FIG. 10 is a block diagram showing one application example of the digital image encoding apparatus according to the present invention to a portable video camera. Reference numeral 18 denotes an MPEG2 encoder (a digital image encoding device according to the present invention), 19 denotes an imaging unit, 20 denotes a camera shake correction unit, 21 denotes a pan detection sensor, 22 denotes a CPU block, 23a denotes a recording unit using a magnetic tape, and 23b denotes a fixed disk device. Is a recording unit, and 24 is a CPU bus.

【0098】同図において、携帯型の電気機器では、機
器の電力供給を電池に頼るため、低消費電力化による電
池寿命の増加が必要である。また、携帯型のビデオカメ
ラでは、従来の携帯型ビデオカメラで多く採用されてい
るように、パン検出センサ803を用いて画像のパンを
検出し、この検出結果に応じて画像の手ぶれを補正する
ようにしている。
[0098] In the figure, in a portable electric device, since the power supply of the device depends on a battery, it is necessary to increase the battery life by reducing power consumption. In a portable video camera, as is often used in a conventional portable video camera, a pan detection sensor 803 detects panning of an image and corrects camera shake according to the detection result. Like that.

【0099】パン検出センサ21は、撮像部19の出力
画像信号からパンの情報を検出し、手ぶれ補正ブロック
20とCPUブロック22とに供給する。なお、パン検
出センサ21としては、ジャイロや加速度センサなどを
内蔵し、これらによってパン情報を検出するようにして
もよい。手ぶれ補正ブロック20は、このパン情報をも
とに画像信号の手ぶれによる影響を補正し、手ぶれが補
正された画像信号はMPEG2エンコーダ18に供給さ
れる。MPEG2エンコーダ18で符号化された画像情
報は、記録部23aもしくは23bに記録される。
The pan detection sensor 21 detects pan information from the output image signal of the imaging section 19 and supplies the information to the camera shake correction block 20 and the CPU block 22. In addition, a gyro, an acceleration sensor, and the like may be built in as the pan detection sensor 21 so that the pan information is detected by these. The camera shake correction block 20 corrects the influence of the camera shake of the image signal based on the pan information, and the image signal with the camera shake corrected is supplied to the MPEG2 encoder 18. The image information encoded by the MPEG2 encoder 18 is recorded in the recording unit 23a or 23b.

【0100】なお、このMPEG2エンコーダ18は、
図1におけるMPEG2符号化装置2とSDRAMブロ
ック3とからなるものである。
Note that this MPEG2 encoder 18
It comprises an MPEG2 encoding device 2 and an SDRAM block 3 in FIG.

【0101】一方、パン検出センサ21からのパン情報
はCPUブロック22で解析されて、MPEG2エンコ
ーダ18におけるMEブロック7(図1)での適切な探
索範囲のオフセット値が計算され、その計算値がCPU
バス24を介してMPEG2エンコーダ18に供給され
る。これにより、MPEG2エンコーダ18では、パン
に対応した適切な動きベクトルを検出することができ
る。
On the other hand, the pan information from the pan detection sensor 21 is analyzed by the CPU block 22, and an offset value of an appropriate search range in the ME block 7 (FIG. 1) in the MPEG2 encoder 18 is calculated. CPU
The data is supplied to the MPEG2 encoder 18 via the bus 24. Thereby, the MPEG2 encoder 18 can detect an appropriate motion vector corresponding to pan.

【0102】また、CPUブロック22は、MPEG2
エンコーダ18からのデータをCPUバス24を介して
取り込んで計算し、この計算結果に応じてMPEG2エ
ンコーダ18での動きベクトルの探索範囲の制限を指定
する。これにより、システム全体の低消費電力化が図れ
る。さらに、電池の残り容量不足などの理由によって緊
急に消費電力を押さえたいときには、CPUブロック2
2が探索範囲を制限したままにすることにより、さらな
る低消費電力化が図れる。
Further, the CPU block 22 stores the MPEG2
The data from the encoder 18 is fetched via the CPU bus 24 for calculation, and the limit of the search range of the motion vector in the MPEG2 encoder 18 is specified according to the calculation result. Thereby, low power consumption of the entire system can be achieved. Further, when it is necessary to urgently reduce the power consumption due to a shortage of the remaining battery capacity or the like, the CPU block 2
2 keeps the search range limited, thereby further reducing power consumption.

【0103】図11は本発明によるディジタル画像符号
化装置の遠隔操作自動カメラへの一応用例を示すブロッ
ク図であって、25は運台、26はカメラ、27,28
は伝送部、29は制御部、30は伝送線であり、図10
に対応する部分には同一符号をつけて重複する説明を省
略する。
FIG. 11 is a block diagram showing an example of application of a digital image encoding apparatus according to the present invention to a remote control automatic camera, wherein 25 is a carriage, 26 is a camera, and 27 and 28.
Is a transmission unit, 29 is a control unit, 30 is a transmission line, and FIG.
The same reference numerals are given to the portions corresponding to and the duplicate description will be omitted.

【0104】同図において、カメラ26の遠隔操作を行
なう場合、このカメラ26で撮影して得られる映像信号
を制御部29に供給しなければならない。しかし、伝送
路30の帯域が狭いなどの理由により、カメラ26から
出力される画像データPDをそのままでは伝送しきれな
い場合がある。この応用例では、カメラ26の出力画像
データPDを、一旦、MPEG2エンコーダ18に供給
することにより、符号化してその情報量を圧縮し、しか
る後、伝送部27で伝送路30での伝送に適した信号形
態に変換して伝送路30を伝送し、伝送部28でもとの
信号形態に変換して制御部29に供給され、復号されて
映像が再生されるものである。このようにして、MPE
G2エンコーダ18は、画像データPDをこれより狭い
帯域の伝送路30で伝送するのに有効である。
In the figure, when the camera 26 is remotely operated, a video signal obtained by photographing with the camera 26 must be supplied to the control unit 29. However, there is a case where the image data PD output from the camera 26 cannot be transmitted as it is because the band of the transmission path 30 is narrow. In this application example, the output image data PD from the camera 26 is once supplied to the MPEG2 encoder 18 to encode and compress the amount of information, and then the transmission unit 27 is suitable for transmission on the transmission path 30. The signal is converted to the original signal form and transmitted through the transmission path 30, and the transmission section 28 converts the signal form to the original signal form and supplies it to the control section 29, where it is decoded and reproduced. Thus, the MPE
The G2 encoder 18 is effective for transmitting the image data PD through the transmission path 30 having a narrower band.

【0105】この応用例では、制御部29からのカメラ
操作信号COが伝送部28で処理されて伝送路30を伝
送され、伝送部27で処理されてカメラ操作信号CO'
として雲台25に供給される。これにより、制御部29
からカメラ26の方向を制御することができる。
In this application example, the camera operation signal CO from the control unit 29 is processed by the transmission unit 28 and transmitted through the transmission path 30, and is processed by the transmission unit 27 to be processed by the camera operation signal CO '.
Is supplied to the pan head 25. Thereby, the control unit 29
, The direction of the camera 26 can be controlled.

【0106】ここで、カメラ操作信号CO'をCPUブ
ロック22で解析され、カメラ26がどのように動く
か、予め計算される。この場合、カメラ26の動きとカ
メラ26のレンズの焦点距離とにより、前ピクチャから
現ピクチャまでどのくらいの画素数分パンしたかを計算
でき、その計算結果をもとに、MPEG2エンコーダ1
8での探索範囲の適切なオフセットを計算してこれをM
PEG2エンコーダ18に設定することができる。これ
により、MPEG2エンコーダ18では、パンに対応し
た適切な動きベクトルを検出することができる。
Here, the camera operation signal CO 'is analyzed by the CPU block 22, and how the camera 26 moves is calculated in advance. In this case, the number of pixels panned from the previous picture to the current picture can be calculated based on the movement of the camera 26 and the focal length of the lens of the camera 26. Based on the calculation result, the MPEG2 encoder 1
8 and calculate the appropriate offset of the search range at M
It can be set in the PEG2 encoder 18. Thereby, the MPEG2 encoder 18 can detect an appropriate motion vector corresponding to pan.

【0107】なお、以上の説明では、主にMPEG2符
号化装置についてであったが、例えば、MPEG1や
H.263のような他の規格に対応したディジタル画像
符号化装置や携帯型ビデオカメラの手ぶれ補正装置のパ
ン検出装置など、動き推定装置を用いる装置にも同様に
本発明を適用することができる。
In the above description, the MPEG2 encoding apparatus has been mainly described. However, for example, a camera shake of a digital image encoding apparatus or a portable video camera conforming to another standard such as MPEG1 or H.263. The present invention can be similarly applied to a device using a motion estimation device, such as a pan detection device of a correction device.

【0108】[0108]

【発明の効果】以上説明したように、本発明によれば、
動きベクトルの探索範囲を狭く制限モードと該探索範囲
にオフセットをつける機能を設け、過去のベクトル探索
の結果をもとにオフセット値と探索範囲とを操作するも
のであるから、画質の劣化を最小限に押さえたまま電力
消費の多くを占めるME演算量を削減することができ、
この結果、MPEG2符号化装置全体の消費電力を低減
することができる。
As described above, according to the present invention,
A limited mode for narrowing the search range of the motion vector and a function for offsetting the search range are provided, and the offset value and the search range are operated based on the result of the past vector search, so that the deterioration of the image quality is minimized. It is possible to reduce the amount of ME operation that occupies most of the power consumption while keeping
As a result, the power consumption of the entire MPEG2 encoding device can be reduced.

【0109】また、本発明によれば、外部のパン検出装
置による動き推定の最適化については、オフセット値と
探索範囲を外部CPUによって設定することにより、外
部で検出されるパンに応じた動き推定の最適化が可能と
なる。
According to the present invention, with respect to the optimization of the motion estimation by the external pan detecting device, the offset value and the search range are set by the external CPU, so that the motion estimation according to the pan detected externally is performed. Can be optimized.

【図面の簡単な説明】[Brief description of the drawings]

【図1】本発明による動きベクトル検出装置及びそれを
用いたディジタル画像符号化装置の第1の実施形態を示
すブロック図である。
FIG. 1 is a block diagram showing a first embodiment of a motion vector detection device and a digital image encoding device using the same according to the present invention.

【図2】図1に示したMPEG2符号化装置でMEブロ
ックとして用いる本発明による動きベクトル検出装置の
第1の実施形態を示すブロック図である。
FIG. 2 is a block diagram showing a first embodiment of a motion vector detecting device according to the present invention used as an ME block in the MPEG2 coding device shown in FIG. 1;

【図3】符号化画像と参照画像との相関が低い場合の動
きベクトルの分布図である。
FIG. 3 is a distribution diagram of a motion vector when a correlation between an encoded image and a reference image is low.

【図4】符号化画像と参照画像との相関が高い場合の動
きベクトルの分布図である。
FIG. 4 is a distribution diagram of a motion vector when a correlation between an encoded image and a reference image is high.

【図5】符号化画像と参照画像との相関が高い場合の探
索範囲の制限とオフセットの説明図である。
FIG. 5 is an explanatory diagram of a search range limitation and an offset when a correlation between an encoded image and a reference image is high.

【図6】探索範囲が制限された状態で符号化画像と参照
画像との相関が低い場合の説明図である。
FIG. 6 is an explanatory diagram in a case where a correlation between an encoded image and a reference image is low in a state where a search range is limited.

【図7】図1に示した第1の実施形態における動きベク
トルのスケーリングの説明図である。
FIG. 7 is an explanatory diagram of scaling of a motion vector in the first embodiment shown in FIG. 1;

【図8】図1に示したディジタル画像符号化装置にME
ブロックとして使用可能な動きベクトル検出装置の第2
の実施形態を示すブロック図である。
FIG. 8 shows a digital image encoding device shown in FIG.
Second of motion vector detecting devices usable as blocks
It is a block diagram showing an embodiment.

【図9】図8に示した実施形態における動きベクトル検
出のための探索範囲の説明図である。
9 is an explanatory diagram of a search range for detecting a motion vector in the embodiment shown in FIG.

【図10】本発明によるディジタル画像符号化装置の一
応用例を示すブロック図である。
FIG. 10 is a block diagram illustrating an application example of a digital image encoding device according to the present invention.

【図11】本発明によるディジタル画像符号化装置の他
の応用例を示すブロック図である。
FIG. 11 is a block diagram showing another application example of the digital image encoding device according to the present invention.

【符号の説明】[Explanation of symbols]

1 画像データの入力端子 2 MPEG2符号化装置 3 SDRAM 4 CPUブロック 5 ビットストリームの出力端子 6 VIDEOプロック 7 MEブロック 7a 入力画像バッファ 7b 参照画像バッファ 7c 動きベクトル検出部 7d 参照画像読出アドレス発生部 7e 値保持部、 7f 判定計数部 7g 平均値算出部 7h 分散値算出部 7i 探索ポイントカウンタ 7j 判定結果保持部 8 CPU IFブロック 9 MCブロック 10 JUDGEブロック 11 DCT/IDCTブロック 12 Q/IQブロック 13 RATEブロック 14 VLCブロック 15 CODEブロック 16 SDRAMアドレスバス 17 SDRAMデータバス 18 MPEG2エンコーダ 19 撮像部 20 手ぶれ補正部 21 パン検出センサ 22 CPU 23a,23b 記録部 25 雲台 26 カメラ 29 制御部 30 伝送路 Reference Signs List 1 image data input terminal 2 MPEG2 encoding device 3 SDRAM 4 CPU block 5 bit stream output terminal 6 VIDEO block 7 ME block 7a input image buffer 7b reference image buffer 7c motion vector detector 7d reference image read address generator 7e value Holding unit, 7f Judgment counting unit 7g Average value calculation unit 7h Variance value calculation unit 7i Search point counter 7j Judgment result holding unit 8 CPU IF block 9 MC block 10 JUDGE block 11 DCT / IDCT block 12 Q / IQ block 13 RATE block 14 VLC block 15 CODE block 16 SDRAM address bus 17 SDRAM data bus 18 MPEG2 encoder 19 Imaging unit 20 Camera shake correction unit 21 Pan detection sensor 22 CPU 23 , 23b recording unit 25 pan head 26 camera 29 control unit 30 the transmission line

───────────────────────────────────────────────────── フロントページの続き (72)発明者 本巣 聰 神奈川県横浜市戸塚区吉田町292番地 株 式会社日立製作所マルチメディアシステム 開発本部内 (72)発明者 小堀 智生 神奈川県横浜市戸塚区吉田町292番地 株 式会社日立製作所マルチメディアシステム 開発本部内 ──────────────────────────────────────────────────続 き Continuing on the front page (72) Inventor Satoshi Motosu 292 Yoshida-cho, Totsuka-ku, Yokohama-shi, Kanagawa Prefecture Inside the multimedia system development headquarters of Hitachi, Ltd. (72) Tomoo Kobori Yoshida-cho, Totsuka-ku, Yokohama-shi, Kanagawa 292 Hitachi Multimedia Systems Development Division

Claims (6)

【特許請求の範囲】[Claims] 【請求項1】 動画像を圧縮符号化するディジタル画像
符号化装置であって、 該動画像の画像データを入力する入力手段と、 参照画像の画像データを蓄積するための蓄積手段と、 該入力手段から入力される該動画の画像データ毎に動き
ベクトルの探索範囲が設定され、設定された探索範囲で
の該参照画像の画像データを該蓄積手段から読み取り、
該探索範囲の該画像データを用いて入力された該動画の
画像データに対する動きベクトルを検出する動きベクト
ル検出手段と、 該動きベクトル検出手段で検出された該動きベクトルを
用いて、該動きベクトルに対応する入力された該動画象
の画像データを符号化する符号化手段と、 該動きベクトル検出手段に設定される該探索範囲の大き
さを可変とする制御手段とを備えたことを特徴とするデ
ィジタル画像符号化装置。
1. A digital image coding apparatus for compressing and coding a moving image, comprising: input means for inputting image data of the moving image; storage means for storing image data of a reference image; A search range of a motion vector is set for each image data of the moving image input from the means, and the image data of the reference image in the set search range is read from the storage means.
A motion vector detecting unit that detects a motion vector for the image data of the moving image input using the image data in the search range; and using the motion vector detected by the motion vector detecting unit, Encoding means for encoding the corresponding input image data of the moving image, and control means for varying the size of the search range set in the motion vector detecting means. Digital image coding device.
【請求項2】 請求項1において、 前記動きベクトル検出手段は、 前記蓄積手段での前記参照画像の画像データの読出しの
ためのアドレス信号を発生する参照画像読出アドレス発
生手段と、 該アドレス信号に応じて前記蓄積手段から読み出された
前記参照画像の画像データを蓄積し、前記探索範囲の画
像データを保持する参照画像バッファ手段と、 前記入力手段からの前記動画像の画像データを蓄積する
入力画像バッファ手段と、 該参照画像バッファ手段に蓄積された前記参照画像の画
像データと該入力画像バッファ手段に蓄積された前記動
画像の画像データとが供給され、前記探索範囲内で、前
記参照画像の画像データと前記動画像の入力画像データ
との相対位置を変化させつつ、夫々の相対的な位置関係
毎に前記参照画像の画像データと前記動画像の画像デー
タとの間で予測誤差を算出して、該予測誤差が最小とな
る前記参照画像の画像データと前記動画像の画像データ
との位置関係を検出し、検出した該予測誤差が最小とな
る該位置関係を表わす動きベクトルを生成,出力する画
像位置検出手段とを有し、 前記制御手段は、 前記画像位置検出手段によって検出された前記参照画像
の画像データと前記入力された動画像の画像データとの
間の相対位置と該相対位置に応じた情報を用いて前記探
索範囲の大きさを決定し、前記符号化手段からの符号化
が行われたか否かを示すの情報に応じて、決定した該大
きさを指定する前記制御信号を出力する参照範囲制御手
段を有することを特徴とするディジタル画像符号化装
置。
2. The reference image reading address generating means according to claim 1, wherein said motion vector detecting means generates an address signal for reading image data of said reference image in said storage means. Reference image buffer means for accumulating image data of the reference image read from the accumulating means in response to the image data of the search range; and an input for accumulating image data of the moving image from the input means. Image buffer means, image data of the reference image stored in the reference image buffer means and image data of the moving image stored in the input image buffer means are supplied, and the reference image is stored within the search range. While changing the relative position between the image data of the reference image and the input image data of the moving image, the image data of the reference image A prediction error is calculated between the image data of the moving image and the positional relationship between the image data of the reference image and the image data of the moving image in which the prediction error is minimized. Image position detecting means for generating and outputting a motion vector representing the positional relationship that minimizes the relationship, wherein the control means includes: the image data of the reference image detected by the image position detecting means; The relative position between the image data of the moving image and the size of the search range is determined using information corresponding to the relative position, and information indicating whether or not encoding has been performed from the encoding unit. And a reference range control means for outputting the control signal designating the determined size in accordance with the range.
【請求項3】 入力手段から動画像の入力画像データが
所望のブロック単位で入力され、該所望のブロック単位
の入力画像データ毎に、探索範囲の参照画像の画像デー
タを用いて動きベクトルを検出する動きベクトル検出装
置において、 参照画像の画像データを蓄積する蓄積手段と、 該蓄積手段での該参照画像の画像データを読み出す領域
を指定するアドレス信号を発生するアドレス発生手段
と、 該蓄積手段から読み出された該参照画像の画像データが
書き込まれ、該探索範囲の参照画像の画像データを記憶
する参照画像バッファ手段と、 該所望のブロック単位の入力画像データを記憶する入力
画像バッファ手段と、 該参照画像バッファ手段から該探索範囲の参照画像の画
像データを、該入力画像バッファ手段から該所望のブロ
ック単位の入力画像データを夫々読み取り、該探索範囲
内で該参照画像の画像データと該所望のブロック単位の
入力画像データとの相対位置関係を順次変化させなが
ら、夫々の該相対位置関係毎に該参照画像の画像データ
と該所望のブロック単位の入力画像データとの予測誤差
を算出して、該予測誤差が最小となる該相対位置関係を
検出し、検出した該相対位置関係を表わし該所望のブロ
ック単位の入力画像データの符号化のための動きベクト
ルを生成,出力する動きベクトル検出部と、 該動きベクトル検出部で検出される該相対位置関係毎の
該予測誤差の分布と、該動きベクトルが該所望のブロッ
ク単位の入力画像データの符号化に使用されたか否かを
示す情報とに応じて該探索範囲の大きさを指定する制御
信号を生成する探索範囲制御手段とを備え、該動きベク
トル検出部で設定される該探索範囲の大きさを該制御信
号に応じて可変とすることを特徴とする動きベクトル検
出装置。
3. Input image data of a moving image is input from an input unit in a desired block unit, and a motion vector is detected for each input image data in the desired block unit using image data of a reference image in a search range. A storage means for storing image data of a reference image, an address generation means for generating an address signal for designating an area from which the image data of the reference image is read by the storage means, Reference image buffer means for storing the read image data of the reference image and storing image data of the reference image in the search range; input image buffer means for storing the input image data of the desired block unit; The image data of the reference image in the search range is sent from the reference image buffer means to the desired block unit from the input image buffer means. Force image data, and sequentially changing the relative positional relationship between the image data of the reference image and the input image data of the desired block unit within the search range, while changing the relative image relationship for each of the relative positional relationships. Calculating a prediction error between the image data of the desired block unit and the input image data of the desired block unit, detecting the relative positional relationship in which the predicted error is minimized, representing the detected relative positional relationship, and representing the detected A motion vector detection unit that generates and outputs a motion vector for encoding the input image data of the above; a distribution of the prediction error for each of the relative positional relationships detected by the motion vector detection unit; Search range control means for generating a control signal for designating the size of the search range in accordance with information indicating whether or not the input image data has been used for encoding the desired block unit of input image data. Motion vector detecting apparatus characterized by a variable according the size of the search range set by the motion vector detection unit to the control signal.
【請求項4】 請求項3において、 前記動きベクトル検出部は、前記参照画像を上下左右に
移動する範囲として、広い範囲と狭い範囲との2種類の
動作方式を持ち、該狭い範囲での探索位置が複数である
ことを特徴とする動きベクトル検出装置。
4. The motion vector detection unit according to claim 3, wherein the motion vector detection unit has two types of operation modes, a wide range and a narrow range, as a range for moving the reference image up, down, left, and right, and searches in the narrow range. A motion vector detecting device having a plurality of positions.
【請求項5】 請求項4において、 前記狭い範囲での前記参照画像位置の検出から前記広い
範囲での前記参照画像位置の検出へと遷移するために、
予め設定されていた場合には、無条件で広い範囲での前
記参照画像位置の検出を行ない、前記設定された位置で
の前記参照画像位置の検出が妥当であるか否かを判断す
ることを特徴とする動きベクトル検出装置。
5. The method according to claim 4, wherein a transition from detection of the reference image position in the narrow range to detection of the reference image position in the wide range is performed.
If it is set in advance, the detection of the reference image position in a wide range is unconditionally performed, and it is determined whether or not the detection of the reference image position at the set position is appropriate. Characteristic motion vector detection device.
【請求項6】 請求項4において、 前記探索範囲が狭い範囲であるとき、前記探索範囲制御
手段は、前記動きベクトル検出部で検出される前記相対
位置関係毎の前記予測誤差の分布の偏り位置に応じて、
前記探索範囲の位置にオフセットを設定することを特徴
とする動きベクトル検出装置。
6. The method according to claim 4, wherein, when the search range is a narrow range, the search range control unit adjusts the bias position of the distribution of the prediction error for each of the relative positional relationships detected by the motion vector detection unit. In response to,
A motion vector detecting device, wherein an offset is set at a position in the search range.
JP11350298A 1998-04-23 1998-04-23 Digital image coder and motion vector detector used therefor Pending JPH11308617A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP11350298A JPH11308617A (en) 1998-04-23 1998-04-23 Digital image coder and motion vector detector used therefor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP11350298A JPH11308617A (en) 1998-04-23 1998-04-23 Digital image coder and motion vector detector used therefor

Publications (1)

Publication Number Publication Date
JPH11308617A true JPH11308617A (en) 1999-11-05

Family

ID=14613958

Family Applications (1)

Application Number Title Priority Date Filing Date
JP11350298A Pending JPH11308617A (en) 1998-04-23 1998-04-23 Digital image coder and motion vector detector used therefor

Country Status (1)

Country Link
JP (1) JPH11308617A (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002152760A (en) * 2000-10-11 2002-05-24 Samsung Electronics Co Ltd Hybrid type high-speed motion estimate method and its device
JP2003009179A (en) * 2001-06-22 2003-01-10 Olympus Optical Co Ltd Motion vector and parallax vector detecting device
JP2005354528A (en) * 2004-06-11 2005-12-22 Canon Inc Device and method for detecting motion vector
WO2007136095A1 (en) * 2006-05-24 2007-11-29 Panasonic Corporation Dynamic image decoding device, and dynamic image decoding method
WO2008136178A1 (en) * 2007-04-26 2008-11-13 Panasonic Corporation Motion detection apparatus, motion detection method, and motion detection program
US8208541B2 (en) 2006-04-03 2012-06-26 Panasonic Corporation Motion estimation device, motion estimation method, motion estimation integrated circuit, and picture coding device
US8542740B2 (en) 2007-08-07 2013-09-24 Panasonic Corporation Image coding apparatus and method for converting first coded data coded into second coded data based on picture type
US8548058B2 (en) 2007-08-07 2013-10-01 Panasonic Corporation Image coding apparatus and method for re-recording decoded video data
CN110740329A (en) * 2018-07-19 2020-01-31 腾讯美国有限责任公司 Video encoding and decoding method and device, computer equipment and storage medium

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002152760A (en) * 2000-10-11 2002-05-24 Samsung Electronics Co Ltd Hybrid type high-speed motion estimate method and its device
JP2003009179A (en) * 2001-06-22 2003-01-10 Olympus Optical Co Ltd Motion vector and parallax vector detecting device
JP4608136B2 (en) * 2001-06-22 2011-01-05 オリンパス株式会社 Motion vector and parallax vector detection device
JP2005354528A (en) * 2004-06-11 2005-12-22 Canon Inc Device and method for detecting motion vector
JP4514203B2 (en) * 2004-06-11 2010-07-28 キヤノン株式会社 Motion vector detection apparatus and method
US8208541B2 (en) 2006-04-03 2012-06-26 Panasonic Corporation Motion estimation device, motion estimation method, motion estimation integrated circuit, and picture coding device
WO2007136095A1 (en) * 2006-05-24 2007-11-29 Panasonic Corporation Dynamic image decoding device, and dynamic image decoding method
WO2008136178A1 (en) * 2007-04-26 2008-11-13 Panasonic Corporation Motion detection apparatus, motion detection method, and motion detection program
US8542740B2 (en) 2007-08-07 2013-09-24 Panasonic Corporation Image coding apparatus and method for converting first coded data coded into second coded data based on picture type
US8548058B2 (en) 2007-08-07 2013-10-01 Panasonic Corporation Image coding apparatus and method for re-recording decoded video data
CN110740329A (en) * 2018-07-19 2020-01-31 腾讯美国有限责任公司 Video encoding and decoding method and device, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
JP3443880B2 (en) Video signal encoding method and decoding method
EP1065883B1 (en) Image predictive decoding method
US6542642B2 (en) Image coding process and motion detecting process using bidirectional prediction
US20030202587A1 (en) Video data encoding apparatus and method for removing a continuous repeat field from the video data
EP1879388A1 (en) Video information recording device, video information recording method, video information recording program, and recording medium containing the video information recording program
US20070291131A1 (en) Apparatus and Method for Controlling Image Coding Mode
JP4755093B2 (en) Image encoding method and image encoding apparatus
JPH0818979A (en) Image processor
JPH11308617A (en) Digital image coder and motion vector detector used therefor
US6819713B1 (en) Image processing apparatus and method for correcting a detected luminance and encoding or decoding
JPH0541861A (en) Moving picture encoding equipment
JP2006270683A (en) Coding device and method
JPH06350995A (en) Moving picture processing method
JP3947316B2 (en) Motion vector detection apparatus and moving picture encoding apparatus using the same
JPH11239352A (en) Image processing method, image processing unit and data storage medium
JP2001238182A (en) Image reproduction device and image reproduction method
JP3428332B2 (en) Image encoding method and apparatus, and image transmission method
JPH0951538A (en) Encoding method for image signal
JPH09261530A (en) Video recorder
JP2000115777A (en) Image processing method and image processing unit
JP2008199521A (en) Image processing apparatus and method thereof
JP3590976B2 (en) Video compression device
KR100397133B1 (en) Method and System for compressing/transmiting of a picture data
JPH07107473A (en) Picture encoder
JP3465660B2 (en) Video signal decoding method