JPH0923433A - Method and device for encoding picture - Google Patents

Method and device for encoding picture

Info

Publication number
JPH0923433A
JPH0923433A JP16984495A JP16984495A JPH0923433A JP H0923433 A JPH0923433 A JP H0923433A JP 16984495 A JP16984495 A JP 16984495A JP 16984495 A JP16984495 A JP 16984495A JP H0923433 A JPH0923433 A JP H0923433A
Authority
JP
Japan
Prior art keywords
code
vector
unit
motion
memory
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
JP16984495A
Other languages
Japanese (ja)
Other versions
JP3209260B2 (en
Inventor
Yoshiyuki Yashima
由幸 八島
Hisanori Ono
尚紀 小野
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.)
Nippon Telegraph and Telephone Corp
Original Assignee
Nippon Telegraph and Telephone 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 Nippon Telegraph and Telephone Corp filed Critical Nippon Telegraph and Telephone Corp
Priority to JP16984495A priority Critical patent/JP3209260B2/en
Publication of JPH0923433A publication Critical patent/JPH0923433A/en
Application granted granted Critical
Publication of JP3209260B2 publication Critical patent/JP3209260B2/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 set the total of code lengths obtained by finally allocating codes to be a minimum. SOLUTION: A code length table generation part 117 generates a table 118 showing the relation of a difference value between motion compensation frames and the code length of the code used in a code allocation part 113 and transmits it to a motion vector detection part 105A. A code length conversion part 202 obtains the code length which is to be allocated to the difference values between the motion compensation frames based on the code length table 118 obtained by a subtracter 201 and inputs it to a total calculation part 203. The total calculation part 203 calculates the total of the code lengths in a small block. A minimum value memory 204 compares the calculated total with a minimum value accumulated in a memory at that time. When the total is smaller than the minimum value, the minimum value is updated and an updated indication instruction is transmitted to a vector memory 206.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は画像符号化方法およ
び装置に関する。
TECHNICAL FIELD The present invention relates to an image coding method and apparatus.

【0002】[0002]

【従来の技術】放送素材や医療などのように、原画像を
完全に復元可能なロスレス符号化がある。一方、動画像
の高能率符号化に欠かせない技術として動き補償予測が
ある。動き補償予測は、符号化対象フレームと時間的に
近接する他のフレームとの類似性を利用したものであ
り、ロスレス符号化に対しても、符号化効率を向上させ
るための有効な手段である。
2. Description of the Related Art There is lossless coding that can completely restore an original image, such as broadcasting materials and medical care. On the other hand, motion-compensated prediction is a technique essential for high-efficiency coding of moving images. Motion-compensated prediction makes use of the similarity between a frame to be coded and other frames that are temporally close to each other, and is an effective means for improving coding efficiency even for lossless coding. .

【0003】図4は従来の動き補償を用いて構成された
ロスレス符号化装置のブロック図である。まず、入力端
子101から入力された符号化対象画像102は、小ブ
ロック分割部103にてN×Nの符号化対象小ブロック
104に分割される。分割された小ブロック104ごと
に、動きベクトル検出部105では、フレームメモリ1
06に蓄えられた参照画像107、すなわち符号化対象
画像102の時間的に近接した画像中から、定められた
評価基準にて動きベクトル108が選択される。動き補
償部109では、選択された動きベクトル108に対応
する参照小ブロック110が求められ、減算器111に
おいて、符号化対象小ブロック104との差が計算さ
れ、動き補償フレーム間差分値112が得られた後、符
号割り当て部113にて符号が割り当てられ、多重化部
114において、動きベクトル情報108と多重された
後、符号化データ115として出力端子116に出力さ
れる。
FIG. 4 is a block diagram of a lossless coding apparatus constructed using conventional motion compensation. First, the encoding target image 102 input from the input terminal 101 is divided into N × N encoding target small blocks 104 by the small block dividing unit 103. For each of the divided small blocks 104, the motion vector detection unit 105
The motion vector 108 is selected from the reference image 107 stored in 06, that is, the images that are temporally close to the encoding target image 102, based on a predetermined evaluation criterion. The motion compensation unit 109 obtains the reference small block 110 corresponding to the selected motion vector 108, and the subtractor 111 calculates the difference from the coding target small block 104 to obtain the motion compensation inter-frame difference value 112. After that, the code is assigned by the code assigning unit 113, multiplexed by the multiplexing unit 114 with the motion vector information 108, and then output as the encoded data 115 to the output terminal 116.

【0004】ここで、動きベクトルの選択にあたって
は、通常以下のような方法が用いられる。符号化対象小
ブロック104の画像データをN×NのサイズとしB
(i,j)とおく。B(i,j)に対して、フレームメ
モリ106中の参照画像107上でB(i,j)を空間
的に水平・垂直方向に(u,v)だけずらした小ブロッ
クB'(i+u,j+v)との類似度を表す評価値D
(u,v)を計算する。評価値には差分絶対値和や差分
自乗和がよく用いられ、たとえば差分絶対値和の場合に
は、計算は以下のようになる。
Here, in selecting the motion vector, the following method is usually used. Let the image data of the small block 104 to be encoded be N × N in size and B
Let (i, j). With respect to B (i, j), a small block B '(i + u, which spatially and horizontally shifts B (i, j) by (u, v) on the reference image 107 in the frame memory 106. j + v) evaluation value D indicating the degree of similarity
Calculate (u, v). The sum of absolute differences and the sum of squared differences are often used as the evaluation value. For example, in the case of the sum of absolute differences, the calculation is as follows.

【0005】[0005]

【数1】 (u,v)を定められた探索領域で変化させ、D(u,
v)の最小値を与えるような(u,v)を最終的な動き
ベクトル(U,V)とし、動きベクトル(U,V)によ
って定められる参照画像107中の小ブロックが参照小
ブロック110とされる。
[Equation 1] By changing (u, v) in the defined search area, D (u,
(u, v) that gives the minimum value of v) is the final motion vector (U, V), and the small blocks in the reference image 107 defined by the motion vector (U, V) are the reference small blocks 110. To be done.

【0006】以上の動きベクトル検出部105Cの構成
を詳細に示す。候補ベクトル設定部205は、定められ
た探索範囲中のベクトルを発生させるとともにベクトル
メモリ206に送出する機能を持つ。シフト部207
は、フレームメモリ106に蓄えられている参照画像1
07を候補ベクトル設定部205で設定された候補ベク
トルによってその分だけ空間的にシフトする。減算器2
01においては、シフトされた小ブロックと符号化対象
小ブロック104の差分が計算され、演算結果が絶対値
和計算部214に入力される。絶対値和計算部214で
は小ブロック内での差分絶対値の総和が計算され、計算
された絶対値和は最小値メモリ204に送られ、その時
点でメモリ204に蓄えられている最小値との比較が行
なわれる。絶対値和が最小値よりも小さい場合には最小
値が更新されるとともに、ベクトルメモリ206に対し
て更新指示命令が送られ、記憶されているベクトルがそ
の時点で入力されている候補ベクトルに置換される。候
補ベクトル設定部205にて定められた探索範囲のすべ
てのベクトルの発生が終了した時点で、ベクトルメモリ
206に蓄えられているベクトルが符号化対象小ブロッ
ク104の動きベクトル108として出力されるととも
に、最小値メモリ204、ベクトルメモリ206がリセ
ットされる。
The structure of the above motion vector detecting section 105C will be described in detail. The candidate vector setting unit 205 has a function of generating a vector within the defined search range and transmitting it to the vector memory 206. Shift unit 207
Is the reference image 1 stored in the frame memory 106.
07 is spatially shifted by that amount by the candidate vector set by the candidate vector setting unit 205. Subtractor 2
In 01, the difference between the shifted small block and the encoding target small block 104 is calculated, and the calculation result is input to the absolute value sum calculation unit 214. In the absolute value sum calculation unit 214, the sum of the absolute differences between the small blocks is calculated, and the calculated absolute value sum is sent to the minimum value memory 204 and the minimum value stored in the memory 204 at that time. A comparison is made. If the sum of absolute values is smaller than the minimum value, the minimum value is updated, and an update instruction command is sent to the vector memory 206, and the stored vector is replaced with the candidate vector input at that time. To be done. When the generation of all the vectors in the search range defined by the candidate vector setting unit 205 is completed, the vector stored in the vector memory 206 is output as the motion vector 108 of the encoding target small block 104, and The minimum value memory 204 and the vector memory 206 are reset.

【0007】[0007]

【発明が解決しようとする課題】上述した従来の方法に
よれば、符号化対象小ブロックと類似度の高い参照小ブ
ロックが選択でき、動き補償フレーム間差分値が小さく
なるので、その信号分布に適した可変長符号を設計して
おき、その符号を割り当てることによって効率の良い符
号化が可能となる。可変長符号は一般的に、発生確率の
高い動き補償フレーム間差分値に対しては短い符号を割
り当て、確率の低いものに対しては長い符号を割り当て
るようにして、符号長の合計を短くするように設定され
る。
According to the conventional method described above, a reference small block having a high degree of similarity with the small block to be encoded can be selected, and the difference value between motion compensation frames becomes small. By designing a suitable variable-length code and assigning the code, efficient coding becomes possible. In general, the variable length code is assigned a short code for a motion-compensated inter-frame difference value having a high occurrence probability and a long code for a low-probability motion compensation frame difference value to shorten the total code length. Is set as follows.

【0008】しかしながら、従来の参照小ブロック選択
方法では、評価値として符号化対象小ブロックと参照画
像の小ブロックとの関係のみを利用しており、後段にど
のような符号が割り当てられるかは全く意識していな
い。従って、入力画像の性質や圧縮率などが変化した場
合には、必ずしも最終的な符号量が最小になるような参
照小ブロックになっているという保証はない。
However, in the conventional reference small block selection method, only the relationship between the small block to be coded and the small block of the reference image is used as the evaluation value, and it is completely unclear what code is assigned in the subsequent stage. I'm not aware. Therefore, when the property or compression rate of the input image changes, there is no guarantee that the reference small block will minimize the final code amount.

【0009】たとえば、動き補償フレーム間差分値に、
表1のような可変長符号が適用される場合を想定する。
For example, in the difference value between motion compensation frames,
Assume that a variable length code as shown in Table 1 is applied.

【0010】[0010]

【表1】 この場合、動き補償フレーム間差分値が図5(a)の小
ブロックと、図5(b)の小ブロックを比較すると、従
来の差分絶対値和による選択方法では、図5(b)のほ
うが小さくなり選択されるが、この場合に動き補償フレ
ーム間差分値に実際に可変長符号を割り当てた場合の長
さは図5(b)の方が長くなってしまう。このように、
従来のような方法では、動き補償フレーム間差分値に対
して適用される符号の長さを考慮しないで動き補償のた
めの参照小ブロックを決定していたために、最終的に得
られる符号長が最短なものにならないという問題点があ
った。
[Table 1] In this case, comparing the small block having the motion-compensated inter-frame difference value of FIG. 5 (a) with the small block of FIG. 5 (b), FIG. 5 (b) is better than the conventional selection method based on the sum of absolute differences. It is selected to be smaller, but in this case, the length when the variable length code is actually assigned to the motion compensation interframe difference value is longer in FIG. 5B. in this way,
In the conventional method, since the reference small block for motion compensation is determined without considering the length of the code applied to the motion compensation inter-frame difference value, the finally obtained code length is There was a problem that it was not the shortest.

【0011】本発明の目的は、最終的に符号を割り当て
て得られる符号長の総和を最短にすることができる画像
符号化方法及び装置を提供することにある。
An object of the present invention is to provide an image coding method and apparatus capable of minimizing the total sum of code lengths obtained by finally allocating codes.

【0012】[0012]

【課題を解決するための手段】請求項1の画像符号化方
法は、ディジタル画像信号に対して、現フレームの画像
データを小ブロックに分割し、分割された符号化対象小
ブロックに対して、フレームメモリに蓄えられている過
去または未来の参照フレームから動きベクトルを求め、
該動きベクトルにより定まる参照ブロックと現フレーム
の符号化対象小ブロックとの動き補償フレーム間差分値
を算出した後、フレーム間差分値に符号を割り当てるこ
とにより符号化して伝送・記録する画像符号化方法にお
いて、参照フレーム中の複数個の候補ベクトルに対応す
る参照ブロックごとに、動き補償フレーム間差分値に対
する符号の長さをブロック内の各画素で合計し、符号の
長さの合計が最小となるものを動きベクトルとすること
を特徴とする。
According to the image coding method of claim 1, the image data of the current frame is divided into small blocks for the digital image signal, and the divided small blocks to be coded are divided. Obtain a motion vector from past or future reference frames stored in the frame memory,
An image coding method in which a motion compensation interframe difference value between a reference block determined by the motion vector and an encoding target small block of the current frame is calculated, and then coded by assigning a code to the interframe difference value for transmission / recording. In, in each reference block corresponding to a plurality of candidate vectors in the reference frame, the code length for the motion compensation interframe difference value is summed at each pixel in the block, and the sum of the code lengths is minimized. The feature is that the thing is a motion vector.

【0013】請求項2の画像符号化方法は、複数個の符
号テーブルを適応的に切替えて符号化を行うような請求
項1に基づく画像符号化方法において、参照フレーム中
の複数個の候補ベクトルの各々に対して、動き補償フレ
ーム間差分値に対する符号の長さを符号テーブルごとに
ブロック内の各画素で合計し、符号の長さの合計が最小
となるものを動きベクトルとするとともに、選択された
符号長を与えるような符号テーブルにて符号割り当てを
行なう。
An image coding method according to a second aspect is the image coding method according to the first aspect, in which a plurality of code tables are adaptively switched to perform coding, and a plurality of candidate vectors in a reference frame are included. For each of the above, the code lengths for the motion-compensated inter-frame difference values are summed at each pixel in the block for each code table, and the one having the smallest sum of the code lengths is set as the motion vector and selected. Code allocation is performed using a code table that gives the specified code length.

【0014】請求項3の画像符号化方法は、N段の木探
索にて動きベクトルの探索を行なう場合、初段からK−
1段の探索について、参照フレーム中の複数個の候補ベ
クトルの各々に対して、動き補償フレーム間差分値の絶
対値をブロック内の各画素で合計し、絶対値和の合計が
最小となるものを次段の動きベクトル探索の中心とし、
K段からN段の探索については請求項1または請求項2
に従う探索を行なう。
According to the image coding method of the third aspect, when the motion vector search is performed by the tree search of N stages, K− from the first stage.
For a one-step search, the absolute value of the motion compensation interframe difference value is summed for each pixel in the block for each of the plurality of candidate vectors in the reference frame, and the sum of the absolute value sums is the smallest. Is the center of the next stage motion vector search,
Regarding the search from the K stage to the N stage, claim 1 or claim 2
Perform a search according to.

【0015】請求項4の画像符号化装置は、入力された
符号化対象画像を符号化対象小ブロックに分割する小ブ
ロック分割部と、参照画像を蓄えるフレームメモリと、
該フレームメモリに蓄えられている過去または未来の参
照画像から動きベクトルを求める動きベクトル検出部
と、求められた動きベクトルに対応する参照小ブロック
を求める動き補償部と、前記参照小ブロックと前記符号
化対象小ブロックとの差である動き補償フレーム間差分
値を算出する減算器と、前記動き補償フレーム間差分値
に符号を割り当てる符号割り当て部と、符号を割り当て
られた動き補償フレーム間差分値を前記動きベクトルと
多重化し、符号化データとして出力する多重化部と、前
記動き補償フレーム間差分値と前記符号割り当て部にて
用いられる符号の符号長との関係を示す符号長テーブル
を作成し、前記動きベクトル検出部に出力する符号長テ
ーブル作成部を有し、前記動きベクトル検出部は、ベク
トルメモリと、動きベクトルの定められた探索範囲中の
ベクトルを発生し、前記ベクトルメモリに格納する候補
ベクトル設定部と、前記フレームメモリに蓄えられてい
る参照画像を前記候補ベクトル設定部で発生された候補
ベクトルによってその分だけシフトするシフト部と、シ
フトされた小ブロックと前記符号化対象小ブロックの動
き補償フレーム間差分値を計算する減算器と、前記符号
長テーブルに基づいて該各動き補償フレーム間差分値に
対して割り当てられるべき符号長を求める符号長変換部
と、小ブロック内での前記符号長の総和を計算する総和
計算部と、前記総和を、現在蓄えられている最小値と比
較し、該総和が前記最小値よりも小さい場合には、該総
和で最小値を更新し、前記ベクトルメモリに更新指示命
令を送る最小値メモリを含み、前記ベクトルメモリは更
新指示命令により、記憶されているベクトルをその時点
で入力されている候補ベクトルと置換し、前記候補ベク
トル設定部にて定められた探索範囲のすべてのベクトル
の発生が終了した時点で、蓄えられているベクトルを符
号化対象小ブロックの動きベクトルとして出力する。
According to another aspect of the image coding apparatus of the present invention, a small block dividing unit that divides the input encoding target image into encoding target small blocks, a frame memory that stores a reference image,
A motion vector detection unit that obtains a motion vector from past or future reference images stored in the frame memory, a motion compensation unit that obtains a reference small block corresponding to the obtained motion vector, the reference small block, and the code. A subtractor for calculating a motion-compensated inter-frame difference value that is a difference between the motion-compensated inter-frame difference value, a code allocation unit that allocates a code to the motion-compensated inter-frame difference value, and a motion-compensated inter-frame difference value to which a code is allocated. A multiplexing unit that multiplexes with the motion vector and outputs as encoded data, and creates a code length table that indicates the relationship between the motion compensation interframe difference value and the code length of the code used in the code allocation unit, A code length table creating unit for outputting to the motion vector detecting unit, wherein the motion vector detecting unit is a vector memory; Generate a vector in the search range defined by Kuttle, a candidate vector setting unit for storing in the vector memory, and a reference image stored in the frame memory by the candidate vector generated by the candidate vector setting unit A shift unit that shifts by an amount, a subtractor that calculates a difference value between motion-compensated frames of the shifted small block and the small block to be encoded, and a difference value between the motion-compensated frame difference values based on the code length table. A code length conversion unit that obtains a code length to be assigned to the code block, a total sum calculation unit that calculates the total sum of the code lengths in a small block, and the total sum are compared with a currently stored minimum value, and the total sum is calculated. Is smaller than the minimum value, the minimum value is updated by the sum and a minimum value memory for sending an update instruction command to the vector memory is included. The tor memory replaces the stored vector with the candidate vector input at that time by the update instruction command, and when the generation of all the vectors in the search range defined by the candidate vector setting unit is completed, The stored vector is output as the motion vector of the encoding target small block.

【0016】請求項5の画像符号化装置は、入力された
符号化対象画像を符号化対象小ブロックに分割する小ブ
ロック分割部と、参照画像を蓄えるフレームメモリと、
該フレームメモリに蓄えられている過去または未来の参
照画像から動きベクトルを求める動きベクトル検出部
と、求められた動きベクトルに対応する参照小ブロック
を求める動き補償部と、前記参照小ブロックと前記符号
化対象小ブロックとの差である動き補償フレーム間差分
値を算出する減算器と、前記動き補償フレーム間差分値
に符号を割り当てる第1、第2、・・・、第n(n≧
2)の符号割り当て部と、符号を割り当てられた動き補
償フレーム間差分値を前記動きベクトルと多重化し、符
号化データとして出力する多重化部と、前記動き補償フ
レーム間差分値と前記第1、第2、・・・、第nの符号
割り当て部にて用いられる符号の符号長との関係を示す
第1、第2、・・・、第nの符号長テーブルを作成し、
前記動きベクトル検出部に出力する第1、第2、・・
・、第nの符号長テーブル作成部と、前記減算器の出力
を前記第1〜第nの符号割り当て部の入力のいずれかに
接続する第1の符号選択スイッチと、前記第1〜第nの
符号割り当て部のいずれかの出力を前記多重化部に出力
する第2の符号選択スイッチを有し、前記動きベクトル
検出部は、ベクトルメモリと、動きベクトルの定められ
た探索範囲中のベクトルを発生し、前記ベクトルメモリ
に格納する候補ベクトル設定部と、前記フレームメモリ
に蓄えられている参照画像を前記候補ベクトル設定部で
発生された候補ベクトルによってその分だけシフトする
シフト部と、シフトされた小ブロックと前記符号化対象
小ブロックの動き補償フレーム間差分値を計算する減算
器と、前記第1、第2、・・・、第nの符号長テーブル
に基づいて該各動き補償フレーム間差分値に対して割り
当てられるべき第1、第2、・・・、第nの符号長を求
める第1、第2、・・・、第nの符号長変換部と、小ブ
ロック内での前記第1、第2、・・・、第nの符号長の
総和を計算する第1、第2、・・・、第nの総和計算部
と、前記第1の符号長の総和、前記第2の符号長の総
和、・・・、第nの符号長の総和を比較し、最も小さい
総和および該総和を与える符号フラグを出力する比較部
と、前記最小の総和を、現在蓄えられている最小値と比
較し、該総和が前記最小値よりも小さい場合には、該総
和で最小値を更新し、前記ベクトルメモリに更新指示命
令を送る最小値メモリと、前記符号フラグを記憶し、該
符号フラグに対応する符号割り当て部を選択するよう
に、前記第1および第2の符号選択スイッチを切り換え
る符号選択フラグメモリを含み、前記ベクトルメモリは
更新指示命令により、記憶されているベクトルがその時
点で入力されている候補ベクトルと置換し、前記候補ベ
クトル設定部にて定められた探索範囲のすべてのベクト
ルの発生が終了した時点で、蓄えられているベクトルを
符号化対象小ブロックの動きベクトルとして出力する。
According to another aspect of the image coding apparatus of the present invention, a small block dividing unit that divides the input encoding target image into encoding target small blocks, a frame memory that stores a reference image,
A motion vector detection unit that obtains a motion vector from past or future reference images stored in the frame memory, a motion compensation unit that obtains a reference small block corresponding to the obtained motion vector, the reference small block, and the code. A subtracter that calculates a difference value between motion-compensated frames, which is a difference from the small block to be converted, and a first, second, ..., Nth (n ≧ n) that assigns a code to the difference value between motion-compensated frames.
2) a code assigning unit, a multiplexing unit that multiplexes a motion compensation interframe difference value to which a code is assigned with the motion vector and outputs the coded data, the motion compensation interframe difference value, and the first, The first, second, ..., Nth code length tables showing the relationship with the code lengths of the codes used in the second, ..., Nth code allocation unit are created,
The first, second, ...
.., a first code selection switch that connects the output of the n-th code length table to one of the inputs of the first to n-th code allocation units, and the first to n-th A second code selection switch for outputting any one of the outputs of the code assigning unit to the multiplexing unit, and the motion vector detecting unit stores a vector memory and a vector in the search range in which the motion vector is determined. A candidate vector setting unit that is generated and stored in the vector memory; a shift unit that shifts the reference image stored in the frame memory by the candidate vector generated by the candidate vector setting unit; A subtracter that calculates a motion-compensated inter-frame difference value between the small block and the encoding target small block, and each of the motions based on the first, second, ..., Nth code length tables. In the small block, first, second, ..., Nth code length conversion units for determining the first, second, ..., Nth code lengths to be assigned to the compensation frame difference value , The n-th summation calculation unit for calculating the summation of the first, second, ..., Nth code lengths, and the summation of the first codelengths, The comparison unit that compares the sum of the second code lengths, ..., The sum of the nth code lengths and outputs the smallest sum and the code flag that gives the sum, and the minimum sum are currently stored. If the sum is smaller than the minimum value, the minimum value is updated by the sum and the minimum value memory for sending an update instruction command to the vector memory and the code flag are stored. , The first and second code selection switches so as to select a code allocation unit corresponding to the code flag. A code selection flag memory for switching a switch, and the vector memory replaces a stored vector with a candidate vector input at that time by an update instruction command, and a search range determined by the candidate vector setting unit. When the generation of all the vectors is finished, the stored vector is output as the motion vector of the encoding target small block.

【0017】[0017]

【発明の実施の形態】本発明は、動きベクトルを探索し
て参照小ブロックを選択する時に、動き補償フレーム間
差分値に対して割り当てられる符号の長さを考慮するこ
とを特徴とするものである。
BEST MODE FOR CARRYING OUT THE INVENTION The present invention is characterized in that, when searching a motion vector and selecting a reference small block, the length of a code assigned to a motion compensation interframe difference value is taken into consideration. is there.

【0018】具体的には、動きベクトルを求める際の評
価値として、符号化対象小ブロックと参照画像の小ブロ
ックとの差分値を、後段に用いられる符号の符号長で置
き換え、小ブロック内のすべての画素に対する符号長の
総和が最小となるものを最終的な動きベクトルとし、そ
の動きベクトルに対応する小ブロックを参照小ブロック
とするものである。
Specifically, the difference value between the small block to be coded and the small block of the reference image is replaced with the code length of the code used in the subsequent stage as an evaluation value for obtaining the motion vector, and The one having the smallest sum of code lengths for all pixels is set as the final motion vector, and the small block corresponding to the motion vector is set as the reference small block.

【0019】まず、N×Nの符号化対象小ブロックB
(i,j)に対して、フレームメモリ中の参照画像上で
空間的にB(i,j)を水平・垂直方向に(u,v)だ
けずらした小ブロックB'(i+u,j+v)との動き補
償フレーム間差分値Eu,v(i,j)を次式に基づき計算
する。
First, an N × N small block B to be coded
A small block B ′ (i + u, j + v) obtained by spatially shifting B (i, j) by (u, v) in the horizontal / vertical direction on the reference image in the frame memory with respect to (i, j). The motion compensation frame difference value E u, v (i, j) of is calculated based on the following equation.

【0020】[0020]

【数2】 差分値Eu,v(i,j)に対して割り当てられるべき符号
の長さをT[Eu,v(i,j)]とし、各ベクトル(u,
v)に対して、次式のL(u,v)を計算する。Tは差
分値と符号長の変換テーブルを意味する。
[Equation 2] Let T [E u, v (i, j)] be the length of the code to be assigned to the difference value E u, v (i, j), and let each vector (u,
For v), calculate L (u, v) in the following equation. T means a conversion table of the difference value and the code length.

【0021】[0021]

【数3】 (u,v)を設定された探索領域内で変化させて、上記
L(u,v)の最小値を与えるような(u,v)を最終
的な動きベクトル(U,V)とし、動きベクトル(U,
V)によって定められる参照画像中の小ブロックを参照
小ブロックとする。
(Equation 3) By changing (u, v) within the set search area, (u, v) that gives the minimum value of L (u, v) is set as the final motion vector (U, V), and the motion is calculated. Vector (U,
The small block in the reference image defined by V) is set as the reference small block.

【0022】以上の構成は、後段に用いる符号が1種類
の場合であるが、請求項2のように、複数の符号を切替
えて用いるような場合にも同様の手法を用いることがで
きる。k個の符号を切替えて用いる場合には、符号割り
当て部がk種類になりこのうち一つを選択して符号化す
ることになる。この場合、符号長テーブルはk種類にな
るので、符号長変換部においては、一つの候補ベクトル
に対する符号長総和をk通り計算し、その最も小さいも
のを最小値メモリに記録することになる。なお、この場
合には、最小値を与えるベクトルとともに、それがk種
類のうちのどの符号を用いた場合かを符号割り当て部に
知らせ、符号割り当て部では知らされた符号にて符号化
を行なう。
Although the above configuration is for the case where only one type of code is used in the subsequent stage, the same method can be used when a plurality of codes are switched and used as in claim 2. In the case of switching and using k codes, there are k kinds of code allocation units, and one of them is selected and coded. In this case, since there are k types of code length tables, the code length conversion unit calculates k total code lengths for one candidate vector, and records the smallest sum in the minimum value memory. In this case, together with the vector giving the minimum value, the code allocating unit is informed of which of the k kinds of codes is used, and the code allocating unit performs encoding with the informed code.

【0023】さらに、請求項3は、動きベクトル探索を
木探索によって行なう場合の処理である。木探索は図3
に示すように、まず初段では、探索範囲に含まれるベク
トルを粗くサンプリングして探索し、次段では初段で求
められたベクトルを中心としてその近傍のベクトルを探
索する。同様の処理をN段繰り返すことにより最終的な
ベクトルを得るものである。このような木探索において
は、最初の方の段の探索においては、用いる符号の特性
の影響は小さいと思われるので、初段からK−1段の探
索については、参照フレーム中の複数個の候補ベクトル
の各々に対して、動き補償フレーム間差分値の絶対値を
ブロック内の各画素で合計し、絶対値和の合計が最小と
なるものを次段の動きベクトル探索の中心とする図4の
ような従来の方法を採用し、実際に割り当てる符号長の
影響が大きくなってくるK段からN段の探索については
請求項1、または請求項2に従う探索を行なうようにす
る。このようにすることにより、最初の方の段の探索で
はテーブルのマッピングという演算が不要になるので、
処理時間の高速化につながる。さらに、図3に即して説
明すると、まず15×15のドットで表わされるベクト
ルの探索範囲が示されている。第1段目の探索ベクトル
として9つの○印のベクトルを候補に選ぶ。次に、各々
の候補ベクトルについて評価演算を行い、この結果右上
隅のベクトル○が選ばれたとする。次に、右上すみの○
印のベクトルを中心に8個の△印の候補ベクトルを選択
し同様評価演算を行ない、今度は右下隅の△印のベクト
ルが選ばれる。以下合計3回探索を繰返している。
Further, claim 3 is a process when the motion vector search is performed by a tree search. The tree search is shown in Figure 3.
As shown in (1), first, in the first stage, a vector included in the search range is roughly sampled and searched, and in the next stage, a vector in the vicinity of the vector found in the first stage is searched. A final vector is obtained by repeating the same processing N times. In such a tree search, the influence of the characteristics of the code used in the search of the first stage is considered to be small. Therefore, for the search from the first stage to K-1 stages, there are a plurality of candidates in the reference frame. For each of the vectors, the absolute values of the motion-compensated inter-frame difference values are summed at each pixel in the block, and the one having the minimum sum of the absolute values is the center of the motion vector search of the next stage. By adopting such a conventional method, the search according to claim 1 or claim 2 is performed for the search from K stages to N stages where the influence of the actually assigned code length becomes large. By doing this, the operation of mapping the table becomes unnecessary in the search of the first stage,
This leads to faster processing time. Further, referring to FIG. 3, first, a search range of a vector represented by 15 × 15 dots is shown. As the search vector in the first stage, nine vectors marked with a circle are selected as candidates. Next, it is assumed that an evaluation calculation is performed on each candidate vector and, as a result, the vector ◯ in the upper right corner is selected. Next, in the upper right corner
Eight Δ-mark candidate vectors are selected around the mark vector and the same evaluation operation is performed. This time, the Δ-mark vector in the lower right corner is selected. The search is repeated 3 times in total.

【0024】以上述べたような方法によれば、動きベク
トルを求める際の評価値として、符号化対象小ブロック
と参照画像の小ブロックとの差分値を、後段に用いられ
る符号の符号長で置き換え、小ブロック内のすべての画
素に対する符号長の総和が最小となるものが最終的な動
きベクトルとなり、その動きベクトルに対応する小ブロ
ックが参照小ブロックとなる。結果として、最終的に符
号を割り当てて得られる符号長の総和が最短なものにな
るように動作する。
According to the method described above, the difference value between the small block to be encoded and the small block of the reference image is replaced with the code length of the code used in the subsequent stage as the evaluation value when the motion vector is obtained. The motion vector having the smallest sum of code lengths for all pixels in the small block becomes the final motion vector, and the small block corresponding to the motion vector becomes the reference small block. As a result, the operation is performed so that the total sum of code lengths finally obtained by assigning codes becomes the shortest.

【0025】[0025]

【実施例】次に、本発明の実施例について図面を参照し
て説明する。
Next, embodiments of the present invention will be described with reference to the drawings.

【0026】図1は本発明の一実施例の画像符号化装置
のブロック図である。図4中と同符号は同じものを示
す。
FIG. 1 is a block diagram of an image coding apparatus according to an embodiment of the present invention. The same symbols as those in FIG. 4 indicate the same things.

【0027】本実施例は、図4の構成に対して、動き補
償フレーム間差分値と符号割り当て部113にて用いら
れた符号長の関係を示す符号長テーブル118を作成す
る符号長テーブル作成部117が追加され、動きベクト
ル検出部105Aが図4中の動きベクトル検出部105
Cと構成が一部異なっている。動きベクトル検出部10
5Aは、絶対値和計算部214の代りに、符号長テーブ
ル118に基づいて各動き補償フレーム間差分値に対し
て割り当てられるべき符号長を求める符号長変換部20
2と、小ブロック内での符号長の総和を計算する総和計
算部203が設けられている。
In the present embodiment, a code length table creating unit for creating a code length table 118 showing the relationship between the motion compensation interframe difference value and the code length used in the code assigning unit 113 is added to the configuration of FIG. 117 is added, and the motion vector detection unit 105A has the motion vector detection unit 105 in FIG.
The configuration is partially different from C. Motion vector detection unit 10
The code length conversion unit 20 calculates a code length to be assigned to each motion compensation interframe difference value based on the code length table 118 instead of the absolute value sum calculation unit 214.
2 and a total sum calculation unit 203 for calculating the total sum of code lengths in a small block.

【0028】次に、本実施例の動作を説明する。Next, the operation of this embodiment will be described.

【0029】まず、入力端子101から入力された符号
化対象画像102は、小ブロック分割部103にてN×
Nの符号化対象小ブロック104に分割される。分割さ
れた小ブロック104ごとに、動きベクトル検出部10
5Aでは、フレームメモリ106に蓄えられた参照画像
107、すなわち符号化対象画像102の時間的に近接
した画像中から、定められた評価基準にて動きベクトル
108が選択される。動き補償部109では、選択され
た動きベクトル108に対応する参照小ブロック110
が求められ、減算器111において、符号化対象小ブロ
ック104との差が計算され、動き補償フレーム間差分
値112が得られた後、符号割り当て部113にて符号
が割り当てられ、多重化部114において、動きベクト
ル情報108と多重された後、符号化データ115とし
て出力端子116に出力される。符号長テーブル作成部
117では、動き補償フレーム間差分値と符号割り当て
部113にて用いられる符号の符号長との関係を示すテ
ーブル118が作成され、動きベクトル検出部105A
に送られる。
First, the coding target image 102 input from the input terminal 101 is N × in the small block dividing unit 103.
It is divided into N encoding target small blocks 104. For each of the divided small blocks 104, the motion vector detection unit 10
In 5A, the motion vector 108 is selected based on a predetermined evaluation criterion from the reference image 107 stored in the frame memory 106, that is, the images that are temporally close to the encoding target image 102. In the motion compensation unit 109, the reference small block 110 corresponding to the selected motion vector 108.
Is calculated, the difference from the small block 104 to be encoded is calculated in the subtractor 111, and the motion compensation inter-frame difference value 112 is obtained. Then, the code allocation unit 113 allocates the code, and the multiplexing unit 114 In the above, after being multiplexed with the motion vector information 108, it is output to the output terminal 116 as encoded data 115. The code length table creation unit 117 creates a table 118 showing the relationship between the motion compensation interframe difference value and the code length of the code used in the code allocation unit 113, and the motion vector detection unit 105A.
Sent to

【0030】動きベクトル検出部105Aの動作の詳細
は以下の通りである。候補ベクトル設定部205は、定
められた探索範囲中のベクトルを発生させるとともにベ
クトルメモリ206に送出する。シフト部207では、
フレームメモリ106に蓄えられている参照画像107
が候補ベクトル設定部205で設定された候補ベクトル
によってその分だけ空間的にシフトされる。減算器20
1においては、シフトされた小ブロックと符号化対象小
ブロック104の動き補償フレーム間差分値が計算さ
れ、符号長変換部202へ入力される。符号長変換部2
02では、符号長テーブル118に基づいて各動き補償
フレーム間差分値に対して割り当てられるべき符号長が
求められた後、総和計算部203に入力される。総和計
算部203では小ブロック内での符号長の総和が計算さ
れ、計算された総和は最小値メモリ204に送られ、そ
の時点でメモリに蓄えられている最小値との比較が行な
われる。総和が最小値よりも小さい場合には最小値が更
新されるとともに、ベクトルメモリ206に対して更新
指示命令が送られ、記憶されているベクトルがその時点
で入力されている候補ベクトルに置換される。候補ベク
トル設定部205にて定められた探索範囲のすべてのベ
クトルの発生が終了した時点で、ベクトルメモリ206
に蓄えられているベクトルが符号化対象小ブロックの動
きベクトル108として出力されるとともに、最小値メ
モリ204、ベクトルメモリ206がリセットされる。
The details of the operation of the motion vector detecting section 105A are as follows. The candidate vector setting unit 205 generates a vector within the defined search range and sends it to the vector memory 206. In the shift unit 207,
Reference image 107 stored in frame memory 106
Is spatially shifted by that amount by the candidate vector set by the candidate vector setting unit 205. Subtractor 20
In No. 1, the motion compensation interframe difference value between the shifted small block and the encoding target small block 104 is calculated and input to the code length conversion unit 202. Code length conversion unit 2
In 02, the code length to be assigned to each motion compensation inter-frame difference value is obtained based on the code length table 118, and then input to the sum calculation unit 203. The sum total calculation unit 203 calculates the sum of the code lengths in the small blocks, sends the calculated sum to the minimum value memory 204, and compares it with the minimum value stored in the memory at that time. If the total sum is smaller than the minimum value, the minimum value is updated, and an update instruction command is sent to the vector memory 206 to replace the stored vector with the candidate vector input at that time. . When the generation of all the vectors in the search range defined by the candidate vector setting unit 205 is completed, the vector memory 206
Is stored as the motion vector 108 of the small block to be encoded, and the minimum value memory 204 and the vector memory 206 are reset.

【0031】図2は本発明の他の実施例の画像符号化装
置のブロック図である。
FIG. 2 is a block diagram of an image coding apparatus according to another embodiment of the present invention.

【0032】本実施例は可変長符号が2種類の場合の例
である。したがって、2種類の符号割り当て部、すなわ
ち第1の符号割り当て部113A、第2の符号割り当て
部113Bと、2種類の符号長テーブル作成部、すなわ
ち動き補償フレーム間差分値と第1の符号割り当て部1
13Aにて用いられる符号の符号長との関係を示すテー
ブル118Aを作成する第1の符号長テーブル作成部1
17Aと、動き補償フレーム間差分値と第2の符号割り
当て部113Bにて用いられる符号の符号長との関係を
示すテーブル118Bを作成する第2の符号長テーブル
作成部117Bが設けられている。さらに、動きベクト
ル検出部105Bでは、それぞれ第1の符号長テーブル
118A、第2の符号長テーブル118Bに基づいて各
動き補償フレーム間差分値に対して割り当てられるべき
符号長を求める第1の符号長変換部202A、第2の符
号長変換部202Bと、それぞれ第1の符号長変換部2
02A、第2の符号長変換部202Bで求められた符号
長を入力し、符号長の総和208A,208Bを求める
第1の総和計算部203A、第2の総和計算部203B
と、符号選択フラグメモリ212と、符号長の総和20
8A,208Bを入力、比較し、小さい方の総和211
を最小値メモリ204に記憶し、選択された方の総和2
11を与える符号フラグ210を符号選択フラグメモリ
212に書き込む比較部209を備えている。
This embodiment is an example of the case where there are two types of variable length codes. Therefore, two types of code assigning units, that is, the first code assigning unit 113A and the second code assigning unit 113B, and two types of code length table creating units, that is, the motion compensation interframe difference value and the first code assigning unit. 1
A first code length table creation unit 1 that creates a table 118A showing the relationship between the code length and the code length used in 13A.
17A, and a second code length table creation unit 117B that creates a table 118B indicating the relationship between the motion compensation inter-frame difference value and the code length of the code used in the second code allocation unit 113B. Further, in the motion vector detection unit 105B, the first code length that determines the code length to be assigned to each motion compensation interframe difference value based on the first code length table 118A and the second code length table 118B, respectively. The conversion unit 202A, the second code length conversion unit 202B, and the first code length conversion unit 2 respectively.
02A, the code length obtained by the second code length conversion unit 202B is input, and the first sum total calculation unit 203A and the second total sum calculation unit 203B that obtain the sums 208A and 208B of the code lengths are input.
, The code selection flag memory 212, and the sum of code lengths 20
8A, 208B are input and compared, and the smaller sum 211
Is stored in the minimum value memory 204, and the sum of the selected one is 2
The comparison unit 209 for writing the code flag 210 giving 11 to the code selection flag memory 212 is provided.

【0033】符号選択スイッチ119,120は符号選
択フラグメモリ212に蓄えられている符号フラグ21
3に応じて切り換わる。
The code selection switches 119 and 120 are code flags 21 stored in the code selection flag memory 212.
Switch according to 3.

【0034】次に、本実施例の動作を説明する。Next, the operation of this embodiment will be described.

【0035】まず、入力端子101から入力された符号
化対象画像102は、小ブロック分割部103にて16
×16の符号化対象小ブロック104に分割される。分
割された小ブロック104ごとに、動きベクトル検出部
105Bでは、フレームメモリ106に蓄えられた参照
画像107、すなわち符号化対象画像102の時間的に
近接した画像中から、定められた評価基準にて動きベク
トル108が選択される。動き補償部109では、選択
された動きベクトル108に対応する参照小ブロック1
10が求められ、減算器111において、符号化対象小
ブロック104との差が計算され、動き補償フレーム間
差分値112が得られた後、第1の符号割り当て部11
3Aまたは第2の符号割り当て部113Bにて符号が割
り当てられ、多重化部114において、動きベクトル情
報108と多重された後、符号化データ115として出
力端子116に出力される。
First, the coding target image 102 input from the input terminal 101 is divided into 16 by the small block dividing unit 103.
It is divided into × 16 encoding target small blocks 104. For each of the divided small blocks 104, the motion vector detection unit 105B uses the reference image 107 stored in the frame memory 106, that is, the images that are temporally close to the encoding target image 102, according to a predetermined evaluation criterion. The motion vector 108 is selected. In the motion compensation unit 109, the reference small block 1 corresponding to the selected motion vector 108
10 is calculated, the difference from the small block 104 to be encoded is calculated in the subtractor 111, and the motion compensation interframe difference value 112 is obtained, and then the first code allocation unit 11
Codes are assigned by the 3A or second code assigning unit 113B, multiplexed by the multiplexing unit 114 with the motion vector information 108, and then output to the output terminal 116 as encoded data 115.

【0036】一方、第1の符号長テーブル作成部117
Aでは、動き補償フレーム間差分値と第1の符号割り当
て部113Aにて用いられる符号の符号長との関係を示
すテーブル118Aが作成され、第2の符号長テーブル
作成部117Bでは、動き補償フレーム間差分値と第2
の符号割り当て部113Bにて用いられる符号の符号長
との関係を示すテーブル118Bが作成され、それぞれ
動きベクトル検出部105Bに送られる。
On the other hand, the first code length table creating section 117
In A, a table 118A showing the relationship between the difference value between motion compensation frames and the code length of the code used in the first code allocation unit 113A is created, and in the second code length table creation unit 117B, the motion compensation frame is created. Difference value and second
A table 118B indicating the relationship with the code length of the code used in the code allocation unit 113B is created and sent to the motion vector detection unit 105B.

【0037】さらに、動きベクトル検出部105Bの動
作の詳細は以下の通りである。候補ベクトル設定部20
5は、定められた探索範囲中のベクトルを発生させると
ともにベクトルメモリ206に送出する。シフト部20
7では、フレームメモリ106に蓄えられている参照画
像107が候補ベクトル設定部205で設定された候補
ベクトルによってその分だけ空間的にシフトされる。減
算器201においては、シフトされた小ブロックと符号
化対象小ブロック104の動き補償フレーム間差分値が
計算され、第1の符号長変換部202Aおよび第2の符
号長変換部202Bへ入力される。第1の符号長変換部
202Aでは、第1の符号長テーブル118Aに基づい
て各動き補償フレーム間差分値に対して割り当てられる
べき符号長が求められた後、第1の総和計算部203A
に入力される。第1の総和計算部203Aでは小ブロッ
ク内での符号長の総和208Aが計算される。同様にし
て、第2の符号長変換部202Bでは、第2の符号長テ
ーブル118Bに基づいて各動き補償フレーム間差分値
に対して割り当てられるべき符号長が求められた後、第
2の総和計算部203Bに入力される。第2の総和計算
部203Bでは小ブロック内での符号長の画素208B
が計算される。計算された2種類の総和208Aおよび
208Bは比較部209に送られ、小さい方の総和21
1が最小値メモリ204に送られ、その時点でメモリに
蓄えられている最小値との比較が行なわれる。選択され
た方の総和211が最小値メモリ204に蓄えられてい
る最小値よりも小さい場合には、最小値が更新されると
ともに、ベクトルメモリ206に対して更新指示命令が
送られ、記憶されているベクトルがその時点で入力され
ている候補ベクトルに置換される。さらに、比較器20
9から、選択された方の総和211を与える符号フラグ
210を符号選択フラグメモリ212に書き込む。
The details of the operation of the motion vector detecting section 105B are as follows. Candidate vector setting unit 20
5 generates a vector within the defined search range and sends it to the vector memory 206. Shift unit 20
7, the reference image 107 stored in the frame memory 106 is spatially shifted by that amount by the candidate vector set by the candidate vector setting unit 205. In the subtractor 201, the motion compensation interframe difference value between the shifted small block and the encoding target small block 104 is calculated and input to the first code length conversion unit 202A and the second code length conversion unit 202B. . In the first code length conversion unit 202A, after the code length to be assigned to each motion compensation interframe difference value is obtained based on the first code length table 118A, the first total sum calculation unit 203A
Is input to The first total sum calculation unit 203A calculates the total sum 208A of the code lengths in the small block. Similarly, in the second code length conversion unit 202B, after the code length to be assigned to each motion compensation interframe difference value is obtained based on the second code length table 118B, the second total sum calculation is performed. It is input to the section 203B. In the second total sum calculation unit 203B, the pixel 208B having the code length in the small block is
Is calculated. The calculated two types of sums 208A and 208B are sent to the comparison unit 209, and the smaller sum 21
1 is sent to the minimum value memory 204, and comparison with the minimum value stored in the memory at that time is performed. If the selected sum total 211 is smaller than the minimum value stored in the minimum value memory 204, the minimum value is updated and an update instruction command is sent to the vector memory 206 and stored. Existing vector is replaced by the candidate vector input at that time. Furthermore, the comparator 20
The code flag 210 which gives the total sum 211 of the selected one from 9 is written in the code selection flag memory 212.

【0038】候補ベクトル設定部205にて定められた
探索範囲のすべてのベクトルの発生が終了した時点で、
ベクトルメモリ206に蓄えられているベクトルが符号
化対象小ブロックの動きベクトル108として出力さ
れ、また符号選択フラグメモリ212に蓄えられている
符号フラグが符号選択フラグ213として符号選択スイ
ッチ119,120に出力されるとともに、最小値メモ
リ204、ベクトルメモリ206、符号選択フラグメモ
リ212がリセットされる。符号選択スイッチ119,
120は符号選択フラグ213に基づいてスイッチを切
替える。
When the generation of all the vectors within the search range defined by the candidate vector setting unit 205 is completed,
The vector stored in the vector memory 206 is output as the motion vector 108 of the small block to be encoded, and the code flag stored in the code selection flag memory 212 is output as the code selection flag 213 to the code selection switches 119 and 120. At the same time, the minimum value memory 204, the vector memory 206, and the code selection flag memory 212 are reset. Code selection switch 119,
Reference numeral 120 switches the switch based on the code selection flag 213.

【0039】本実施例においては以下のような演算がな
されていることになる。16×16の符号化対象小ブロ
ックB(i,j)に対して、フレームメモリ106中の
参照画像107上で空間的にB(i,j)を水平・垂直
方向に(u,v)だけずらした小ブロックB'(i+u,
j+v)との動き補償フレーム間差分値Eu,v(i,j)
を以下に基づき計算する。
In this embodiment, the following calculation is performed. For a 16 × 16 small block B (i, j) to be encoded, B (i, j) is spatially and horizontally (u, v) only on the reference image 107 in the frame memory 106. The shifted small blocks B '(i + u,
j + v) and a motion compensation inter-frame difference value E u, v (i, j)
Is calculated based on the following.

【0040】[0040]

【数4】 差分値Eu,v(i,j)に対して割り当てられるべき2種
類の符号の長さをそれぞれW1 [Eu,v(i,j)],W
2 [Eu,v(i,j)]とし、各ベクトル(u,v)に対
して、次式のL1(u,v),L2(u,v)を計算する。
(Equation 4) The lengths of two types of codes to be assigned to the difference value E u, v (i, j) are W 1 [E u, v (i, j)], W, respectively.
2 [E u, v (i, j)], L 1 (u, v) and L 2 (u, v) in the following equations are calculated for each vector (u, v).

【0041】[0041]

【数5】 (u,v)を設定された探索領域内で変化させて、上記
1(u,v),L2(u,v)の最小値を与えるような
(u,v)を最終的な動きベクトル(U,V)とし、動
きベクトル(U,V)によって定められる参照画像10
7中の小ブロックを参照小ブロックとする。また、最小
値を与えるのがW1 を用いた場合かW2 を用いた場合か
により、符号割り当て部113A,113Bで使用する
符号を決定する。
(Equation 5) By changing (u, v) within the set search area, the final motion of (u, v) that gives the minimum value of L 1 (u, v) and L 2 (u, v) is performed. A reference image 10 defined as a motion vector (U, V) with a vector (U, V)
The small blocks in 7 are referred to as reference small blocks. Further, the code used in the code allocation units 113A and 113B is determined depending on whether the minimum value is given by using W 1 or W 2 .

【0042】[0042]

【発明の効果】以上説明したように本発明は、動きベク
トルを求める際の評価値として、符号化対象小ブロック
と参照画像の小ブロックとの差分値を、後段に用いられ
る符号の符号長で置き換え、小ブロック内のすべての画
素に対する符号長の総和が最小となるものを最終的な動
きベクトルとすることにより、その動きベクトルに対応
する小ブロックが参照小ブロックとなり、結果として、
動き補償フレーム間予測差分値に符号を割り当てて伝送
・記録するようなロスレス符号化方法において、最終的
に符号を割り当てて得られる符号長の総和が最短なもの
にすることが可能となる。また、用いる符号の符号長を
テーブルにしておくことで、処理も容易であるので、非
常に実現性の高い方法であるといえる。
As described above, according to the present invention, the difference value between the small block to be encoded and the small block of the reference image is used as the evaluation value when the motion vector is obtained, and the difference is the code length of the code used in the subsequent stage. Substituting, the smallest sum of code lengths for all pixels in the small block is set as the final motion vector, and the small block corresponding to the motion vector becomes the reference small block.
In a lossless coding method in which a code is assigned to a motion-compensated inter-frame prediction difference value and transmitted / recorded, the sum of code lengths finally obtained by assigning codes can be minimized. Further, since the code lengths of the codes to be used are stored in a table, the processing is easy, and it can be said that this is a very highly feasible method.

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

【図1】本発明の一実施例の符号化装置のブロック図で
ある。
FIG. 1 is a block diagram of an encoding device according to an embodiment of the present invention.

【図2】本発明の他の実施例の符号化装置のブロック図
である。
FIG. 2 is a block diagram of an encoding device according to another embodiment of the present invention.

【図3】木探索による動きベクトル検出方法を示す図で
ある。
FIG. 3 is a diagram showing a motion vector detection method by tree search.

【図4】符号化装置の従来例のブロック図である。FIG. 4 is a block diagram of a conventional example of an encoding device.

【図5】従来の符号化方法の問題点を示す図である。FIG. 5 is a diagram showing a problem of a conventional encoding method.

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

101 入力端子 102 符号化対象画像 103 小ブロック分割部 104 符号化対象小ブロック 105A,105B 動きベクトル検出部 106 フレームメモリ 107 参照画像 108 動きベクトル 109 動き補償部 110 参照小ブロック 111 減算器 112 動き補償フレーム間差分値 113 符号割り当て部 114 多重化部 115 符号化データ 116 出力端子 117 符号長テーブル作成部 117A 第1の符号長テーブル作成部 117B 第2の符号長テーブル作成部 118 符号長テーブル 118A 第1の符号長テーブル 118B 第2の符号長テーブル 119,120 符号選択スイッチ 201 減算器 202 符号長変換部 202A 第1の符号長変換部 202B 第2の符号長変換部 203A 第1の総和計算部 203B 第2の総和計算部 204 最小値メモリ 205 候補ベクトル設定部 206 ベクトルメモリ 207 シフト部 208A 第1の符号長の総和 208B 第2の符号長の総和 209 比較部 210 符号フラグ 211 選択された総和 212 符号選択フラグメモリ 213 符号選択フラグ 101 Input Terminal 102 Coding Target Image 103 Small Block Dividing Unit 104 Coding Target Small Block 105A, 105B Motion Vector Detection Unit 106 Frame Memory 107 Reference Image 108 Motion Vector 109 Motion Compensation Unit 110 Reference Small Block 111 Subtractor 112 Motion Compensation Frame Inter-difference value 113 Code assignment unit 114 Multiplexing unit 115 Coded data 116 Output terminal 117 Code length table creation unit 117A First code length table creation unit 117B Second code length table creation unit 118 Code length table 118A First Code length table 118B Second code length table 119, 120 Code selection switch 201 Subtractor 202 Code length conversion unit 202A First code length conversion unit 202B Second code length conversion unit 203A First sum calculation unit 203B 2 total sum calculation unit 204 minimum value memory 205 candidate vector setting unit 206 vector memory 207 shift unit 208A first code length summation 208B second code length summation 209 comparison unit 210 code flag 211 selected summation 212 code selection Flag memory 213 Code selection flag

Claims (5)

【特許請求の範囲】[Claims] 【請求項1】 ディジタル画像信号に対して、現フレー
ムの画像データを小ブロックに分割し、分割された符号
化対象小ブロックに対して、フレームメモリに蓄えられ
ている過去または未来の参照フレームから動きベクトル
を求め、該動きベクトルにより定まる参照ブロックと現
フレームの符号化対象小ブロックとの動き補償フレーム
間差分値を算出した後、フレーム間差分値に符号を割り
当てることにより符号化して伝送・記録する画像符号化
方法において、 参照フレーム中の複数個の候補ベクトルに対応する参照
ブロックごとに、動き補償フレーム間差分値に対する符
号の長さをブロック内の各画素で合計し、符号の長さの
合計が最小となるものを動きベクトルとすることを特徴
とする画像符号化方法。
1. For a digital image signal, image data of the current frame is divided into small blocks, and the divided small blocks to be encoded are extracted from past or future reference frames stored in a frame memory. After obtaining a motion vector, calculating a motion compensation interframe difference value between a reference block determined by the motion vector and an encoding target small block of the current frame, and encoding and transmitting / recording by assigning a code to the interframe difference value. In the image coding method described above, for each reference block corresponding to a plurality of candidate vectors in the reference frame, the code lengths for the motion compensation inter-frame difference value are summed at each pixel in the block, and the code length An image coding method characterized in that a motion vector having a minimum sum is used as a motion vector.
【請求項2】 複数個の符号テーブルを適応的に切替え
て符号化を行なうような請求項1に基づく画像符号化方
法において、 参照フレーム中の複数個の候補ベクトルの各々に対し
て、動き補償フレーム間差分値に対する符号の長さを符
号テーブルごとにブロック内の各画素で合計し、符号の
長さの合計が最小となるものを動きベクトルとするとと
もに、選択された符号長を与えるような符号テーブルに
て符号割り当てを行なうことを特徴とする画像符号化方
法。
2. An image coding method according to claim 1, wherein a plurality of code tables are adaptively switched for coding, wherein motion compensation is performed for each of a plurality of candidate vectors in a reference frame. The code length for the inter-frame difference value is summed at each pixel in the block for each code table, and the one having the smallest sum of the code lengths is set as the motion vector, and the selected code length is given. An image coding method characterized by performing code assignment in a code table.
【請求項3】 N段の木探索にて動きベクトルの探索を
行なう場合、初段からK−1段の探索について、参照フ
レーム中の複数個の候補ベクトルの各々に対して、動き
補償フレーム間差分値の絶対値をブロック内の各画素で
合計し、絶対値和の合計が最小となるものを次段の動き
ベクトル探索の中心とし、K段からN段の探索について
は請求項1または請求項2に従う探索を行なうことを特
徴とする画像符号化方法。
3. When motion vectors are searched by N-th tree search, the motion-compensated interframe difference for each of a plurality of candidate vectors in the reference frame in the search from the first to K-1th stages. The absolute values of the values are summed at each pixel in the block, and the one having the minimum sum of absolute values is set as the center of the motion vector search in the next stage, and K to N stages are searched. An image coding method characterized by performing a search according to 2.
【請求項4】 入力された符号化対象画像を符号化対象
小ブロックに分割する小ブロック分割部と、参照画像を
蓄えるフレームメモリと、該フレームメモリに蓄えられ
ている過去または未来の参照画像から動きベクトルを求
める動きベクトル検出部と、求められた動きベクトルに
対応する参照小ブロックを求める動き補償部と、前記参
照小ブロックと前記符号化対象小ブロックとの差である
動き補償フレーム間差分値を算出する減算器と、前記動
き補償フレーム間差分値に符号を割り当てる符号割り当
て部と、符号を割り当てられた動き補償フレーム間差分
値を前記動きベクトルと多重化し、符号化データとして
出力する多重化部と、前記動き補償フレーム間差分値と
前記符号割り当て部にて用いられる符号の符号長との関
係を示す符号長テーブルを作成し、前記動きベクトル検
出部に出力する符号長テーブル作成部を有し、 前記動きベクトル検出部は、ベクトルメモリと、動きベ
クトルの定められた探索範囲中のベクトルを発生し、前
記ベクトルメモリに格納する候補ベクトル設定部と、前
記フレームメモリに蓄えられている参照画像を前記候補
ベクトル設定部で発生された候補ベクトルによってその
分だけシフトするシフト部と、シフトされた小ブロック
と前記符号化対象小ブロックの動き補償フレーム間差分
値を計算する減算器と、前記符号長テーブルに基づいて
該各動き補償フレーム間差分値に対して割り当てられる
べき符号長を求める符号長変換部と、小ブロック内での
前記符号長の総和を計算する総和計算部と、前記総和
を、現在蓄えられている最小値と比較し、該総和が前記
最小値よりも小さい場合には、該総和で最小値を更新
し、前記ベクトルメモリに更新指示命令を送る最小値メ
モリを含み、前記ベクトルメモリは更新指示命令によ
り、記憶されているベクトルをその時点で入力されてい
る候補ベクトルと置換し、前記候補ベクトル設定部にて
定められた探索範囲のすべてのベクトルの発生が終了し
た時点で、蓄えられているベクトルを符号化対象小ブロ
ックの動きベクトルとして出力する画像符号化装置。
4. A small block dividing unit that divides an input encoding target image into encoding target small blocks, a frame memory that stores a reference image, and a past or future reference image that is stored in the frame memory. A motion vector detection unit that obtains a motion vector, a motion compensation unit that obtains a reference small block corresponding to the obtained motion vector, and a motion compensation interframe difference value that is a difference between the reference small block and the encoding target small block. , A code assigning unit that assigns a code to the motion compensation inter-frame difference value, a multiplexing unit that multiplexes the motion compensation inter-frame difference value to which the code is assigned with the motion vector, and outputs the coded data. Section and a code length table indicating the relationship between the motion compensation inter-frame difference value and the code length of the code used in the code allocation section. A code length table creating unit for creating a block and outputting it to the motion vector detecting unit. The motion vector detecting unit generates a vector memory and a vector within a search range in which the motion vector is defined. A candidate vector setting unit to be stored in the memory, a shift unit for shifting the reference image stored in the frame memory by the candidate vector generated by the candidate vector setting unit, a shifted small block and the code. A subtractor for calculating a motion compensation inter-frame difference value of a small block to be coded, a code length conversion unit for obtaining a code length to be assigned to each motion compensation inter frame difference value based on the code length table, A sum total calculation unit that calculates the sum total of the code lengths in the block, and the sum total is compared with a currently stored minimum value, and the sum total is calculated. Is smaller than the minimum value, the minimum value is updated by the sum and a minimum value memory for sending an update instruction command to the vector memory is included, and the vector memory stores the vector stored by the update instruction command. The candidate vector input at that time is replaced, and when the generation of all the vectors in the search range defined by the candidate vector setting unit is completed, the stored vector is moved to the small block to be encoded. An image encoding device that outputs as a vector.
【請求項5】 入力された符号化対象画像を符号化対象
小ブロックに分割する小ブロック分割部と、参照画像を
蓄えるフレームメモリと、該フレームメモリに蓄えられ
ている過去または未来の参照画像から動きベクトルを求
める動きベクトル検出部と、求められた動きベクトルに
対応する参照小ブロックを求める動き補償部と、前記参
照小ブロックと前記符号化対象小ブロックとの差である
動き補償フレーム間差分値を算出する減算器と、前記動
き補償フレーム間差分値に符号を割り当てる第1、第
2、・・・、第n(n≧2)の符号割り当て部と、符号
を割り当てられた動き補償フレーム間差分値を前記動き
ベクトルと多重化し、符号化データとして出力する多重
化部と、前記動き補償フレーム間差分値と前記第1、第
2、・・・、第nの符号割り当て部にて用いられる符号
の符号長との関係を示す第1、第2、・・・、第nの符
号長テーブルを作成し、前記動きベクトル検出部に出力
する第1、第2、・・・、第nの符号長テーブル作成部
と、前記減算器の出力を前記第1〜第nの符号割り当て
部の入力のいずれかに接続する第1の符号選択スイッチ
と、前記第1〜第nの符号割り当て部のいずれかの出力
を前記多重化部に出力する第2の符号選択スイッチを有
し、 前記動きベクトル検出部は、ベクトルメモリと、動きベ
クトルの定められた探索範囲中のベクトルを発生し、前
記ベクトルメモリに格納する候補ベクトル設定部と、前
記フレームメモリに蓄えられている参照画像を前記候補
ベクトル設定部で発生された候補ベクトルによってその
分だけシフトするシフト部と、シフトされた小ブロック
と前記符号化対象小ブロックの動き補償フレーム間差分
値を計算する減算器と、前記第1、第2、・・・、第n
の符号長テーブルに基づいて該各動き補償フレーム間差
分値に対して割り当てられるべき第1、第2、・・・、
第nの符号長を求める第1、第2、・・・、第nの符号
長変換部と、小ブロック内での前記第1、第2、・・
・、第nの符号長の総和を計算する第1、第2、・・
・、第nの総和計算部と、前記第1の符号長の総和、前
記第2の符号長の総和、・・・、第nの符号長の総和を
比較し、最も小さい総和および該総和を与える符号フラ
グを出力する比較部と、前記最小の総和を、現在蓄えら
れている最小値と比較し、該総和が前記最小値よりも小
さい場合には、該総和で最小値を更新し、前記ベクトル
メモリに更新指示命令を送る最小値メモリと、前記符号
フラグを記憶し、該符号フラグに対応する符号割り当て
部を選択するように、前記第1および第2の符号選択ス
イッチを切り換える符号選択フラグメモリを含み、前記
ベクトルメモリは更新指示命令により、記憶されている
ベクトルをその時点で入力されている候補ベクトルと置
換し、前記候補ベクトル設定部にて定められた探索範囲
のすべてのベクトルの発生が終了した時点で、蓄えられ
ているベクトルを符号化対象小ブロックの動きベクトル
として出力する画像符号化装置。
5. A small block division unit that divides an input encoding target image into encoding target small blocks, a frame memory that stores a reference image, and a past or future reference image that is stored in the frame memory. A motion vector detection unit that obtains a motion vector, a motion compensation unit that obtains a reference small block corresponding to the obtained motion vector, and a motion compensation interframe difference value that is a difference between the reference small block and the encoding target small block. , A first, second, ..., Nth (n ≧ 2) code assigning unit that assigns a code to the inter-motion-compensation-frame difference value, and a motion-compensated frame to which a code is assigned. A multiplexing unit that multiplexes the difference value with the motion vector and outputs the coded data, the motion compensation inter-frame difference value, and the first, second, ..., Nth code. The first, second, ..., Nth code length tables showing the relations with the code lengths of the codes used in the code assignment unit are created and output to the motion vector detection unit. ..., the n-th code length table creation unit, the first code selection switch that connects the output of the subtractor to one of the inputs of the first to n-th code allocation units, and the first to first code selection switches. A second code selection switch for outputting any output of the n-th code allocation unit to the multiplexing unit, wherein the motion vector detection unit includes a vector memory and a search range in which a motion vector is defined. A candidate vector setting unit that generates a vector and stores it in the vector memory, a shift unit that shifts the reference image stored in the frame memory by the candidate vector generated by the candidate vector setting unit, and a shifter. , The n-th sub-block for calculating a motion compensation inter-frame difference value between the encoded small block and the encoding target small block, and the first, second, ...
, Which should be assigned to each motion compensation inter-frame difference value based on the code length table of
The first, second, ..., Nth code length conversion units for obtaining the nth code length, and the first, second, ...
.., first, second, ... for calculating the sum of the nth code lengths
.., the sum of the first code length, the sum of the second code length, ..., The sum of the n-th code lengths are compared, and the smallest sum and the sum are calculated. A comparison unit that outputs a given code flag and the minimum total sum are compared with the currently stored minimum value. If the total sum is smaller than the minimum value, the minimum value is updated with the total sum, and A minimum value memory that sends an update instruction command to a vector memory, and a code selection flag that switches the first and second code selection switches so as to store the code flag and select a code allocation unit corresponding to the code flag. The vector memory includes a memory and replaces the stored vector with a candidate vector input at that time by an update instruction command, and all vectors in the search range defined by the candidate vector setting unit. When the occurrence of is completed, the image encoding device that outputs are accumulated vector as the motion vector of the encoding target small block.
JP16984495A 1995-07-05 1995-07-05 Image coding method and apparatus Expired - Lifetime JP3209260B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP16984495A JP3209260B2 (en) 1995-07-05 1995-07-05 Image coding method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP16984495A JP3209260B2 (en) 1995-07-05 1995-07-05 Image coding method and apparatus

Publications (2)

Publication Number Publication Date
JPH0923433A true JPH0923433A (en) 1997-01-21
JP3209260B2 JP3209260B2 (en) 2001-09-17

Family

ID=15893985

Family Applications (1)

Application Number Title Priority Date Filing Date
JP16984495A Expired - Lifetime JP3209260B2 (en) 1995-07-05 1995-07-05 Image coding method and apparatus

Country Status (1)

Country Link
JP (1) JP3209260B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10587882B2 (en) 2011-03-09 2020-03-10 Panasonic Intellectual Property Corporation Of America Device and method of video decoding with first and second decoding code
US10757422B2 (en) 2011-03-09 2020-08-25 Panasonic Intellectual Property Corporation Of America Device and method of video encoding with first and second encoding code

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10587882B2 (en) 2011-03-09 2020-03-10 Panasonic Intellectual Property Corporation Of America Device and method of video decoding with first and second decoding code
US10757422B2 (en) 2011-03-09 2020-08-25 Panasonic Intellectual Property Corporation Of America Device and method of video encoding with first and second encoding code
US11234005B2 (en) 2011-03-09 2022-01-25 Panasonic Intellectual Property Corporation Of America Device and method of video decoding with first and second decoding code
US11303910B2 (en) 2011-03-09 2022-04-12 Panasonic Intellectual Property Corporation Of America Device and method of video encoding with first and second encoding code
US11706424B2 (en) 2011-03-09 2023-07-18 Panasonic Intellectual Property Corporation Of America Device and method of video decoding with first and second decoding code
US11849124B2 (en) 2011-03-09 2023-12-19 Panasonic Intellectual Property Corporation Of America Device and method of video encoding with first and second encoding code

Also Published As

Publication number Publication date
JP3209260B2 (en) 2001-09-17

Similar Documents

Publication Publication Date Title
US20210227254A1 (en) Method and device for video image processing
KR100908422B1 (en) Image coding apparatus, image decoding apparatus, image coding method, image decoding method, recording medium recording image coding program, recording medium recording image decoding program
JP3936335B2 (en) Moving picture encoding apparatus, moving picture decoding apparatus, moving picture encoding method, moving picture decoding method, program, and computer-readable recording medium storing program
JP2019115061A (en) Encoder, encoding method, decoder, decoding method and program
CN101127902B (en) Interframe prediction processor with address management mechanism for motion vector storage
KR101383612B1 (en) Method for the compression of data in a video sequence
JPH1155667A (en) Image coder, image decoder, and recording medium recorded with image coded data
KR20110020214A (en) Video coding method and apparatus by using adaptive motion vector resolution
JPWO2006019093A1 (en) Image encoding method, image decoding method, image encoding device, image decoding device, image encoding program, and image decoding program
CN113170192A (en) Affine MERGE and MVD
JP2008124772A (en) Coding device and coding method
JP2000224593A (en) Method and device for interpolating frame and recording medium recording the method
JP3466162B2 (en) Image decoding apparatus and image decoding method
JP2003259377A (en) Moving picture encoding method, moving picture decoding method, and code string format
JPH10224795A (en) Moving image coding method, decoding method, coder and decoder
JPH0923433A (en) Method and device for encoding picture
JPWO2013014693A1 (en) Video decoding method and video encoding method
JP2003333600A (en) Image encoding method and image decoding method
JP2019140630A (en) Video encoder, video decoder, and their program
JPH104549A (en) Image coder and image decoder
JP2003125408A (en) Image coder, image decoder, its method, image coding program, and image decoding program
JPH0818974A (en) Encoder and motion detector for dynamic image
JPH10145797A (en) Method for encoding image and device therefor
JP2018182393A (en) Video encoding apparatus
JP2004187107A (en) Moving image encoding method and moving image decoding method

Legal Events

Date Code Title Description
FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20070713

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20080713

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20080713

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20090713

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20090713

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20100713

Year of fee payment: 9