JPH09284776A - Image coding device and method - Google Patents

Image coding device and method

Info

Publication number
JPH09284776A
JPH09284776A JP11530896A JP11530896A JPH09284776A JP H09284776 A JPH09284776 A JP H09284776A JP 11530896 A JP11530896 A JP 11530896A JP 11530896 A JP11530896 A JP 11530896A JP H09284776 A JPH09284776 A JP H09284776A
Authority
JP
Japan
Prior art keywords
motion
image data
motion amount
code
detected
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.)
Granted
Application number
JP11530896A
Other languages
Japanese (ja)
Other versions
JP3724662B2 (en
Inventor
Goro Kato
吾郎 加藤
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.)
Sony Corp
Original Assignee
Sony Corp
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 Sony Corp filed Critical Sony Corp
Priority to JP11530896A priority Critical patent/JP3724662B2/en
Publication of JPH09284776A publication Critical patent/JPH09284776A/en
Application granted granted Critical
Publication of JP3724662B2 publication Critical patent/JP3724662B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide an image coder in which deterioration in the coding efficiency is avoided in advance with respect to the image coder. SOLUTION: The coder is provided with an optimum code detection means 13 that collects detected motion amounts (S2) by one pattern to detect a maximum motion amount, obtains a minimum detection range to detect the maximum motion amount to give a code (S10) denoting the minimum detection range to a coding mans 3, Thus, an optimum code in response to the motion amount detected actually is obtained and a margin to denote the motion amount is reduced. Thus, a fact of deteriorating the coding efficiency due to the increased margin like a conventional device is avoided in advance.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【目次】以下の順序で本発明を説明する。 発明の属する技術分野 従来の技術(図4〜図8) 発明が解決しようとする課題 課題を解決するための手段 発明の実施の形態(図1〜図3) 発明の効果[Table of Contents] The present invention will be described in the following order. TECHNICAL FIELD OF THE INVENTION Conventional Technology (FIGS. 4 to 8) Problems to be Solved by the Invention Means for Solving the Problems Embodiments of the Invention (FIGS. 1 to 3)

【0002】[0002]

【発明の属する技術分野】本発明は画像符号化装置及び
画像符号化方法に関し、例えば画像信号を光磁気デイス
クや磁気テープなどの記録媒体に記録したり、或いは画
像信号を放送局などから受信端末装置側に向けて伝送す
る際に適用して好適なものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an image coding apparatus and an image coding method, for example, recording an image signal on a recording medium such as a magneto-optical disk or a magnetic tape, or receiving an image signal from a broadcasting station or the like. It is suitable to be applied when transmitting to the device side.

【0003】[0003]

【従来の技術】従来、画像信号をデイジタル化して記録
又は伝送する場合、単純にデイジタル化しただけでは画
像データのデータ量が膨大になり、そのため記録媒体の
記録容量や伝送路の伝送速度が膨大になつてしまう。こ
れを回避するため、画像信号をデイジタル化して記録又
は伝送する場合には、一般に画像データを符号化して圧
縮することによりデータ量を減らすようになされてい
る。その際使用される代表的な符号化方式として、動き
補償フレーム間予測符号化がある。
2. Description of the Related Art Conventionally, when an image signal is digitalized and recorded or transmitted, the amount of image data becomes enormous if it is simply digitized. Therefore, the recording capacity of a recording medium and the transmission speed of a transmission line are enormous. Will end up. In order to avoid this, when the image signal is digitalized and recorded or transmitted, the data amount is generally reduced by encoding and compressing the image data. Motion-compensated interframe predictive coding is a typical coding method used at that time.

【0004】この動き補償フレーム間予測符号化はフレ
ーム間予測符号化に動き補償を適用した符号化方式であ
る。フレーム間予測符号化とは、現フレームの各画素値
と、当該現フレームとは時間的に異なる他のフレーム
(以下、参照フレームと呼ぶ)から予測した予測値との
差分(以下、これを予測残差と呼ぶ)を取り、当該差分
を量子化することによりデータ量を減らす符号化方式で
ある。また動き補償とは、単純に参照フレームの画素値
から予測するのではなく、フレーム内の各部の動き量
(以下、これを動きベクトルと呼ぶ)を検出し、当該動
き量を考慮した予測を行うことにより予測精度を向上す
ると共に、データ量を減らす方式である。
This motion-compensated interframe predictive coding is a coding system in which motion compensation is applied to interframe predictive coding. Inter-frame predictive coding is a difference between each pixel value of the current frame and a prediction value predicted from another frame temporally different from the current frame (hereinafter referred to as a reference frame) It is a coding method that reduces the amount of data by taking the residual) and quantizing the difference. Motion compensation does not simply predict from the pixel value of the reference frame, but detects the motion amount of each part in the frame (hereinafter, referred to as motion vector) and performs prediction in consideration of the motion amount. This improves the prediction accuracy and reduces the amount of data.

【0005】すなわち動き補償フレーム間予測符号化と
は、図4に示すように、現フレームの動きベクトルxを
検出し、その動きベクトルの分だけシフトした予測値と
現フレームとの予測残差を量子化することによりデータ
量を減らす符号化方式である。この方式の場合には、復
号時に動きベクトルの情報が必要になるため、符号化さ
れた画像データを記録又は伝送する際には、その動きベ
クトルも符号化されて記録又は伝送される。因みに、動
きベクトルを検出する際には、所定の大きさの検出範囲
aが指定され、その検出範囲内で動きベクトルを検出す
るようになされている。
That is, the motion-compensated interframe predictive coding, as shown in FIG. 4, detects the motion vector x of the current frame, and calculates the prediction residual difference between the prediction value shifted by the motion vector and the current frame. This is a coding method that reduces the amount of data by quantizing. In the case of this method, since information on a motion vector is required at the time of decoding, when recording or transmitting encoded image data, the motion vector is also encoded and recorded or transmitted. Incidentally, when detecting a motion vector, a detection range a having a predetermined size is designated, and the motion vector is detected within the detection range.

【0006】このような動き補償フレーム間予測符号化
の代表的なものとして、ISO(International Organi
zation for Standardization:国際標準化機構)等の機
関によつて標準化されたMPEG(Moving Picture Exp
ert Group )1やMPEG2といつた符号化方式があ
る。これらの符号化方式は上述した動き補償フレーム間
予測に加えて2次元DCT(Discrete Cosine Transfor
m :離散コサイン変換)や可変長符号化を組み合わせた
方式であり、一段と画像データのデータ量を削減し得る
ようになされたものである。因みに、MPEG1は主に
動画像を光磁気デイスクや磁気テープに記録する際に使
用される符号化方式である。またMPEG2は主に動画
像を放送又は伝送する際に使用される符号化方式であ
り、MPEG1の機能を拡張したものである。
As a typical one of such motion-compensated inter-frame predictive coding, ISO (International Organi)
zation for Standardization: MPEG (Moving Picture Exp) standardized by organizations such as the International Organization for Standardization
ert Group) 1 and MPEG2. In addition to the motion-compensated inter-frame prediction described above, these coding methods include two-dimensional DCT (Discrete Cosine Transfor).
m: Discrete Cosine Transform) and variable length coding, which is designed to further reduce the amount of image data. Incidentally, MPEG1 is an encoding method mainly used when recording a moving image on a magneto-optical disk or a magnetic tape. MPEG2 is an encoding method mainly used when broadcasting or transmitting moving images, and is an extension of the function of MPEG1.

【0007】このようなMPEG1やMPEG2では
(以下、総称して単にMPEGと呼ぶ)、1フレーム画
像を16×16画素のブロツク(以下、これをマクロブロツ
クと呼ぶ)に分割し、このブロツク単位で符号化処理を
行う。またMPEGの符号化モードには、大別してイン
トラ符号化と非イントラ符号化の2つがある。イントラ
符号化は符号化対象のフレーム画像をそのフレーム内の
情報だけで符号化する、いわゆるフレーム内符号化であ
る。また非イントラ符号化は符号化対象のフレーム画像
をそのフレーム内の情報とそのフレームとは時間的に異
なる他のフレームの情報との双方を使用して符号化す
る、いわゆるフレーム間予測符号化である。
In such MPEG1 and MPEG2 (hereinafter collectively referred to simply as MPEG), one frame image is divided into blocks of 16 × 16 pixels (hereinafter referred to as macroblocks), and each block is divided into blocks. Encoding process is performed. The MPEG coding modes are roughly classified into intra coding and non-intra coding. Intra-encoding is so-called intra-frame encoding in which a frame image to be encoded is encoded only by information in the frame. Non-intra coding is a so-called inter-frame predictive coding in which a frame image to be coded is coded using both the information in the frame and the information of other frames temporally different from the frame. is there.

【0008】またMPEGでは、図5に示すように、幾
つかのフレーム画像のまとまりをグループオブピクチヤ
(Group Of Picture:以下、これをGOPと呼ぶ)とし
て定義し、そのGOPを基本単位として符号化処理を行
うようになされている。GOP内の各フレーム画像は、
Iピクチヤ(Intra coded picture )、Pピクチヤ(Pr
edictive coded picture)又はBピクチヤ(Bidirectio
nally predictive coded picture)のいずれかに分類さ
れ、各ピクチヤに対応した符号化処理が行われる。例え
ば図5においては、GOPの先頭のフレーム画像F1を
Iピクチヤとして符号化処理し、2番目のフレーム画像
F2をBピクチヤとして符号化処理し、3番目のフレー
ム画像F3をPピクチヤとして符号化処理している。以
下、同様に4番目以降のフレーム画像F4〜F17につ
いてはBピクチヤ又はPピクチヤとして交互に符号化処
理している。
In MPEG, as shown in FIG. 5, a group of several frame images is defined as a group of picture (hereinafter referred to as GOP), and the GOP is used as a basic unit for coding. It is designed to carry out processing. Each frame image in the GOP is
I picture (Intra coded picture), P picture (Pr)
edictive coded picture) or B picture (Bidirectio)
nally predictive coded picture), and the encoding process corresponding to each picture is performed. For example, in FIG. 5, the first frame image F1 of the GOP is encoded as an I-picture, the second frame image F2 is encoded as a B-picture, and the third frame image F3 is encoded as a P-picture. are doing. Hereinafter, similarly, the fourth and subsequent frame images F4 to F17 are alternately encoded as the B picture or the P picture.

【0009】またこの例では、各ピクチヤに対する具体
的な符号化処理としては以下のようになつている。Iピ
クチヤの場合には、フレーム内符号化を施し、そのフレ
ーム画像内の情報だけを符号化する。またPピクチヤの
場合には、図5(A)に示すように、そのフレーム画像
よりも時間的に過去にあるIピクチヤ又はPピクチヤか
ら予測した予測値とそのフレーム画像との予測残差を符
号化する(すなわち順方向フレーム間予測符号化)。ま
たBピクチヤの場合には、図5(B)に示すように、そ
のフレーム画像よりも時間的に過去及び未来にあるフレ
ーム画像の双方から予測した予測値とそのフレーム画像
との予測残差を符号化する(すなわち双方向フレーム間
予測符号化)。因みに、時間的に過去又は未来のフレー
ム画像から予測値を求める場合には(すなわちフレーム
間予測符号化の場合には)、動きベクトルを検出して予
測値に動き補償を行う。従つてIピクチヤやBピクチヤ
の場合には、予測残差の他に動き補償に使用した動きベ
クトルの情報も符号化される。
Further, in this example, the concrete encoding process for each picture is as follows. In the case of I picture, intra-frame coding is performed and only the information in the frame image is coded. In the case of P-picture, as shown in FIG. 5A, the prediction residual predicted between the predicted value predicted from the I-picture or the P-picture that is temporally earlier than the frame picture and the prediction residual of the frame picture are coded. (That is, forward interframe predictive coding). In the case of the B picture, as shown in FIG. 5B, the prediction value predicted from both the frame images that are temporally past and future than the frame image and the prediction residual difference between the frame image and Encode (that is, bidirectional interframe predictive encoding). Incidentally, in the case of obtaining a prediction value from a temporally past or future frame image (that is, in the case of interframe predictive coding), a motion vector is detected and motion compensation is performed on the prediction value. Therefore, in the case of I-picture or B-picture, the information of the motion vector used for motion compensation is also encoded in addition to the prediction residual.

【0010】ここで動きベクトルを検出する際には、図
4に示したような所定の検出範囲aが設定され、その検
出範囲内で動きベクトルを検出する。その際、一般的に
は、図6に示すように、予測に際して参照するフレーム
画像の距離に応じて検出範囲aを変えるようになされて
いる。例えば参照距離が「1」の場合(すなわち隣のフ
レーム画像を参照する場合)には、図6に示すような検
出範囲a1 の中から動きベクトルを検出し、参照距離が
「2」の場合(すなわち2つ隣のフレーム画像を参照す
る場合)には、図6に示すように、検出範囲a1 よりも
広い検出範囲a2 の中から動きベクトルを検出し、参照
距離が「3」の場合(すなわち3つ隣のフレーム画像を
参照する場合)には、図6に示すように、検出範囲a2
よりも広い検出範囲a3 の中から動きベクトルを検出す
る。
When detecting the motion vector, a predetermined detection range a as shown in FIG. 4 is set, and the motion vector is detected within the detection range. At that time, generally, as shown in FIG. 6, the detection range a is changed according to the distance of the frame image referred to in the prediction. For example, when the reference distance is "1" (that is, when the adjacent frame image is referred to), the motion vector is detected from the detection range a 1 as shown in FIG. 6, and the reference distance is "2". In the case where two adjacent frame images are referred to, the motion vector is detected from the detection range a 2 wider than the detection range a 1 and the reference distance is “3” as shown in FIG. in the case (i.e. when referring to three neighboring frame images), as shown in FIG. 6, the detection range a 2
A motion vector is detected within a wider detection range a 3 .

【0011】因みに、動きベクトルはマクロブロツク単
位で検出される。その際に使用される検出方法として
は、例えば現フレーム側のマクロブロツク(以下、基準
ブロツクと呼ぶ)を固定しておき、参照フレーム側のマ
クロブロツク(以下、参照ブロツクと呼ぶ)を検出範囲
a内で移動させ、基準ブロツクと最も似通つた参照ブロ
ツクの位置を見つけることにより、動きベクトルを検出
する。
Incidentally, the motion vector is detected in macroblock units. As a detection method used at that time, for example, a macro block on the side of the current frame (hereinafter referred to as a standard block) is fixed, and a macro block on the side of the reference frame (hereinafter referred to as a reference block) is detected as a detection range a. The motion vector is detected by moving in and finding the position of the reference block that most closely resembles the reference block.

【0012】ところで符号化対象のフレーム画像がPピ
クチヤやBピクチヤの場合には動きベクトルの情報も符
号化されるが、その際、実際には動きベクトルそのもの
を符号化するのではなく、上述した動きベクトルの検出
範囲aを示すエフコード(以下、fコードと呼ぶ)と、
そのfコードを使用して表した動きベクトルの大きさを
表すパラメータ(具体的にはモーシヨンコードとモーシ
ヨンレジデユアル)とを符号化する。また動きベクトル
を検出する際の検出範囲a1 〜a3 等(図6参照)も、
実際にはfコードによつて指定されている。例えば参照
距離が「1」であればfコード「3」が指定され、参照
距離が「2」であればfコード「4」が指定され、参照
距離が「3」であればfコード「5」が指定される。
By the way, when the frame image to be encoded is a P-picture or a B-picture, the motion vector information is also coded. An F code (hereinafter referred to as an f code) indicating the motion vector detection range a;
A parameter (specifically, a motion code and a motion residual) representing the magnitude of the motion vector expressed by using the f code is encoded. Further, the detection range a 1 to a 3 etc. when detecting the motion vector (see FIG. 6)
Actually, it is designated by the f code. For example, if the reference distance is "1", the f code "3" is specified, if the reference distance is "2", the f code "4" is specified, and if the reference distance is "3", the f code "5". Is specified.

【0013】ここでfコードと実際の検出範囲との対応
関係を図7に示す。この図7に示すように、検出範囲は
画素数で示されている。例えばfコード「3」が指定さ
れている場合には、基準ブロツクの位置を中心として
「−32」画素から「+31.5」画素までの範囲で動きベク
トルを検出するようになされている。因みに、検出範囲
としては水平方向と垂直方向の2つのパラメータがあ
り、動きベクトルも水平方向と垂直方向とでそれぞれ別
々に検出される。すなわちfコード「3」が指定された
場合には、基準ブロツクを中心とした水平方向の「−3
2」画素から「+31.5」画素までの範囲において水平方
向の動きベクトルを検出すると共に、基準ブロツクを中
心とした垂直方向の「−32」画素から「+31.5」画素ま
での範囲において垂直方向の動きベクトルを検出する。
なお、MPEG1では水平及び垂直方向に対して同じf
コードを指定するようになつており、MPEG2では水
平及び垂直方向に対して独立にfコードを指定し得るよ
うになつている。またfコードとしては各ピクチヤ毎に
1つのfコードが指定されるようになつている(但し、
MPEG2では上述したように水平及び垂直方向で独立
にfコードを指定し得るためfコードとしては実際には
2つになる)。
FIG. 7 shows the correspondence between the f code and the actual detection range. As shown in FIG. 7, the detection range is indicated by the number of pixels. For example, when the f code "3" is designated, the motion vector is detected in the range from "-32" pixels to "+31.5" pixels centering on the position of the reference block. Incidentally, the detection range has two parameters in the horizontal direction and the vertical direction, and the motion vector is also detected separately in the horizontal direction and the vertical direction. That is, when the f code "3" is specified, the horizontal direction "-3" centered on the reference block
The horizontal motion vector is detected in the range from 2 "pixel to" +31.5 "pixel, and vertical in the range from" -32 "pixel to" +31.5 "pixel in the vertical direction centered on the reference block. The motion vector in the direction is detected.
In MPEG1, the same f is applied in the horizontal and vertical directions.
The code is designated, and in MPEG2, the f code can be designated independently in the horizontal and vertical directions. Also, as the f-code, one f-code is specified for each picture (however,
In MPEG2, since the f-codes can be designated independently in the horizontal and vertical directions as described above, there are actually two f-codes).

【0014】ここでこのようなMPEGの原理に基づい
て形成された符号化装置の構成を図8に示す。但し、こ
こでは符号化処理として図5に示した参照関係で符号化
処理するものとして説明する。この図5に示すように、
符号化装置1は大別して動きベクトル検出器2と符号化
器3とによつて構成されている。動きベクトル検出器2
は、画像データS1から得られる1ピクチヤ分の画像デ
ータをマクロブロツクに分割して当該マクロブロツク毎
の動きベクトルを検出し、当該検出した各動きベクトル
を動きベクトル情報S2として符号化器3に出力する。
また動きベクトル検出器2は動きベクトルを検出する際
に使用した検出範囲を示すfコードをfコード情報S3
として符号化器3に出力する。
FIG. 8 shows the configuration of an encoding device formed on the basis of the MPEG principle. However, here, description will be made assuming that the encoding processing is performed with the reference relationship shown in FIG. As shown in FIG.
The encoder 1 is roughly divided into a motion vector detector 2 and an encoder 3. Motion vector detector 2
Divides the image data for one picture obtained from the image data S1 into macroblocks, detects a motion vector for each macroblock, and outputs each detected motion vector to the encoder 3 as motion vector information S2. To do.
Also, the motion vector detector 2 uses the f code indicating the detection range used when detecting the motion vector as the f code information S3.
To the encoder 3.

【0015】具体的に説明すると、画像データS1から
得られた1ピクチヤ分の画像データがPピクチヤに対応
するものであれば、2つ隣のフレーム画像を参照画像と
するので、動きベクトル検出器2はfコードを「4」と
して決定し、それに応じた検出範囲内で水平及び垂直方
向の各動きベクトルを各マクロブロツク毎に検出する
(検出範囲については図7参照)。そして動きベクトル
検出器2はその検出した各動きベクトルと検出に使用し
たfコードを符号化器3に出力する。また画像データS
1から得られた1ピクチヤ分の画像データがBピクチヤ
に対応するものであれば、1つ隣のフレーム画像を参照
画像とするので、動きベクトル検出器2はfコードを
「3」と決定し、それに応じた検出範囲内で水平及び垂
直方向の各動きベクトルを各マクロブロツク毎に検出
し、当該各動きベクトルとfコードを符号化器3に出力
する。因みに、画像データS1がIピクチヤに対応する
ものであれば符号化処理としてフレーム内符号化を行う
ため、動きベクトル検出器2は動きベクトルの検出動作
を行わない。
More specifically, if the image data for one picture obtained from the image data S1 corresponds to the P picture, the two adjacent frame images are used as the reference image. Therefore, the motion vector detector is used. 2 determines the f code as "4", and detects each horizontal and vertical motion vector for each macroblock within the corresponding detection range (see FIG. 7 for the detection range). Then, the motion vector detector 2 outputs each detected motion vector and the f code used for the detection to the encoder 3. The image data S
If the image data for 1 picture obtained from 1 corresponds to the B picture, the motion vector detector 2 determines the f code to be “3” because the next adjacent frame image is used as the reference image. Then, the horizontal and vertical motion vectors are detected for each macroblock within the detection range corresponding thereto, and the motion vectors and the f code are output to the encoder 3. Incidentally, if the image data S1 corresponds to the I-picture, the intra-frame coding is performed as the coding process, so the motion vector detector 2 does not perform the motion vector detecting operation.

【0016】符号化器3は入力された画像データS1に
対してフレーム内符号化又は動き補償フレーム間予測符
号化を施して当該画像データS1を順次符号化する。例
えば画像データS1がIピクチヤに対応するものであれ
ば、そのピクチヤ内の画像データだけを使用したフレー
ム内符号化を行う。また画像データS1がPピクチヤに
対応するものであれば、そのピクチヤ内の画像データと
2つ隣のピクチヤの画像データから予測した予測値との
予測残差を求め、当該予測残差を符号化する。また画像
データS1がBピクチヤに対応するものであれば、その
ピクチヤ内の画像データと1つ隣のピクチヤの画像デー
タから予測した予測値との予測残差を求め、当該予測残
差を符号化する。但し、PピクチヤやBピクチヤの場合
には、動きベクトル検出器2から受けた動きベクトル情
報S2を利用して予測値に対して動きベクトルに応じた
動き補償を行い、その結果得た予測値との予測残差を求
めて符号化を行う(すなわちPピクチヤやBピクチヤの
場合には、動き補償フレーム間予測符号化を行う)。
The encoder 3 performs intra-frame coding or motion-compensated inter-frame predictive coding on the input image data S1 to sequentially code the image data S1. For example, if the image data S1 corresponds to the I picture, the intra-frame encoding using only the image data in the picture is performed. If the image data S1 corresponds to the P picture, the prediction residual between the image data in the picture and the prediction value predicted from the image data of the next two pictures is calculated, and the prediction residual is encoded. To do. If the image data S1 corresponds to the B picture, the prediction residual between the image data in the picture and the prediction value predicted from the image data of the next adjacent picture is calculated, and the prediction residual is encoded. To do. However, in the case of P-picture or B-picture, the motion vector information S2 received from the motion vector detector 2 is used to perform motion compensation according to the motion vector on the predicted value, and the predicted value obtained as a result The prediction residual of is obtained and encoded (that is, in the case of P-picture or B-picture, motion-compensated interframe prediction encoding is performed).

【0017】また符号化器3は動きベクトル検出器2か
ら得た各動きベクトルを符号化する。その際、符号化器
3は動きベクトルそのものを符号化するのではなく、動
きベクトル検出器2から得たfコードと、そのfコード
を使用して表した動きベクトルの大きさを表すモーシヨ
ンコード及びモーシヨンレジデユアルとを符号化する。
符号化器3は、このような符号化処理によつて得た各デ
ータをMPEGフオーマツトで規定される所定順序に合
わせて配列し、符号化データS4として出力する。因み
に、この符号化データS4は、記録装置であれば記録手
段に渡され、伝送装置であれば送信手段に渡される。
The encoder 3 encodes each motion vector obtained from the motion vector detector 2. At that time, the encoder 3 does not encode the motion vector itself, but the f code obtained from the motion vector detector 2 and the motion code indicating the magnitude of the motion vector expressed by using the f code. And Motion Residual Dual.
The encoder 3 arranges the respective data obtained by such encoding processing in a predetermined order defined by the MPEG format, and outputs it as encoded data S4. Incidentally, this encoded data S4 is passed to the recording means in the case of a recording device, and is passed to the transmitting means in the case of a transmitting device.

【0018】なお、符号化データの配列は階層的構造を
有し、大別するとシーケンス層、GOP層、ピクチヤ
層、スライス層、マクロブロツク層及びブロツク層に分
かれている。上述したfコードに関しては、MPEG1
の場合にはピクチヤ層のピクチヤヘツダ領域に格納し、
MPEG2の場合にはピクチヤ層のピクチヤコーデイン
グエクステンシヨン領域に格納するようになされてい
る。またモーシヨンコードやモーシヨンレジデユアルに
関してはマクロブロツク層に格納し、予測残差に関して
はブロツク層に格納するようになされている。
The coded data array has a hierarchical structure and is roughly divided into a sequence layer, a GOP layer, a picture layer, a slice layer, a macroblock layer and a block layer. Regarding the above-mentioned f code, MPEG1
In the case of, it is stored in the PICCHIA HESDA area of the PICCHIA layer,
In the case of MPEG2, the data is stored in the picture coding extension area of the picture layer. Further, the motion code and the motion residual are stored in the macro block layer, and the prediction residual is stored in the block layer.

【0019】[0019]

【発明が解決しようとする課題】ところで上述したよう
な従来の符号化装置1では、参照するフレーム画像の距
離によつて一義的にfコードを決定し、そのfコードに
よつて示される検出範囲で動きベクトルを検出してい
る。このため実際には動きベクトルが小さいにも係わら
ず大きなfコードで動きベクトルを検出するといつた事
象が起きることがある。上述のような符号化装置1で
は、動きベクトルを符号化する際にfコードとそれによ
つて算出されるモーシヨンコード及びモーシヨンレジデ
ユアルとを符号化するようになつており、このような事
象が生じた場合にはモーシヨンレジデユアルが大きくな
つて符号化効率が劣化するといつた不都合が生じること
がある。
By the way, in the conventional coding apparatus 1 as described above, the f code is uniquely determined by the distance of the frame image to be referred to, and the detection range indicated by the f code is determined. To detect the motion vector. Therefore, when a motion vector is detected with a large f-code even though the motion vector is actually small, an event may occur. In the encoding device 1 as described above, when the motion vector is encoded, the f code and the motion code and the motion residual calculated by the f code are encoded. If the error occurs, the motion residual becomes large and the coding efficiency deteriorates, which may cause inconvenience.

【0020】本発明は以上の点を考慮してなされたもの
で、従来のような符号化効率の劣化を未然に回避し得る
画像符号化装置及び画像符号化方法を提案しようとする
ものである。
The present invention has been made in consideration of the above points, and it is an object of the present invention to propose an image coding apparatus and an image coding method capable of avoiding the conventional deterioration of the coding efficiency. .

【0021】[0021]

【課題を解決するための手段】かかる課題を解決するた
め本発明においては、画像データの動き量を検出し、当
該動き量を利用して画像データに動き補償予測符号化を
行うと共に、動き量を検出する際に使用した検出範囲を
表すコードを利用して当該動き量を符号化する画像符号
化装置において、画像データの1画面を所定のブロツク
に分割し、所定検出範囲内で各ブロツクの動き量を検出
する動き量検出手段と、動き量検出手段によつて検出し
た動き量を1画面分集計して大きさが最大の動き量を検
出し、当該最大動き量を検出し得る最小の検出範囲を求
めて当該最小検出範囲を表すコードを出力する最適コー
ド検出手段と、動き量検出手段によつて検出した動き量
を利用して画像データに動き補償予測符号化を行うと共
に、最適コード検出手段から出力されるコードに応じた
変数を求め、動き量を当該変数と所定の係数による積と
余りによつて表し、当該係数と余りを符号化することに
よつて動き量を符号化する符号化手段とを設けるように
した。このように実際に検出された動き量を基づいて最
適なコードを求めるようにしたことにより、動き量を表
す際の変数を小さくし得、これによつて余りの部分を小
さくし得る。このため本発明においては、従来のように
余りの部分が大きくなつて符号化効率が劣化するといつ
たことを未然に回避することができる。
In order to solve such a problem, in the present invention, the motion amount of image data is detected, the motion amount is utilized to perform motion compensation predictive coding, and In an image encoding device that encodes the amount of motion using a code representing the detection range used when detecting the, one screen of image data is divided into predetermined blocks, and each block within the predetermined detection range is divided. The motion amount detecting means for detecting the motion amount, and the motion amount detected by the motion amount detecting means are aggregated for one screen to detect the motion amount having the maximum size, and the minimum motion amount capable of detecting the maximum motion amount. Optimal code detecting means for obtaining a detection range and outputting a code representing the minimum detection range, and motion compensation predictive coding for image data using the motion amount detected by the motion amount detecting means, and the optimum code Inspection Coding for obtaining a variable according to the code output from the means, expressing the amount of motion by the product of the variable and a predetermined coefficient and the remainder, and encoding the amount of motion by encoding the coefficient and the remainder And means are provided. By thus determining the optimum code on the basis of the actually detected motion amount, the variable for expressing the motion amount can be made small, whereby the surplus portion can be made small. For this reason, in the present invention, it is possible to prevent when the remaining portion becomes large and the coding efficiency deteriorates as in the conventional case.

【0022】また本発明においては、画像データを順次
蓄積して1画面分蓄積したら当該画像データを順次読み
出して符号化手段に供給する第1の記憶手段と、動き量
を順次蓄積して1画面分蓄積したら当該動き量を順次読
み出して符号化手段に供給する第2の記憶手段とを設け
るようにした。このようにして第1及び第2の記憶手段
を設けるようにしたことにより、符号化手段に対する画
像データと動き量の供給タイミングを1画面分遅らせて
コードの供給タイミングに合わせることができる。
Further, according to the present invention, the image data is sequentially stored, and when one screen is stored, the first storage means for sequentially reading the image data and supplying it to the encoding means, and the motion amount are sequentially stored for one screen. A second storage means is provided for sequentially reading out the motion amount after the minute storage and supplying it to the encoding means. By providing the first and second storage means in this way, it is possible to delay the supply timing of the image data and the motion amount to the encoding means by one screen to match the supply timing of the code.

【0023】[0023]

【発明の実施の形態】以下図面について、本発明の一実
施例を詳述する。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS An embodiment of the present invention will be described below in detail with reference to the drawings.

【0024】まず始めにMPEG方式におけるfコード
とモーシヨンコード及びモーシヨンレジデユアルとの関
係について説明する。符号化器においては、マクロブロ
ツク単位で検出された水平及び垂直方向の各動きベクト
ルをfコードを使用して表現するが、その際には、まず
fコードをfとして、次式、
First, the relationship between the f code, the motion code and the motion residual in the MPEG system will be described. In the encoder, the horizontal and vertical motion vectors detected in macroblock units are expressed using f codes. At that time, the f codes are first set to f, and

【数1】 で示される変数Fを求める。次に各動きベクトルxの大
きさをこの変数Fを使用して、次式、
[Equation 1] The variable F shown by is calculated. Next, the magnitude of each motion vector x is calculated using the variable F as follows:

【数2】 に示すような表現形式で表現する。すなわち動きベクト
ルxを、変数Fと係数(mc−1)による積と余り(m
r+1)とによつて表現する。この(2)式に於けるm
cがモーシヨンコードと呼ばれるものであり、mrがモ
ーシヨンレジデユアルと呼ばれるものである。この場
合、モーシヨンコードmcは、図1に示すように、「−
16」〜「+16」までの整数であり、動きベクトルxを表
現する上で最適な値が選ばれる。
[Equation 2] It is expressed in the expression format shown in. That is, the motion vector x is calculated by multiplying the product of the variable F and the coefficient (mc-1) by the remainder (m
r + 1). M in equation (2)
c is called a motion code, and mr is called a motion residue. In this case, the motion code mc is "-" as shown in FIG.
It is an integer from 16 "to" +16 ", and an optimum value is selected for expressing the motion vector x.

【0025】この(2)式に示すように、モーシヨンレ
ジデユアルmrは、動きベクトルxを変数Fによる積形
式で表したときの余りに相当するものである。従つて動
きベクトルxが小さいときに大きなfコードを使用する
と(すなわち変数Fが大きいと)、このモーシヨンレジ
デユアルmrが大きくなるおそれがある。因みに、
(2)式のような表現形式を使用すると、動きベクトル
xの大きさにも依るが、モーシヨンレジデユアルとして
は最悪で「F−2」まで取り得るおそれがある。
As shown in the equation (2), the motion residual mr corresponds to the remainder when the motion vector x is expressed in the product form of the variable F. Therefore, if a large f code is used when the motion vector x is small (that is, the variable F is large), this motion residual mr may become large. By the way,
When the expression format such as the expression (2) is used, it may take "F-2" in the worst case as a motion residual, though it depends on the magnitude of the motion vector x.

【0026】ところで動きベクトルに関しては、fコー
ド、モーシヨンコードmc及びモーシヨンレジデユアル
mrを可変長符号化するようになされている(但し、f
コードについては符号化せず、fコードを表す所定のコ
ードを使用する)。このためfコードが最適でないため
にモーシヨンレジデユアルmrが大きくなつた場合に
は、モーシヨンレジデユアルmrを可変長符号化したコ
ード自体も大きくなり、符号化効率が劣化するといつた
事象が起きる。
Regarding the motion vector, the f code, the motion code mc and the motion residual mr are variable length coded (however, f
The code is not encoded and a predetermined code representing the f code is used). For this reason, when the motion residual mr becomes large because the f code is not optimal, the code itself obtained by variable-length coding the motion residual mr also becomes large, and an event occurs when the coding efficiency deteriorates. .

【0027】また符号化されたデータは、図2に示すよ
うに、それぞれ符号化データのビツトストリーム中の所
定位置に格納される。例えばfコードについては、MP
EG1ではピクチヤ層のピクチヤヘツダ領域(PH)に
格納され、MPEG2ではピクチヤ層のピクチヤコーデ
イングエクステンシヨン領域(PCE)に格納される。
またマクロブロツク毎に水平及び垂直方向で得られるモ
ーシヨンコードmcやモーシヨンレジデユアルmrにつ
いては、それぞれマクロブロツク層の先頭領域(A)に
格納される。因みに、マクロブロツク毎に得られる予測
残差を可変長符号化した画像データはマクロブロツク層
中のブロツク層(B)に格納される。因みに、MPEG
においては1ピクチヤ分の総ビツト量は固定ビツト量に
規定されている。
The encoded data are stored at predetermined positions in the bit stream of the encoded data, as shown in FIG. For example, for f code, MP
In EG1, it is stored in the picture header area (PH) of the picture layer, and in MPEG2, it is stored in the picture coding extension area (PCE) of the picture layer.
The motion code mc and the motion residual mr that are obtained in the horizontal and vertical directions for each macroblock are stored in the head area (A) of the macroblock layer. By the way, the image data obtained by variable-length coding the prediction residual obtained for each macroblock is stored in the block layer (B) in the macroblock layer. By the way, MPEG
In, the total bit amount for one picture is defined as the fixed bit amount.

【0028】符号化データのビツトストリームがこのよ
うな構造を有する場合に、上述したようにfコードが最
適でないためにモーシヨンレジデユアルmrが大きくな
ると、画像データを格納するブロツク層(B)の領域が
狭くなり、その結果、画像データに対して割り当てる割
当ビツト量が減つてしまい、画質が劣化するといつた不
具合まで引き起こる。このようにして動きベクトルの大
きさに対してfコードが最適でないと、符号化効率が劣
化するだけでなく、画質まで劣化するといつた不都合が
生じるおそれがある。そこで本発明においては、この点
に着目し、実際の動きベクトルの大きさに対して最適な
fコードを求めることにより符号化効率を劣化させない
ようにすると共に、画質を劣化させないようにする。
In the case where the bit stream of the encoded data has such a structure, if the motion residual mr becomes large because the f code is not optimal as described above, the block layer (B) for storing image data is The area is narrowed, and as a result, the amount of assigned bits allocated to image data is reduced, and when the image quality is deteriorated, even trouble occurs. If the f-code is not optimal with respect to the magnitude of the motion vector in this way, not only the coding efficiency deteriorates, but also the image quality deteriorates, which may cause inconvenience. Therefore, in the present invention, paying attention to this point, the optimum f-code for the magnitude of the actual motion vector is obtained so that the coding efficiency is not deteriorated and the image quality is not deteriorated.

【0029】以下に本発明を適用した符号化装置の具体
的構成について説明する。但し、この場合にも、図5に
示した参照関係で符号化処理するものとして説明する。
図8との対応部分に同一符号を付した図3において、1
0は全体として本発明を適用した符号化装置を示し、バ
ツフア11、12及び最適fコード検出器13が追加さ
れたことを除いて図5に示した符号化装置1とほぼ同様
に構成される。
The specific configuration of the coding apparatus to which the present invention is applied will be described below. However, also in this case, description will be given assuming that the encoding process is performed with the reference relationship shown in FIG.
In FIG. 3, in which parts corresponding to those in FIG.
Reference numeral 0 denotes an encoding device to which the present invention is applied as a whole, and is configured almost the same as the encoding device 1 shown in FIG. 5 except that buffers 11 and 12 and an optimum f code detector 13 are added. .

【0030】動きベクトル検出器2は、画像データS1
から得られる1ピクチヤ分の画像データをマクロブロツ
クに分割して当該マクロブロツク毎の動きベクトルを検
出し、当該検出した各動きベクトルを動きベクトル情報
S2としてバツフア12及び最適fコード検出器13に
出力する。例えば画像データS1から得られた1ピクチ
ヤ分の画像データがPピクチヤに対応するものであれ
ば、2つ隣のフレーム画像を参照画像とするので、動き
ベクトル検出器2はfコードを仮に「4」として決定
し、その検出範囲内で水平及び垂直方向の各動きベクト
ルを各マクロブロツク毎に検出する(検出範囲について
は図7参照)。また画像データS1から得られた1ピク
チヤ分の画像データがBピクチヤに対応するものであれ
ば、1つ隣のフレーム画像を参照画像とするので、動き
ベクトル検出器2はfコードを仮に「3」と決定し、そ
の検出範囲内で水平及び垂直方向の各動きベクトルを各
マクロブロツク毎に検出する。因みに、この場合には、
動きベクトル検出器2は動きベクトルの検出に際して使
用したfコードは出力しない。
The motion vector detector 2 uses the image data S1.
The image data for one picture obtained from the above is divided into macroblocks, the motion vector for each macroblock is detected, and each detected motion vector is output to the buffer 12 and the optimum f-code detector 13 as motion vector information S2. To do. For example, if the image data for one picture obtained from the image data S1 corresponds to the P picture, the next two frame images are used as the reference images, so the motion vector detector 2 supposes that the f code is "4". , And each motion vector in the horizontal and vertical directions is detected for each macroblock within the detection range (see FIG. 7 for the detection range). If the image data for one picture obtained from the image data S1 corresponds to the B picture, the next adjacent frame image is used as the reference image. Therefore, the motion vector detector 2 supposes that the f code is "3". , And each motion vector in the horizontal and vertical directions is detected for each macroblock within the detection range. By the way, in this case,
The motion vector detector 2 does not output the f code used for detecting the motion vector.

【0031】最適fコード検出器13は、動きベクトル
検出器2から出力される動きベクトルを1ピクチヤ分集
計し、その中から水平及び垂直方向別に最大の動きベク
トルを検出する。そして検出した最大動きベクトルを検
出し得る最も小さい検出範囲を求めてそれを表す最適な
fコードを水平及び垂直方向別に検出し、当該検出した
fコードをfコード情報S10として符号化器3に出力
する(但し、MPEG1の場合には、水平及び垂直方向
別にfコードを設定し得ないので2つのfコードのうち
大きい方を出力し、MPEG2の場合には、水平及び垂
直方向別にfコードを設定し得るので2つのfコードを
両方出力する)。
The optimum f-code detector 13 collects motion vectors output from the motion vector detector 2 for one picture and detects the maximum motion vector in each of the horizontal and vertical directions. Then, the smallest detection range in which the detected maximum motion vector can be detected is obtained, and the optimum f-code representing it is detected in the horizontal and vertical directions, and the detected f-code is output to the encoder 3 as f-code information S10. (However, in the case of MPEG1, since it is not possible to set the f-code separately in the horizontal and vertical directions, the larger of the two f-codes is output. In the case of MPEG2, the f-code is set separately in the horizontal and vertical directions. Therefore, both f codes are output).

【0032】バツフア12は1ピクチヤ分の動きベクト
ルを記憶し得る記憶容量を有し、動きベクトル検出器2
から供給される各動きベクトルを順次記憶し、1ピクチ
ヤ分蓄積したら順次読み出して符号化器3に出力する。
これにより最適fコード検出器13が最適なfコードを
検出するまでに掛かる時間分(すなわち1ピクチヤ分)
だけ、符号化器3に対する動きベクトルの供給タイミン
グを遅らせることができ、最適fコード検出器13と供
給タイミングを合わせることができる。
The buffer 12 has a storage capacity capable of storing a motion vector for one picture, and the motion vector detector 2
Each motion vector supplied from the above is sequentially stored, and when one picture is accumulated, it is sequentially read out and output to the encoder 3.
As a result, the time required for the optimum f-code detector 13 to detect the optimum f-code (that is, one picture)
Only, the supply timing of the motion vector to the encoder 3 can be delayed, and the supply timing can be matched with the optimum f-code detector 13.

【0033】一方、符号化器3に画像データS1を入力
する信号系においてもバツフア11が設けられている。
バツフア11は1ピクチヤ分の画像データS1を記憶し
得る記憶容量を有し、入力された画像データS1を順次
記憶し、1ピクチヤ分蓄積したら順次読み出して符号化
器3に出力する。これにより最適fコード検出器13が
最適なfコードを検出するまでに掛かる時間分(すなわ
ち1ピクチヤ分)だけ、符号化器3に対する画像データ
の供給タイミングを遅らせることができ、最適fコード
検出器13と供給タイミングを合わせることができる。
On the other hand, the buffer 11 is also provided in the signal system for inputting the image data S1 to the encoder 3.
The buffer 11 has a storage capacity capable of storing the image data S1 corresponding to one picture, sequentially stores the input image data S1, and when the image data S1 corresponding to one picture is accumulated, is sequentially read and output to the encoder 3. As a result, the timing for supplying image data to the encoder 3 can be delayed by the time required for the optimum f-code detector 13 to detect the optimum f-code (that is, one picture), and the optimum f-code detector can be obtained. 13 and the supply timing can be matched.

【0034】符号化器3は入力された画像データS1に
対してフレーム内符号化又は動き補償フレーム間予測符
号化を施して当該画像データS1を符号化する。例えば
画像データS1がIピクチヤに対応するものであれば、
そのピクチヤ内の画像データだけを使用したフレーム内
符号化を行う。また画像データS1がPピクチヤに対応
するものであれば、そのピクチヤ内の画像データと2つ
隣のピクチヤの画像データから予測した予測値との予測
残差を求め、当該予測残差を符号化する。また画像デー
タS1がBピクチヤに対応するものであれば、そのピク
チヤ内の画像データと1つ隣のピクチヤの画像データか
ら予測した予測値との予測残差を求め、当該予測残差を
符号化する。但し、PピクチヤやBピクチヤの場合に
は、動きベクトル検出器2で検出した動きベクトルを利
用して予測値に対して動き補償を行い、その結果得た予
測値との予測残差を求めて符号化を行う(すなわちPピ
クチヤやBピクチヤの場合には、動き補償フレーム間予
測符号化を行う)。
The encoder 3 performs intra-frame coding or motion compensation inter-frame predictive coding on the input image data S1 to code the image data S1. For example, if the image data S1 corresponds to I picture,
Intra-frame encoding is performed using only the image data in the picture. If the image data S1 corresponds to the P picture, the prediction residual between the image data in the picture and the prediction value predicted from the image data of the next two pictures is calculated, and the prediction residual is encoded. To do. If the image data S1 corresponds to the B picture, the prediction residual between the image data in the picture and the prediction value predicted from the image data of the next adjacent picture is calculated, and the prediction residual is encoded. To do. However, in the case of P-picture or B-picture, motion compensation is performed on the prediction value using the motion vector detected by the motion vector detector 2, and the prediction residual with the prediction value obtained as a result is obtained. Encoding is performed (that is, in the case of P and B pictures, motion compensation interframe prediction encoding is performed).

【0035】また符号化器3は動きベクトル検出器2か
ら得た各動きベクトルを符号化する。その際、符号化器
3は(1)及び(2)式で示される表現形式で動きベク
トルを表現し、fコード、モーシヨンコードmc及びモ
ーシヨンレジデユアルmrを符号化する。但し、fコー
ドは符号化せずに当該fコードを表すコードをそのまま
使用し、モーシヨンコードmc及びモーシヨンレジデユ
アルmrを可変長符号化する。符号化器3はこのような
符号化処理によつて得た各データをMPEGフオーマツ
トで規定される所定順序に合わせて配列し、符号化デー
タS4として出力する。
Further, the encoder 3 encodes each motion vector obtained from the motion vector detector 2. At that time, the encoder 3 expresses the motion vector in the expression form shown by the equations (1) and (2), and encodes the f code, the motion code mc, and the motion residual mr. However, the f code is not encoded and the code representing the f code is used as it is, and the motion code mc and the motion residual mr are variable length encoded. The encoder 3 arranges the respective data obtained by such encoding processing in a predetermined order defined by the MPEG format, and outputs it as encoded data S4.

【0036】以上の構成において、動きベクトル検出器
2は参照距離に応じて仮のfコードを決定し、そのfコ
ードで示される検出範囲内から動きベクトルを検出す
る。検出された各動きベクトルは最適fコード検出器1
3に供給されると共に、バツフア12に供給される。最
適fコード検出器13は1ピクチヤ分の動きベクトルを
集計してその中から最大の動きベクトルを検出し、その
最大動きベクトルを検出し得る最も小さいfコードを検
出して符号化器3に出力する。このfコード出力タイミ
ングに合わせてバツフア12も一時蓄積していた動きベ
クトルを符号化器3に出力する。また画像データS1を
一時蓄積していたバツフア11も、このfコード出力タ
イミングに合わせて画像データS1を符号化器3に出力
する。
In the above configuration, the motion vector detector 2 determines a provisional f code according to the reference distance and detects a motion vector within the detection range indicated by the f code. Each detected motion vector is the optimum f code detector 1
3 and the buffer 12. The optimum f-code detector 13 adds up the motion vectors for one picture, detects the maximum motion vector from among them, detects the smallest f-code that can detect the maximum motion vector, and outputs it to the encoder 3. To do. The buffer 12 also outputs the motion vector temporarily stored in the encoder 3 in synchronization with this f-code output timing. The buffer 11 that has temporarily stored the image data S1 also outputs the image data S1 to the encoder 3 in synchronization with this f code output timing.

【0037】符号化器3は入力された画像データS1を
ピクチヤタイプに応じてフレーム内符号化又は動き補償
フレーム間予測符号化する。また符号化器3は動き補償
フレーム間予測符号化したときに利用した動きベクトル
(すなわちバツフア12を介して供給された動きベクト
ル)を符号化する。その際、符号化器3は動きベクトル
を(1)及び(2)式で示した表現形式で表現し、その
中のモーシヨンコードmc及びモーシヨンレジデユアル
を符号化する。この場合、符号化器3に対しては最適f
コード検出器13によつて検出した最適かつ最小のfコ
ードが供給されているので、(2)式に示したパラメー
タFも小さくなり、余り項であるモーシヨンレジデユア
ルmrも小さくなる。従つてこの符号化装置10の場合
には、従来のようにfコードの不適切によつて生じる符
号化効率の劣化を未然に回避し得、最適な符号化効率で
符号化することができる。
The encoder 3 performs intra-frame coding or motion-compensated inter-frame predictive coding on the input image data S1 according to the picture type. Also, the encoder 3 encodes the motion vector used when the motion-compensated inter-frame predictive coding (that is, the motion vector supplied via the buffer 12). At that time, the encoder 3 expresses the motion vector in the expression form shown in the equations (1) and (2), and encodes the motion code mc and the motion residual in the motion vector. In this case, the optimum f for the encoder 3
Since the optimum and minimum f-code detected by the code detector 13 is supplied, the parameter F shown in the equation (2) also becomes small, and the mortality residual mr which is the remainder term also becomes small. Therefore, in the case of the encoding device 10, it is possible to avoid the deterioration of the encoding efficiency caused by the inadequacy of the f code as in the conventional case, and it is possible to perform the encoding with the optimum encoding efficiency.

【0038】ところでモーシヨンレジデユアルmrは最
終的に図2に示すビツトストリーム中のマクロブロツク
層の先頭領域(A)に格納されるが、上述したようにモ
ーシヨンレジデユアルmrが小さくなれば、画像データ
を格納するブロツク層(B)の領域が狭くなるようなこ
とはない。従つてこの符号化装置10の場合には、画像
データの割当ビツト量を確実に確保し得、画質の劣化を
未然に回避し得る。
The motion residual mr is finally stored in the head area (A) of the macroblock layer in the bit stream shown in FIG. 2. If the motion residual mr becomes small as described above, The area of the block layer (B) that stores image data does not become narrow. Therefore, in the case of the encoding device 10, the allocation bit amount of the image data can be surely secured, and the deterioration of the image quality can be avoided in advance.

【0039】このようにして動きベクトル検出器で検出
した動きベクトルの最大値を検出し、当該最大動きベク
トルを検出し得る最小のfコード(すなわち実際の動き
ベクトルの大きさに合つた最適なfコード)を選択して
符号化器3に供給するようにしたことにより、動きベク
トルを符号化する際にモーシヨンレジデユアルmrを小
さくして効率良く符号化することができる。
In this way, the maximum value of the motion vector detected by the motion vector detector is detected, and the minimum f code capable of detecting the maximum motion vector (that is, the optimum f code corresponding to the size of the actual motion vector). By selecting the code) and supplying it to the encoder 3, it is possible to reduce the motion residual mr when encoding the motion vector and perform the encoding efficiently.

【0040】以上の構成によれば、実際に得られた動き
ベクトルの最大値を検出し、当該最大動きベクトルを検
出し得る最小のfコードを求めて符号化器3に供給する
最適fコード検出器13を設けるようにしたことによ
り、動きベクトルを符号化する際にモーシヨンレジデユ
アルmrを小さくし得、効率良く符号化することができ
る。
According to the above configuration, the maximum value of the actually obtained motion vector is detected, the minimum f code capable of detecting the maximum motion vector is obtained, and the optimum f code detection supplied to the encoder 3 is performed. By providing the device 13, the motion residual mr can be reduced when the motion vector is encoded, and the encoding can be performed efficiently.

【0041】さらに以上の構成によれば、モーシヨンレ
ジデユアルmrを小さくし得るため、画像データの割当
ビツト量を確実に確保し得、従来のような画質の劣化を
未然に回避し得る。かくするにつき従来のような符号化
効率の劣化を未然に回避し得る符号化装置を実現し得
る。
Further, according to the above construction, since the motion residual mr can be made small, the allocation bit amount of the image data can be surely secured and the deterioration of the image quality as in the conventional case can be avoided. As a result, it is possible to realize an encoding device that can avoid the deterioration of encoding efficiency as in the related art.

【0042】なお上述の実施例においては、各ピクチヤ
の参照関係が図5に示した参照関係にあるものとして説
明したが、本発明はこれに限らず、予測符号化時の参照
関係がその他のパターンであつても良い。要は、本発明
においては、参照関係については限定されるものではな
い。
In the above-mentioned embodiment, the reference relation of each picture has been described as having the reference relation shown in FIG. 5, but the present invention is not limited to this, and the reference relation at the time of predictive coding is other. It may be a pattern. In short, the reference relationship is not limited in the present invention.

【0043】また上述の実施例においては、図5に示す
ように、Pピクチヤの間にBピクチヤが1枚存在する場
合として説明したが、本発明はこれに限らず、例えばP
ピクチヤの間にBピクチヤが2枚存在する場合であつて
も良い。要は、本発明においては、I、B及びPピクチ
ヤの位置関係については限定されるものではない。
Further, in the above-mentioned embodiment, as shown in FIG. 5, the case where one B-picture is present between P-pictures has been described, but the present invention is not limited to this, and, for example, P-picture is used.
This may be the case where there are two B-pictures between the pictures. In short, in the present invention, the positional relationship among the I, B and P pictures is not limited.

【0044】また上述の実施例においては、本発明をM
PEGの符号化方式に適用した場合について述べたが、
本発明はこれに限らず、例えばITU(International
Telecommunication Union :国際電気通信連合)等が標
準化した「H.261 」と呼ばれる符号化方式に適用するよ
うにしても良い。要は、画像データの動き量を検出し、
当該動き量を利用して画像データに動き補償予測符号化
を行うと共に、当該動き量を検出する際に使用した検出
範囲を表すコードを利用して動き量を符号化する画像符
号化装置であれば本発明を広く適用することができる。
Further, in the above-mentioned embodiment, the present invention is implemented by M
The case where it is applied to the PEG encoding method has been described.
The present invention is not limited to this, and for example, ITU (International
It may be applied to a coding method called "H.261" standardized by Telecommunication Union). The point is to detect the amount of movement of image data,
An image coding apparatus that performs motion compensation predictive coding on image data by using the motion amount and codes the motion amount by using a code indicating a detection range used when detecting the motion amount. For example, the present invention can be widely applied.

【0045】[0045]

【発明の効果】上述のように本発明によれば、検出した
動き量を1画面分集計して大きさが最大の動き量を検出
し、当該最大動き量を検出し得る最小の検出範囲を求め
て当該最小検出範囲を表すコードを符号化手段に供給す
る最適コード検出手段を設けるようにしたことにより、
実際に検出された動き量に応じた最適なコードを得るこ
とができ、これによつて動き量を表す際の余りの部分を
小さくし得る。従つて従来のように余りの部分が大きく
なつて符号化効率が劣化するといつたことを未然に回避
し得る。かくするにつき従来のような符号化効率の劣化
を未然に回避し得る画像符号化装置を実現し得る。
As described above, according to the present invention, the detected motion amount is aggregated for one screen to detect the motion amount having the largest size, and the minimum detection range in which the maximum motion amount can be detected is set. By providing the optimum code detection means for supplying the code representing the minimum detection range to the encoding means,
It is possible to obtain the optimum code according to the actually detected motion amount, and thereby reduce the surplus portion when expressing the motion amount. Therefore, when the remaining portion becomes large and the coding efficiency is deteriorated as in the conventional case, it is possible to avoid what happened before. As a result, it is possible to realize an image encoding device that can avoid the deterioration of encoding efficiency as in the related art.

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

【図1】MPEGに於けるモーシヨンコードを示す図表
である。
FIG. 1 is a diagram showing a motion code in MPEG.

【図2】MPEGに於ける符号化データのビツトストリ
ーム構造を示す略線図である。
FIG. 2 is a schematic diagram showing a bit stream structure of encoded data in MPEG.

【図3】本発明の一実施例による符号化装置の構成を示
すブロツク図である。
FIG. 3 is a block diagram showing a configuration of an encoding device according to an embodiment of the present invention.

【図4】動き補償フレーム間予測符号化の原理の説明に
供する略線図である。
FIG. 4 is a schematic diagram for explaining a principle of motion-compensated interframe predictive coding.

【図5】MPEGに於けるピクチヤタイプの説明に供す
る略線図である。
FIG. 5 is a schematic diagram for explaining a picture type in MPEG.

【図6】動きベクトルの検出範囲の説明に供する略線図
である。
FIG. 6 is a schematic diagram for explaining a detection range of a motion vector.

【図7】fコードと検出範囲の関係を示す図表である。FIG. 7 is a chart showing a relationship between an f code and a detection range.

【図8】従来の符号化装置の構成を示すブロツク図であ
る。
FIG. 8 is a block diagram showing a configuration of a conventional encoding device.

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

1、10……符号化装置、2……動きベクトル検出器、
3……符号化器、11、12……バツフア、13……最
適fコード検出器。
1, 10 ... Encoding device, 2 ... Motion vector detector,
3 ... Encoder, 11, 12 ... Buffer, 13 ... Optimal f code detector.

Claims (4)

【特許請求の範囲】[Claims] 【請求項1】画像データの動き量を検出し、当該動き量
を利用して上記画像データに動き補償予測符号化を行う
と共に、上記動き量を検出する際に使用した検出範囲を
表すコードを利用して当該動き量を符号化する画像符号
化装置において、 上記画像データの1画面を所定のブロツクに分割し、所
定検出範囲内で上記各ブロツクの動き量を検出する動き
量検出手段と、 上記動き量検出手段によつて検出した上記動き量を1画
面分集計して大きさが最大の動き量を検出し、当該最大
動き量を検出し得る最小の検出範囲を求めて当該最小検
出範囲を表す上記コードを出力する最適コード検出手段
と、 上記動き量検出手段によつて検出した上記動き量を利用
して上記画像データに動き補償予測符号化を行うと共
に、上記最適コード検出手段から出力される上記コード
に応じた変数を求めて上記動き量を当該変数と所定の係
数による積と余りによつて表し、当該係数と余りを符号
化することによつて上記動き量を符号化する符号化手段
とを具えることを特徴とする画像符号化装置。
1. A motion amount of image data is detected, motion compensation predictive coding is performed on the image data by using the motion amount, and a code representing a detection range used when detecting the motion amount is generated. In an image coding apparatus for coding the motion amount by utilizing the motion amount detecting means for dividing one screen of the image data into predetermined blocks and detecting the motion amount of each block within a predetermined detection range, The motion amount detected by the motion amount detecting means is aggregated for one screen to detect the motion amount having the maximum size, and the minimum detection range in which the maximum motion amount can be detected is determined to be the minimum detection range. The optimum code detecting means for outputting the above code and the motion amount detected by the motion amount detecting means are used to perform motion compensation predictive coding on the image data and to output from the optimum code detecting means. An encoding for encoding the motion amount by obtaining a variable corresponding to the code and expressing the motion amount by a product of the variable and a predetermined coefficient and a remainder, and encoding the coefficient and the remainder by encoding. An image coding apparatus comprising:
【請求項2】上記画像データを1画面分記憶し得る記憶
容量を有し、上記画像データを順次蓄積して1画面分蓄
積したら当該画像データを順次読み出して上記符号化手
段に供給する第1の記憶手段と、 上記動き量検出手段によつて検出した上記動き量を1画
面分記憶し得る記憶容量を有し、上記動き量を順次蓄積
して1画面分蓄積したら当該動き量を順次読み出して上
記符号化手段に供給する第2の記憶手段とを具えること
を特徴とする請求項1に記載の画像符号化装置。
2. A first storage device having a storage capacity capable of storing one screen of the image data, and sequentially storing the image data for one screen and reading the image data sequentially and supplying the image data to the encoding means. Storage means and a storage capacity capable of storing the movement amount detected by the movement amount detecting means for one screen, the movement amounts are sequentially accumulated, and when the movement amount is accumulated for one screen, the movement amount is sequentially read out. The image coding apparatus according to claim 1, further comprising: second storage means for supplying the coding means to the coding means.
【請求項3】画像データの動き量を検出し、当該動き量
を利用して上記画像データに動き補償予測符号化を行う
と共に、上記動き量を検出する際に使用した検出範囲を
表すコードを利用して当該動き量を符号化する画像符号
化方法において、 上記画像データの1画面を所定のブロツクに分割し、所
定検出範囲内で上記各ブロツクの動き量を検出し、 検出した上記動き量を1画面分集計して大きさが最大の
動き量を検出し、当該最大動き量を検出し得る最小の検
出範囲を求めて当該最小検出範囲を表す上記コードを検
出し、 検出した上記動き量を利用して上記画像データに動き補
償予測符号化を行うと共に、検出した上記コードに応じ
た変数を求めて上記動き量を当該変数と所定の係数によ
る積と余りによつて表し、当該係数と余りを符号化する
ことによつて上記動き量を符号化することを特徴とする
画像符号化方法。
3. A motion amount of image data is detected, motion compensation predictive coding is performed on the image data using the motion amount, and a code representing a detection range used when detecting the motion amount is generated. In the image coding method of coding the motion amount using the above, one screen of the image data is divided into predetermined blocks, the motion amount of each block is detected within a predetermined detection range, and the detected motion amount is detected. For one screen, the maximum amount of motion is detected, the minimum detection range that can detect the maximum amount of motion is determined, and the code representing the minimum detection range is detected, and the detected amount of motion is detected. The motion compensation predictive coding is performed on the image data by using, and the variable corresponding to the detected code is obtained to express the motion amount by the product of the variable and a predetermined coefficient and the remainder, and the coefficient and the remainder. Encode Image coding method, characterized in that for encoding by connexion the motion amount Rukoto.
【請求項4】上記画像データを順次蓄積して1画面分蓄
積したら当該画像データを順次読み出すことにより上記
画像データを1画面分遅らせると共に、上記動き量を順
次蓄積して1画面分蓄積したら当該動き量を順次読み出
すことにより上記動き量を1画面分遅らせることを特徴
とする請求項3に記載の画像符号化方法。
4. When the image data is sequentially stored and stored for one screen, the image data is sequentially read out to delay the image data by one screen, and the motion amount is sequentially stored and stored for one screen. 4. The image coding method according to claim 3, wherein the motion amount is delayed by one screen by sequentially reading the motion amount.
JP11530896A 1996-04-12 1996-04-12 Image coding apparatus and image coding method Expired - Lifetime JP3724662B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP11530896A JP3724662B2 (en) 1996-04-12 1996-04-12 Image coding apparatus and image coding method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP11530896A JP3724662B2 (en) 1996-04-12 1996-04-12 Image coding apparatus and image coding method

Publications (2)

Publication Number Publication Date
JPH09284776A true JPH09284776A (en) 1997-10-31
JP3724662B2 JP3724662B2 (en) 2005-12-07

Family

ID=14659418

Family Applications (1)

Application Number Title Priority Date Filing Date
JP11530896A Expired - Lifetime JP3724662B2 (en) 1996-04-12 1996-04-12 Image coding apparatus and image coding method

Country Status (1)

Country Link
JP (1) JP3724662B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2003056838A1 (en) * 2001-12-25 2003-07-10 Matsushita Electric Industrial Co., Ltd. Moving picture compression/coding apparatus and motion vector detection method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2003056838A1 (en) * 2001-12-25 2003-07-10 Matsushita Electric Industrial Co., Ltd. Moving picture compression/coding apparatus and motion vector detection method

Also Published As

Publication number Publication date
JP3724662B2 (en) 2005-12-07

Similar Documents

Publication Publication Date Title
JP4261630B2 (en) Image encoding apparatus and method, and computer-readable recording medium on which an image encoding program is recorded
JP2962012B2 (en) Video encoding device and decoding device therefor
EP0912063B1 (en) A method for computational graceful degradation in an audiovisual compression system
US7324595B2 (en) Method and/or apparatus for reducing the complexity of non-reference frame encoding using selective reconstruction
EP0700214A2 (en) Two stage video compression method and system
EP1377067A1 (en) Motion vector coding
JPH11262018A (en) Motion compensation coder, motion compensation coding method and motion compensation recording medium therefor
JPH08223577A (en) Moving image coding method and device therefor and moving image decoding method and device therefor
EP0577365B1 (en) Encoding of picture signals
US20120027086A1 (en) Predictive coding apparatus, control method thereof, and computer program
US6907071B2 (en) Selective prediction for intra-coding video data block
US6697430B1 (en) MPEG encoder
JPH10322696A (en) Signal encoder, signal encoding method, signal recording medium and signal transmitting method
JP2002027469A (en) Bit stream converting method and device, and program recording medium
JP3426668B2 (en) Video coding method
JPH06350995A (en) Moving picture processing method
JP3599942B2 (en) Moving picture coding method and moving picture coding apparatus
JPH11308617A (en) Digital image coder and motion vector detector used therefor
JP3724662B2 (en) Image coding apparatus and image coding method
JP3428332B2 (en) Image encoding method and apparatus, and image transmission method
JPH0795536A (en) Device and method for reversely reproducing moving image
JP3934772B2 (en) Variable transfer rate encoding method and apparatus
JPH11341521A (en) Coder for stereoscopic moving image
JPH06268992A (en) Picture encoding method, picture decoding method, picture encoding device, picture decoding device and recording medium
JP2000023096A (en) Data encoding method, decoding method and device

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20050823

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20050902

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20050915

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

Free format text: PAYMENT UNTIL: 20080930

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20090930

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20090930

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20100930

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20100930

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20110930

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20110930

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20120930

Year of fee payment: 7