JP3670566B2 - Processing time adaptive image encoding method and program recording medium - Google Patents

Processing time adaptive image encoding method and program recording medium Download PDF

Info

Publication number
JP3670566B2
JP3670566B2 JP2000303509A JP2000303509A JP3670566B2 JP 3670566 B2 JP3670566 B2 JP 3670566B2 JP 2000303509 A JP2000303509 A JP 2000303509A JP 2000303509 A JP2000303509 A JP 2000303509A JP 3670566 B2 JP3670566 B2 JP 3670566B2
Authority
JP
Japan
Prior art keywords
motion search
time
encoding
motion
frame
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2000303509A
Other languages
Japanese (ja)
Other versions
JP2002112274A (en
Inventor
英明 木全
由幸 八島
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
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 JP2000303509A priority Critical patent/JP3670566B2/en
Publication of JP2002112274A publication Critical patent/JP2002112274A/en
Application granted granted Critical
Publication of JP3670566B2 publication Critical patent/JP3670566B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

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

Description

【0001】
【発明が属する技術分野】
本発明は,動画像符号化の技術に関し,特に符号化処理の実行環境に応じて符号化の処理時間が異なる場合にも探索精度を切り替えることなどにより,実時間で動画像を符号化できるようにした処理時間適応画像符号化方法に関するものである。
【0002】
【従来の技術】
動画像符号化では,一般的に符号化効率向上のために動き補償フレーム間予測符号化方法が用いられる。この方法は,現フレームの原画像と,それ以前に符号化された他のフレームの復号画像から作られる参照画像との間で,対応する画素間の画像情報の差分(予測誤差と呼ぶ)を符号化する。参照画像の作成には,過去や未来のフレームを使う方法や,過去や未来のフレームをアフィン変換して作成する方法がある。
【0003】
また,予測誤差の符号化では,まず予測誤差について離散コサイン変換(DCT)などの周波数変換を行い,その係数を量子化した後に可変長符号化する。画面内の同じ位置での画素間の予測誤差よりも平行移動した位置の予測誤差の方が小さい場合には,符号化効率を向上するために,平行移動した位置の予測誤差を符号化する。平行移動量は動きベクトルとして符号化される。
【0004】
一般的には,画面を小領域に,例えば縦横16画素のマクロブロックで区切り,その小領域毎に動きベクトルを設定する。例えば,マクロブロック内の画素に対して動きベクトルだけ同様に平行移動した位置の画素を設定し,これらの画素間の予測誤差をDCTする。また,小領域内の各画素に対して同じ動きベクトルを設定するのではなく,隣接小領域の動きベクトルを使い,個々の画素の平行移動量を計算で求める方法もある。
【0005】
参考文献:G.J.Sullivan and R.L.Baker:"Motion Compensation for video compression using contorol grid interpolation",IEEE ICA SSP '91, pp.2713-2716,1991。
【0006】
また,平行移動量が整数ではない場合には,参照画像内で対応する位置に画素がないため,参照画像の周辺画素の画像情報から計算により求める。
【0007】
この平行移動量を求める処理は「動き探索」と呼ばれる。一般的には,画面を縦横16画素のマクロブロックで区切り,そのマクロブロック毎に動きベクトルを求める。マクロブロック内の全画素に対する予測誤差の評価関数としては,マクロブロック内のすべての画素の画像情報の絶対値差分の和や分散等が用いられる。これらの値が小さい位置の動きベクトルを選択すると予測誤差の符号化効率が高くなるため,これらの値が最も小さくなる位置を求める。
【0008】
また,探索範囲を大きくするほど,動きベクトルの候補が増えるため符号化効率の高い動きベクトルを求めることができる。映像符号化方式H.263では,動きベクトルの表現上の制限により探索範囲は最大で縦横16画素ずれた位置になる。この様子を図1に示す。この探索範囲内を1画素ずつずらしながら,絶対値差分和や分散を計算し,これらの値が最小となる位置を求める。
【0009】
しかし,探索範囲を大きくするほど,動き探索の演算量が増える。動き探索の演算量を減らすために様々な手法が用いられている。以下に例を3つ挙げる。
【0010】
[方法1]:絶対値差分和や分散を計算する画素数を少なくする。例えば,マクロブロック内の縦横16画素(合計256画素)のうち,64画素で計算する。マクロブロック内で64画素を選択した例を図2に示す。図2において,黒丸で示した画素を選択すると,64画素の計算となる。
【0011】
[方法2]:探索範囲内で絶対値差分和や分散を計算する位置を少なくする。例えば2画素ずつずらしながら探索する。2画素ずつずらしながら探索する様子を図3に示す。
【0012】
[方法3]:木探索する。例えば,予めある探索位置の候補を決めておき,その位置の周辺のみを探索する。
【0013】
また,動き補償フレーム間予測符号化方法の1つに,カメラのパンニング等の画面全体の動きを計測して,画面全体をアフィン変換して参照画像を作成し,予測誤差を求めるグローバル動き補償方法がある。この際のアフィン変換のパラメータをグローバル動きベクトルと呼び,グローバル動きベクトルを求める処理をグローバル動き探索と呼ぶ。映像符号化方式MPEG−4では,グローバル動き補償と,アフィン変換を使わない動き補償を組み合わせることが可能である。例えば,マクロブロック毎に,グローバル動き補償とアフィン変換を使わない動き補償を選択することができる。符号化効率の高い方を選択することによって,フレーム全体の符号化効率を向上することができる。
【0014】
グローバル動き探索では,画面全体をアフィン変換して画面全体の予測誤差が最も小さくなるアフィン変換パラメータを決定する方法もあるが,マクロブロック毎の動き探索の結果を利用する方法もある。この場合には,各マクロブロックの画面内の位置と動きベクトルから,アフィン変換パラメータを決定して,それをグローバル動きベクトルとする。動き探索の範囲を大きくするほど,予測誤差のより小さいグローバル動きベクトルが求められるが,逆に範囲が大きくなると演算量が大きくなる。
【0015】
【発明が解決しようとする課題】
上記のように,動き探索の探索範囲を大きくすると,演算量が大きくなる。そのため,実時間で動画像を符号化することを目的とした場合,演算量が大きくなると符号化が間に合わず,目的の符号化速度の符号化データを得られない問題が発生する。特に,固定フレームレートの符号化データを出力することを目的とした場合には,1フレームの符号化が実時間でできない場合に,固定フレームレートを維持できない。
【0016】
動画像符号化をハードウェアで実行する場合には,1つの演算命令に対してハードウェアでの演算処理速度が一対一に決まる。したがって,演算量が最大に大きくなった場合にも符号化が実行できるように,予めハードウェアの処理速度を設計すれば,符号化が間に合わない問題は発生しない。
【0017】
他方,ソフトウェアで実行する場合には,演算処理速度が機械に依存するため,1つの演算命令に対して実際の演算処理速度が一対一に決まらない。そのため,演算処理速度の小さい機械上で実行する場合には符号化が間に合わない問題が発生する。また,パーソナルコンピュータ(PC)のように,同じ機械上で他のプログラムが実行される場合がある。この場合には,動画像符号化の最中に他のプログラムが実行されると,機械の演算処理がそのプログラムに割かれるために,符号化を実行できなくなり,結果的に符号化速度が低下する。このように符号化の最中に,符号化のための演算処理が実行されない時間が発生する問題がある。
【0018】
【課題を解決するための手段】
パーソナルコンピュータのような機械の演算処理速度は,CPUのキャッシユへのアクセス速度やメモリへのアクセス速度等にも依存して決まるものであるが,主にプログラム中の演算命令を実行するCPUの処理速度に依存する。また,実際に演算を行うのはCPUであるため,1つの演算命令に対するCPUの命令処理回数が,機械の演算処理速度となる。すなわち,1つの演算命令に対するCPUの命令処理回数をCPUの動作周波数で除算した結果が,その機械上における1つの演算命令の処理時間となる。したがって,例えば1フレームを符号化する処理時間を求めるには,符号化を行っている間のCPUの命令処理回数を計測し,それをCPUの動作周波数で除算すればよい。同様に,動き探索処理を実行する処理時間は,それを行っている間のCPUの命令処理回数を計測すれば求めることができる。
【0019】
このように,CPUの命令処理回数から処理時間を計測することができる。また,本来CPUが実行するべき符号化処理に必要な命令処理回数は,プログラムの構成にのみ依存する。そのため,例えば動き探索処理のように1フレーム符号化するために必要な処理命令数が固定な処理の場合では,必要な命令処理回数を実行前に予め求めておくことが可能である。予測誤差の符号化では,フレーム毎にDCTの演算回数が異なる等で処理命令数が異なる。
【0020】
ただし,上記課題においても述べた通り,符号化の最中に他のプログラムが実行される場合もある。CPUは時分割で動作するため,他のプログラムが実行されている間はCPUは符号化処理を行わない。したがって,符号化を行っている間のCPUの命令処理回数には,他のプログラムを実行するための命令も含まれる。これが,符号化の最中に他のプログラムが実行されると符号化速度が低下する原因となる。
【0021】
本発明は,上記の課題を解決するため,探索精度を切り替えることなどにより,動きベクトル探索やグローバル動きベクトル探索に要する処理命令数を変更することを特徴とする。具体的には,以下の方法を用いる。
【0022】
第1の発明では,演算器で動き探索を行い,動き補償フレーム間予測符号化方式を用いて動画像を符号化する動画像符号化方法において,符号化前に予め定められたフレームレートから1フレームを符号化する時間である符号化目標時間を設定し,符号化前に予め設定した動き探索方法に対して,演算器で実行する動き探索の処理命令数である動き探索命令数情報を記憶しておき,符号化時に各フレームの符号化時間を計測し,1フレーム符号化終了後に,前記設定した符号化目標時間と前記計測した符号化時間とから,次のフレームの動き探索を行うための動き探索目標時間を設定し,前記記憶しておいた動き探索命令数情報に従って,動き探索目標時間から動き探索方法を決定して動き探索処理を制御する。
前記動き探索目標時間の設定では,1フレーム符号化終了後に,計測された符号化時間と前記記憶しておいた動き探索命令数情報とから,動き探索以外の処理の時間を推定し,1フレームの符号化目標時間から動き探索以外の処理の時間を引き,さらに前のフレームの符号化にて遅延が生じている場合にその遅延時間を引いた値を,次のフレームの動き探索を行うための動き探索目標時間として設定する。なお,以降に説明する発明においても,同様に遅延時間を考慮し,前のフレームの符号化にて遅延が生じている場合には,動き探索目標時間から遅延時間を差し引くことを行う。
【0023】
ここで,動き探索命令数情報とは,実質的に命令数に相当する情報であればよく,例えば時間に換算した値のような情報でもよい。以降に述べる発明でも同様である。
【0024】
この第1の発明によれば,符号化前に予め設定した各動き探索方法に対して,演算器で実行する動き探索の処理命令数を求めておくので,動き探索時間が設定されたときに,その時間に実行される処理命令数を求めて動き探索方法を決定することができる。
【0025】
例えば,次の2種類の動き探索を予め設定しているとする。
【0026】
[方法A]:マクロブロック内の全画素に対して絶対値差分和を求める。探索範囲内で1画素ずつずらして絶対値差分和を求め,絶対値差分和が最も小さい位置の平行移動量を動きベクトルとする。
【0027】
[方法B]:マクロブロック内の全画素に対して絶対値差分和を求める。探索範囲内で2画素ずつずらして絶対値差分和を求め,絶対値差分和が最も小さい位置の平行移動量を動きベクトルとする。
【0028】
符号化前に,予め方法Aと方法Bで動き探索を行った場合に,演算器で実行する命令数を求めておく。この結果,方法Aが10命令で方法Bが5命令であるとする。その後で,演算器を備えた符号化器で符号化する際に動き探索時間が設定され,これが演算器で7命令分であったとする。この場合,方法Aでは7命令内で動き探索を完了できないが,方法Bでは7命令内で完了できる。従っで,方法Bを選択し動き探索を実行すれば,実時間で符号化できることになる。
【0029】
第2の発明では,演算器で動き探索を行い,動き補償フレーム間予測符号化方式を用いて動画像を符号化する動画像符号化方法において,符号化前に予め定められたフレームレートから1フレームを符号化する時間である符号化目標時間を設定し,符号化前に予め設定した動き探索方法に対して,演算器で実行する動き探索の処理命令数である動き探索命令数情報を記憶しておき,符号化時に各フレームの符号化時間を計測し,1フレーム符号化終了後に,前記設定した符号化目標時間と前記計測した符号化時間とから,次のフレームの動き探索を行うための動き探索目標時間を設定し,前記記憶しておいた動き探索命令数情報に従って,動き探索目標時間から動き探索方法を決定し動き探索処理を制御し,その動き探索処理の実行時間を計測し,実際に計測された動き探索時間から,前記記憶しておいた動き探索命令数情報を更新する。
【0030】
この第2の発明によれば,第1の発明において符号化前に予め設定しておいた動き探索の処理命令数を,実際に動き探索を実行する符号化器で処理した命令数で更新することができる。この方法は,符号化前に予め正確な処理命令数を求めることができない場合に好適である。例えば,処理速度の異なる演算器を組み合わせて符号化器を構成する場合においては,符号化器の総合的な処理速度が分からないが,実際に数フレーム符号化して動き探索に必要な処理時間を求め,命令数を求めることができる。また,CPUのような汎用的な演算器で符号化処理を行う場合には,定期的に他のプログラムがCPUを使う場合があるため,実際の符号化にかかる処理時間がわからない。しかし,本発明によれば,実際に符号化して動き探索に必要な処理時間を求め,命令数を求めることができる。
【0031】
第3の発明では,演算器で動き探索とグローバル動き探索を行い,動き補償フレーム間予測符号化方式を用いて動画像を符号化する動画像符号化方法において,符号化前に予め定められたフレームレートから1フレームを符号化する時間である符号化目標時間を設定し,符号化前に予め設定した動き探索方法に対して,演算器で実行する動き探索の処理命令数である動き探索命令数情報を記憶しておき,また符号化前に予め設定したグローバル動き探索方法に対して,演算器で実行する動き探索の処理命令数であるグローバル動き探索命令数情報を記憶しておき,符号化時に各フレームの符号化時間を計測し,1フレーム符号化終了後に,前記設定した符号化目標時間と前記計測した符号化時間とから,次のフレームの動き探索とグローバル動き探索を行うための動き探索目標時間を設定し,動き探索目標時間から,前記記憶しておいた動き探索命令数情報とグローバル動き探索命令数情報に従って,動き探索方法とグローバル動き探索方法を決定し,動き探索処理とグローバル動き探索処理を制御する。
【0032】
この第3の発明によれば,動き探索の他にグローバル動き探索を行う場合にも,第1の発明と同様に,動き探索を目標時間内に実行できるように,動き探索方法とグローバル動き探索方法を決定することができる。
【0033】
第4の発明では,演算器で動き探索とグローバル動き探索を行い,動き補償フレーム間予測符号化方式を用いて動画像を符号化する動画像符号化方法において,符号化前に予め定められたフレームレートから1フレームを符号化する時間である符号化目標時間を設定し,符号化前に予め設定した動き探索方法に対して,演算器で実行する動き探索の処理命令数である動き探索命令数情報を記憶しておき,また符号化前に予め設定したグローバル動き探索方法に対して,演算器で実行する動き探索の処理命令数であるグローバル動き探索命令数情報を記憶しておき,符号化時に各フレームの符号化時間を計測し,1フレーム符号化終了後に,前記設定した符号化目標時間と前記計測した符号化時間とから,次のフレームの動き探索とグローバル動き探索を行うための動き探索目標時間を設定し,動き探索目標時間から,前記記憶しておいた動き探索命令数情報とグローバル動き探索命令数情報とに従って,動き探索方法とグローバル動き探索方法を決定し,動き探索処理とグローバル動き探索処理を制御し,その動き探索処理の実行時間を計測し,実際に計測された動き探索時間から,前記記憶しておいた動き探索命令数情報を更新し,またグローバル動き探索処理の実行時間を計測し,実際に計測されたグローバル動き探索時間から,前記記憶しておいたグローバル動き探索命令数情報を更新する。
【0034】
この第4の発明によれば,動き探索の他にグローバル動き探索を行う場合にも,第2の発明と同様に,実際に符号化して動き探索に必要な処理時間を求め,動き探索に必要な命令数を求めることができる。
【0035】
第5の発明では,演算器で画面内を分割した領域毎にブロック動き探索を行い,動き補償フレーム間予測符号化方式を用いて動画像を符号化する動画像符号化方法において,符号化前に予め定められたフレームレートから1フレームを符号化する時間である符号化目標時間を設定し,符号化前に予め設定した動き探索方法に対して,演算器で実行する動き探索の処理命令数である動き探索命令数情報を記憶しておき,符号化時に各フレームの符号化時間を計測し,1フレーム符号化終了後に,前記設定した符号化目標時間と前記計測した符号化時間とから,次のフレームの動き探索を行うための動き探索目標時間を設定し,ブロック動き探索処理で実行される領域毎の動き探索時間を計測し,その計測したブロック毎の動き探索時間を,フレーム単位で合計したフレーム動き探索時間を求め,前記記憶しておいた動き探索命令数情報に従って,動き探索目標時間とフレーム動き探索時間から動き探索方法を決定して動き探索処理を制御する。
【0036】
この第5の発明によれば,領域毎に動き探索を実行して動き探索時間を計測し,その時間の合計値と動き探索目標時間を比較することができる。これは,符号化最中に実際に符号化器が処理した動き探索の命令数が,符号化前に予め設定しておいた動き探索の処理命令数と異なる場合に好適である。例えば,動き探索時間の合計値が目標時間よりも大きくなった場合には,そのフレームの動き探索を強制終了させることができる。領域としてはマクロブロックや,マクロブロックの集合であるスライスを適用することができる。強制終了した場合に探索できなかった領域には,0ベクトル(静止)や,前フレームの同じ位置の動きベクトルや,周囲の領域の動きベクトルを,その領域の動きベクトルとして使用することもできる。
【0037】
第6の発明では,演算器で画面内を分割した領域毎にブロック動き探索とグローバル動き探索を行い,動き補償フレーム間予測符号化方式を用いて動画像を符号化する動画像符号化方法において,符号化前に予め定められたフレームレートから1フレームを符号化する時間である符号化目標時間を設定し,符号化前に予め設定した動き探索方法に対して,演算器で実行する動き探索の処理命令数である動き探索命令数情報を記憶しておき,また符号化前に予め設定したグローバル動き探索方法に対して,演算器で実行する動き探索の処理命令数であるグローバル動き探索命令数情報を記憶しておき,符号化時に各フレームの符号化時間を計測し,1フレーム符号化終了後に,前記設定した符号化目標時間と前記計測した符号化時間とから,次のフレームの動き探索を行うための動き探索目標時間であるローカル動き探索目標時間と,グローバル動き探索を行うための動き探索目標時間であるグローバル動き探索目標時間を設定し,ブロック動き探索処理で実行される領域毎の動き探索時間を計測し,その計測したブロック毎の動き探索時間を,フレーム単位で合計したフレーム動き探索時間を求め,グローバルブロック動き探索処理で実行される領域毎の動き探索時間を計測し,その計測したブロック毎の動き探索時間を,フレーム単位で合計したフレームグローバル動き探索時間を求め,前記記憶しておいた動き探索命令数情報に従って,ローカル動き探索目標時間とフレーム動き探索時間とから動き探索方法を決定して動き探索処理を制御し,また前記記憶しておいたグローバル動き探索命令数情報に従って,グローバル動き探索目標時間とフレームグローバル動き探索時間とからグローバル動き探索方法を決定し,グローバル動き探索処理を制御する。
【0038】
第6の発明によれば,動き探索の他にグローバル動き探索を行う場合にも,第5の発明と同様に,例えば,符号化最中に実際に符号化器が処理した動き探索やグローバル動き探索の命令数が,符号化前に予め設定しておいた動き探索やグローバル動き探索の処理命令数と異なる場合に,動き探索時間とグローバル動き探索の合計値が目標時間よりも大きくなった場合には,そのフレームの動き探索やグローバル動き探索を強制終了させることができる。
【0039】
第7の発明では,演算器で画面内を分割した領域毎にブロック動き探索を行い,動き補償フレーム間予測符号化方式を用いて動画像を符号化する動画像符号化方法において,符号化前に予め定められたフレームレートから1フレームを符号化する時間である符号化目標時間を設定し,符号化前に予め設定した動き探索方法に対して,演算器で実行する動き探索の処理命令数である動き探索命令数情報を記憶しておき,入力画像の画像情報から,画面内の各領域の画像統計情報を検出し,検出した画像統計情報から,動き探索する領域の順序を決定し,1フレームの符号化時間を計測し,1フレーム符号化終了後に,前記設定した符号化目標時間と前記計測した符号化時間とから,次のフレームの動き探索を行うための動き探索目標時間を設定し,ブロック動き探索処理で実行される領域毎の動き探索時間を計測し,その計測したブロック毎の動き探索時間をフレーム単位で合計したフレーム動き探索時間を求め,前記記憶しておいた動き探索命令数情報に従って,動き探索目標時間とフレーム動き探索時間とから動き探索方法を決定し動き探索処理を制御する。
【0040】
この第7の発明によれば,第5の発明のようにフレーム内の途中で動き探索を終了する場合において,動き探索をする前に予め,各領域に対して動き探索の順序を設定することが可能である。これは,例えば動き探索をする前に,画面内の各領域が動領域かどうかを測定して,動領域を静止領域よりも先に動き探索処理することが可能となる。動き探索の前に静止領域と判断された領域の動き探索で,動き探索時間の合計値が目標時間よりも大きくなり,そのフレームの動き探索を強制終了したとしても,静止領域であるため,その領域の動きベクトルを0ベクトルとすることができる。これにより,実際に動きベクトルを求めた場合からの符号化効率の低下を軽減できる。
【0041】
第8の発明では,演算器で画面内を分割した領域毎にブロック動き探索とグローバル動き探索を行い,動き補償フレーム間予測符号化方式を用いて動画像を符号化する動画像符号化方法において,符号化前に予め定められたフレームレートから1フレームを符号化する時間である符号化目標時間を設定し,符号化前に予め設定した動き探索方法に対して,演算器で実行する動き探索の処理命令数である動き探索命令数情報を記憶しておき,また符号化前に予め設定したグローバル動き探索方法に対して,演算器で実行する動き探索の処理命令数であるグローバル動き探索命令数情報を記憶しておき,入力画像の画像情報から,画面内の各領域の画像統計情報を検出し,その検出した画像統計情報から,動き探索する領域の順序を決定し,1フレームの符号化時間を計測し,1フレーム符号化終了後に,前記設定した符号化目標時間と前記計測した符号化時間とから,次のフレームの動き探索を行うための動き探索目標時間であるローカル動き探索目標時間と,グローバル動き探索を行うための動き探索目標時間であるグローバル動き探索目標時間を設定し,ブロック動き探索処理で実行される領域毎の動き探索時間を計測し,その計測したブロック毎の動き探索時間をフレーム単位で合計したフレーム動き探索時間を求め,グローバルブロック動き探索処理で実行される領域毎の動き探索時間を計測し,その計測したブロック毎の動き探索時間をフレーム単位で合計したフレームグローバル動き探索時間を求め,前記記憶しておいた動き探索命令数情報に従って,ローカル動き探索目標時間とフレーム動き探索時間とから動き探索方法を決定し,動き探索処理を制御し,前記記憶しておいたグローバル動き探索命令数情報に従って,グローバル動き探索目標時間とフレームグローバル動き探索時間からグローバル動き探索方法を決定し,グローバル動き探索処理を制御する。
【0042】
この第8の発明によれば,第7の発明と同様に,動き探索をする前に,予め各領域に対して動き探索の順序を設定することにより,フレーム途中で動き探索を強制終了する際の符号化効率の低下を軽減できる。さらに,動き探索をする前に,予め各領域に対して動き探索をするかどうかを決定しておき,符号化の最中ではその領域のみ動き探索をし,グローバル動き探索に割り当てる時間を多くすることが可能である。例えば,動き探索をする前に,予め各領域が動領域か静止領域かを判定しておき,動領域のみ動き探索をして,静止領域は動き探索をしない。これにより,静止領域の動き探索のための時間をグローバル動き探索に割り当てることができる。
【0043】
以上の処理方法をコンピュータによって実現するためのソフトウェアプログラムは,コンピュータが読み取り可能な可搬媒体メモリ,半導体メモリ,ハードディスクなどの適当な記録媒体に格納することができる。
【0044】
【発明の実施の形態】
以下,本発明の実施の形態を図面を参照して説明する。
【0045】
第1の実施例では,符号化前に予め,各動き探索方法に対する処理命令数と,各グローバル動き探索方法に対する処理命令数を設定しておき,この値に従って,実時間で動画像を符号化する仕組みを述べる。
【0046】
動作周波数500MHzのCPUを搭載したコンピュータ上で,画面の大きさがCIF(横352画素,縦288画素)の動画像をフレームレートが毎秒10フレームで符号化する場合の動作を示す。
【0047】
動き探索方法としては下記の方法Aと方法Bと方法Cを用意する。画面内のマクロブロックに対してすべて同じ方法を適用する。
【0048】
[方法A]:マクロブロック内の全画素に対して絶対値差分和を求める。探索範囲は縦16画素・横16画素とする。探索範囲内で1画素ずつずらして絶対値差分和を求め,絶対値差分和が最も小さい位置の平行移動量を動きベクトルとする。
【0049】
[方法B]:マクロブロック内の全画素に対して絶対値差分和を求める。探索範囲は縦16画素・横16画素とする。探索範囲内で2画素ずつずらして絶対値差分和を求め,絶対値差分和が最も小さい位置の平行移動量を動きベクトルとする。
【0050】
[方法C]:すべてのマクロブロックの動きベクトルを0ベクトルとする。
【0051】
方法Aの動き探索の命令数は1000万で,方法Bの動き探索の命令数は500万で,方法Cの命令数は1万であるとする。
【0052】
また,グローバル動き探索方法としては,まずどちらも画面を縦8画素・横8画素のブロックに分割し,そのブロック単位に動き探索をする。全ブロックの動き探索が終わった後で,動きベクトルに対するブロック数を集計し,最もブロック数が多い動きベクトルをグローバル動きベクトルとする。ブロック単位の動き探索には,下記の方法Dと方法Eと方法Fを用意する。画面内のブロックに対してすべて同じ方法を適用する。
【0053】
[方法D]:ブロック内の全画素に対して絶対値差分和を求める。探索範囲は縦32画素・横32画素とする。探索範囲内で1画素ずつずらして絶対値差分和を求め,絶対値差分和が最も小さい位置の平行移動量を動きベクトルとする。
【0054】
[方法E]:ブロック内の全画素に対して絶対値差分和を求める。探索範囲は縦32画素・横32画素とする。探索範囲内で2画素ずつすらして絶対値差分和を求め,絶対値差分和が最も小さい位置の平行移動量を動きベクトルとする。
【0055】
[方法F]:すべてのブロックの動きベクトルを0ベクトルとする。
【0056】
方法Dを採用した場合のグローバル動き探索の命令数は3000万で,方法Eを採用した場合のグローバル動き探索の命令数は1500万で,方法Fを採用した場合のグローバル動き探索の命令数は1万であるとする。
【0057】
図4に,第1の実施例における符号化方法の処理手順を示す。なお,図4に示す各ブロックに表記した「部」は「手順」と読み替えることができる。他の実施例も同様である。
【0058】
図4の動き探索制御部(動き探索制御手順)106では,予め設定された方法Aまたは方法Bまたは方法Cの中からいずれかを,また,方法Dまたは方法Eまたは方法Fの中からいずれかを選択する。
【0059】
選択するフローを図5に示す。動き探索目標時間をtarget_me_timeとし,方法Aから方法Fまでの命令数を時間に変換した値を,me_time[i](i=1:方法A,i=2:方法B,i=3:方法C,1=4:方法D,i=5:方法E,i=6:方法F)とする。以下の選択を行う。
【0060】
me_time[1]とme_time[4]の和が,動き探索目標時間(target_me_time)より小さい場合,方法Aと方法Dを選択する(ステップS10)。
【0061】
me_time[1]とme_time[5]の和が,動き探索目標時間(target_me_time)より小さい場合,方法Aと方法Eを選択する(ステップS11)。
【0062】
me_time[1]とme_time[6]の和が,動き探索目標時間(target_me_time)より小さい場合,方法Aと方法Fを選択する(ステップS12)。
【0063】
me_time[2]とme_time[6]の和が,動き探索目標時間(target_me_time)より小さい場合,方法Bと方法Fを選択する(ステップS13)。
【0064】
me_time[3]とme_time[6]の和が,動き探索目標時間(target_me_time)より小さい場合,方法Cと方法Fを選択する(ステップS14)。
【0065】
以上のように,いずれの組み合わせを選択した場合にも,動き探索とグローバル動き探索が動き探索目標時間以内に処理されるように選択する。方法Cと方法Fを選択した場合に動き探索目標時間以内とならない場合(ステップS14でNOの場合)には,そのフレームを符号化せずに,次のフレームを符号化開始するものとする。この場合,動き探索目標時間には,1フレーム符号化するための符号化目標時間が加算される。
【0066】
まず,符号化開始前に目標時間設定部101にて,フレームレートが毎秒10フレームであることから,符号化目標時間として100msecを設定する。また,動きパラメータ記憶部102にて方法Aから方法Cまでの処理命令数を記憶し,グローバル動きパラメータ記憶部103にて方法Dから方法Fまでの処理命令数を記憶する。
【0067】
本実施例では,処理命令数に対応する実際の時間は以下の通りとなる。
【0068】

Figure 0003670566
続いて,符号化を開始後のJ番目とJ+1番目のフレームの符号化手順を説明する。J−1番目のフレームでは符号化目標時間に符号化が間に合わず,J番目のフレームでは符号化目標時間に符号化が間に合ったとする。前提として,J−1番目のフレームに対して動き探索に方法Aを使い,グローバル動き探索に方法Dを使って,符号化時間計測部104において計測した符号化時間が110msecであったとする。すなわち,10msecの遅延が発生している。
【0069】
この状況において,まず動き探索時間設定部105にて,J番目のフレームに対する動き探索目標時間を求める。方法Aと方法Dを使って符号化時間が110msecであったことから,動き探索以外の処理の時間は,
110msec−(方法Aの時間+方法Dの時間)=110msec−(20msec+60msec)=30msec
と計算できる。
【0070】
次のフレームで10msecの遅延から回復することを踏まえ,動き探索目標時間target_me_timeは,
100msec−(遅延時間)−(動き探索以外の時間)=100msec−10msec−30msec=60msec
と設定する。動き探索制御部106では,図5の選択フローに従って,方法Aと方法Eを選択する。
【0071】
画像入力部107にて,1フレーム分の画像情報を取得する。動き探索部108では,方法Aで動き探索を行い,グローバル動き探索部109では,方法Eでグローバル動き探索を行う。フレーム間予測符号化部110では,動き探索部108で求められた動きベクトルとグローバル動き探索部109で求められたグローバル動きベクトルを用いてJ番目のフレームの画像情報を符号化する。局所復号部111では,符号化データを復号する。符号化時間計測部104は,J番目のフレームの符号化時間を計測する。符号化時間は55msecであったとする。
【0072】
この場合,J−1番目のフレームにて発生した10msecの遅延がなくなり,実時間で符号化できていることになる。このように,前フレームで実時間に符号化できない場合であっても,次のフレームの動き探索時間を調整することにより,次のフレームで遅延を解消することができる。
【0073】
続いて,動き探索時間設定部105にて,J+1番目のフレームに対する動き探索目標時間を求める。方法Aと方法Eを使って符号化時間が55msecであったことから,動き探索以外の処理の時間は,
55msec−(方法Aの時間+方法Eの時間)=50msec−(20msec+30msec)=5msec
と計算できる。そのため動き探索目標時間target_me_timeは,
100msec−(動き探索以外の時間)=100msec−5msec=95msec
と設定する。動き探索制御部106では,図5の選択フローに従って,方法Aと方法Dを選択する。
【0074】
画像入力部107にて,1フレーム分の画像情報を取得する。動き探索部108では,方法Aで動き探索を行い,グローバル動き探索部109では,方法Dでグローバル動き探索を行う。フレーム間予測符号化部110では,動き探索部108で求められた動きベクトルとグローバル動き探索部109で求められたグローバル動きベクトルを用いてJ番目のフレームの画像情報を符号化する。局所復号部111では,符号化データを復号する。符号化時間計測部104は,J+1番目のフレームの符号化時間を計測する。
【0075】
このように前フレームの符号化時間が符号化目標時間以内であった場合には,次のフレームの動き探索処理時間を多くすることにより,前フレームよりも符号化効率を上げることが可能である。
【0076】
第1の実施例のように,符号化前に予め,各動き探索方法に対する処理命令数と,各グローバル動き探索方法に対する処理命令数を設定しておき,この値に従って動き探索処理やグローバル動き探索処理を変更することにより,実時間で動画像を符号化できる。
【0077】
なお,第1の実施例では,動きベクトル探索とグローバル動き探索の処理命令数を変更する方法として,探索範囲内で1画素ずつずらす方法(方法Aと方法D),探索範囲内で2画素ずつずらす方法(方法Bと方法E),動きベクトルが0ベクトルの場合のみ計算する方法(方法Cと方法F)を示したが,3画素もしくはそれ以上の画素数ずらすことにより処理命令数をさらに削減することも可能である。また,動きベクトルの探索範囲が縦16画素・横16画素,グローバル動き探索の探索範囲が縦32画素・横32画素の場合のみ示したが,探索範囲を拡大または縮小することにより処理命令数を変更することも可能である。以下に示す第2〜第4の実施例でも同様である。
【0078】
また,グローバル動き探索を用いない場合には,図4に示す第1の実施例において,グローバル動きパラメータ記憶部103の処理およびグローバル動き探索部109の処理を省略した手順になることは説明するまでもない。以下に示す他の実施例においても同様である。
【0079】
第2の実施例では,符号化前に予め,各動き探索方法に対する処理命令数と,各グローバル動き探索方法に対する処理命令数とを設定しておき,この値に従って動画像を符号化し,符号化途中でこれらの処理命令数を変更する仕組みを述べる。
【0080】
動作周波数500MHzのCPUを搭載したコンピュータ上で,画面の大きさがCIF(横352画素,縦288画素)の動画像をフレームレートが毎秒10フレームで符号化する場合の動作を示す。
【0081】
動き探索方法には,第1の実施例と同じく方法Aと方法Bと方法Cを用意し,グローバル動き探索方法には,第1の実施例と同じく方法Dと方法Eと方法Fを用意する。動き探索方法とグローバル動き探索方法は,画面内のマクロブロックに対してすべで同じ方法を適用する。
【0082】
図6に,第2の実施例における符号化方法の処理手順を示す。ここで,動き探索制御部206にて,動き予測方法とグローバル動き探索方法の選択フローは,第1の実施例と同じく図5とする。
【0083】
符号化を開始後のJ番目とJ+1番目のフレームの符号化手順を説明する。J−1番目のフレームでは,符号化目標時間に符号化が間に合わず,J番目のフレームでは,符号化目標時間に符号化が間に合った場合を示す。前提として,J−1番目のフレームに対して,動き探索に方法Aを使い,グローバル動き探索に方法Dを使って,符号化時間計測部204において計測した符号化時間が120msecであったとする。すなわち20msecの遅延が発生している。
【0084】
また,動き探索時間計測部212にて計測された動き探索時間は40msecであり,グローバル動き探索時間計測部214にて計測されたグローバル動き探索時間は60msecであるとする。
【0085】
また,動きパラメータ記憶部202にて記憶している各方法の命令数は,方法Aは1000万で,方法Bは500万で,方法Cは1万であるとする。グローバル動きパラメータ記憶部203にて記憶している各方法の命令数は,方法Dは3000万で,方法Eは1500万で,方法Fは1万であるとする。
【0086】
この状況において,まずJ番目のフレームに対する動き探索命令数とグローバル動き探索命令数の更新を行う。動きパラメータ更新部213にて,方法Aの命令数を40msec*500MHz=2000万に,グローバル動きパラメータ更新部215にて,方法Dの命令数を
60msec*500MHz=3000万
に更新する。
【0087】
したがって,処理命令数に対応する実際の時間は以下の通りとなる。
【0088】
Figure 0003670566
続いて動き探索時間設定部205にて,J番目のフレームに対する動き探索目標時間を求める。方法Aと方法Dを使って符号化時間が120msecであったことから,動き探索以外の処理の時間は,
Figure 0003670566
と計算できる。
【0089】
次のフレームで20msecの遅延から回復することを踏まえ,動き探索目標時間target_me_timeは,
Figure 0003670566
と設定する。動き探索制御部206では,図5のフローに従って,方法Aと方法Fを選択する。
【0090】
画像入力部207にて,1フレーム分の画像情報を取得する。動き探索部208では方法Aで動き探索を行い,グローバル動き探索部209では方法Fでグローバル動き探索を行う。フレーム間予測符号化部210では,動き探索部208で求められた動きベクトルとグローバル動き探索部209で求められたグローバル動きベクトルを用いてJ番目のフレームの画像情報を符号化する。局所復号部211では,符号化データを復号する。符号化時間計測部204では,J番目のフレームの符号化時間を計測する。符号化時間は55msecであったとする。また,動き探索時間計測部212にて計測された動き探索時間は40msecであり,グローバル動き探索時間計測部214にて計測されたグローバル動き探索時間は0.1msecであるとする。
【0091】
この状況において,まずJ+1番目のフレームに対する動き探索命令数とグローバル動き探索命令数の更新を行う。動きパラメータ更新部213にて,方法Aの命令数を40msec*500MHz=2000万に,グローバル動きパラメータ更新部215にて,方法Fの命令数を
0.1msec*500MHz=5万
に更新する。
【0092】
したがって,処理命令数に対応する実際の時間は以下の通りとなる。
【0093】
Figure 0003670566
続いて動き探索時間設定部205にて,J+1番目のフレームに対する動き探索目標時間を求める。方法Aと方法Fを使って符号化時間が55msecであったことから,動き探索以外の処理の時間は,
Figure 0003670566
と計算することができる。そのため,動き探索目標時間target_me_timeは,
Figure 0003670566
と設定する。動き探索制御部206では,図5のフローに従って,方法Aと方法Eを選択する。
【0094】
画像入力部207にて,1フレーム分の画像情報を取得する。動き探索部208では,方法Aで動き探索を行い,グローバル動き探索部209では,方法Eでグローバル動き探索を行う。フレーム間予測符号化部210では,動き探索部208で求められた動きベクトルとグローバル動き探索部209で求められたグローバル動きベクトルを用いてJ+1番目のフレームの画像情報を符号化する。局所復号部211では,符号化データを復号する。符号化時間計測部204は,J+1番目のフレームの符号化時間を計測する。
【0095】
このように第2の実施例では,前フレームの符号化から,その演算器における動き探索命令数とグローバル動き探索命令数を求めて更新することにより,その演算器の演算処理速度に応じた動き探索方法とグローバル動き探索方法の選択をすることができる。
【0096】
また第2の実施例において,動き探索部208の処理を実行した後に,動き探索時間計測部212で動き探索時間を計測して,この時間も使って再度グローバル動き探索を実行する際の動き探索目標時間を再設定する方法も好適である。例えば,J+1番目のフレームにおける動き探索時間が20msecであったとすると,J+1番目のフレームのグローバル動き探索のための動き探索目標時間を,
target_me_time=85.1msec−20msec=65.1msec
と設定する。この情報に基づいて,再度グローバル動き探索方法を決定する。この選択フローを図7に示す。この選択フローに従って方法Dを選択して(ステップS20),グローバル動き探索を行う。グローバル動きベクトルを求めた後の動作は図6の処理手順と同じである。
【0097】
図7の選択フローでは,target_me_timeがme_time[4]より大きい場合に(ステップS20),方法Dを選択し,target_me_timeがme_time[4]以下で,かつme_time[5]より大きい場合には(ステップS21),方法Eを選択する。さらに,target_me_timeがme_time[5]以下で,かつme_time[6]より大きい場合には(ステップS22),方法Fを選択し,me_time[6]以下であればグローバル動き補償は行わない。
【0098】
このように,動き探索後にグローバル動き探索のための動き探索目標時間を再設定することにより,予測誤差のより少ないグローバル動きベクトルを求めることも可能となる。
【0099】
第3の実施例では,符号化前に予め,各動き探索方法に対する処理命令数を設定しておき,この値に従って,実時間で動画像を符号化する仕組みを述べる。ただし,第1の実施例と異なり,動き探索時間をマクロブロック単位に計測して動き探索を制御する。また符号化前に予めマクロブロック毎に動き探索の優先順位を決定する。以下の例では,動き探索目標時間以内にすべてのマクロブロックに対して動き探索を実行できない場合に,強制終了する動作例を示す。
【0100】
動作周波数500MHzのCPUを搭載したコンピュータ上で,画面の大きさがCIF(横352画素,縦288画素)の動画像をフレームレートが毎秒10フレームで符号化する場合の動作を示す。
【0101】
動き探索方法には,第1の実施例に記載の方法Aと方法Bを用意する。方法Aの動き探索の命令数は1000万で,方法Bの動き探索の命令数は500万であるとする。ただし,第1の実施例と異なり,動き探索方法は,画面内のマクロブロックに対して適宜変更する。図8に第3の実施例における符号化方法の処理手順を示す。ここで,動き探索制御部306にて行う動き予測方法の選択フローを図9に示す。
【0102】
ブロック動き探索時間計測部312にて計測されたブロック毎の動き探索時間をフレーム単位で合計し,その合計したフレーム動き探索時間をtotal_me_timeとし,動き探索目標時間をtarget_me_timeとし,方法Aと方法Bまでの命令数を時間に変換した値を,me_time[i](i=1:方法A,i=2:方法B)とする。動き探索をしたマクロブロック数count_MBは,動き探索処理を行った回数をカウントすることにより計測するものとする。画面中のマクロブロック数をtotal_MBとする。
【0103】
また,ブロック優先度検出部316では,画面内のエッジ画素を検出し,マクロブロック毎にエッジ画素数をカウントする。エッジは視覚的な品質を維持するのに重要であるため,画像の品質を向上するために重要である。そのため,エッジ画素を多く含むマクロブロックの符号化効率を向上しておく必要がある。探索ブロック決定部317では,エッジ画素数の多い順番にマクロブロックの番号を並べたリストを作成する。
【0104】
このような手順の構成における本実施例の動作を示す。まず,符号化開始前に目標時間設定部301にて,フレームレートが毎秒10フレームであることから,符号化目標時間として100msecを設定する。また,動きパラメータ記憶部302にて,方法Aと方法Bの処理命令数を記憶する。
【0105】
続いて,符号化を開始後のJ番目のフレームの符号化手順を説明する。前提として,J−1番目のフレームにおける符号化時間計測部304において計測した符号化時間が90msecであったとする。また,total_me_timeは80msecであったとする。
【0106】
この状況において,まず動き探索時間設定部305にて,J番目のフレームに対する動き探索目標時間を求める。符号化時間が90msecであったことから,動き探索以外の処理の時間は,
90msec−80msec=10msec
と計算できる。次のフレームでの動き探索目標時間target_me_timeは,
100msec−(動き探索以外の時間)=100msec−10msec=90msec
と設定する。このため,最初のマクロブロックでは,動き探索方法Aを選択する。
【0107】
画像入力部307にて1フレーム分の画像情報を取得する。ブロック優先度検出部316では,エッジ検出を行い,マクロブロック毎にエッジ画素数をカウントする。探索ブロック決定部317では,エッジ画素の多いマクロブロック順にマクロブロック番号を並べたリストを作成する。ここで作成したリストの例を,図10に示す。ブロック動き探索部308では,図9の選択フローに従って動き探索方法を決定し,図10のリストの順にマクロブロック単位に動き探索をする。
【0108】
動き方法の選択では,図9に示すようにtotal_MBとcount_MBとの差をtotal_MBで割ったものとme_time[1]との積が,target_me_timeとtotal_me_timeとの差より小さい場合に(ステップS30),方法Aを選択する。そうでない場合,total_MBとcount_MBとの差をtotal_MBで割ったものとme_time[2]との積を計算し,それが,target_me_timeとtotal_me_timeとの差より小さい場合(ステップS31),方法Bを選択する。それ以外の場合には,動き探索を中止する。
【0109】
マクロブロック番号200番のマクロブロックを符号化した後で,フレーム動き探索時間が69.9999999msecとなったとすると,図9の選択フローに従って,図10のリストに記載されているマクロブロックのうち,200番より後のマクロブロックについては動き探索を行わない。動き探索を行わないマクロブロックの動きベクトルは0ベクトルとする。
【0110】
フレーム間予測符号化部310では,ブロック動き探索部308で求められた動きベクトルを用いてJ番目のフレームの画像情報を符号化する。局所復号部311では,符号化データを復号する。符号化時間計測部304は,J番目のフレームの符号化時間を計測する。
【0111】
このように,マクロブロック単位に動き探索処理時間を計測することによって,フレーム途中で動き探索処理を終了することが可能である。また,フレーム途中で動き探索を終了する場合であっても,符号化する前に予め各マクロブロックを動き探索する順序を決めておくことにより,エッジ画素を多く含むマクロブロックの符号化効率を向上し,画像品質の劣化を軽減することが可能である。
【0112】
第4の実施例では,符号化前に予め,各動き探索方法に対する処理命令数と,各グローバル動き探索方法に対する処理命令数とを設定しておき,この値に従って,実時間で動画像を符号化する仕組みを述べる。ただし,第1の実施例と異なり,動き探索時間をマクロブロック単位に計測して動き探索を制御し,グローバル動き探索時間をマクロブロック単位に計測してグローバル動き探索を制御する。また,符号化前に予めマクロブロック毎に動き探索とグローバル動き探索の優先順位を決定する。以下の例では,ブロック動き探索部408において,ローカル動き探索目標時間以内にすべてのマクロブロックに対して動き探索を実行できない場合に,強制終了する動作例を示す。
【0113】
動作周波数500MHzのCPUを搭載したコンピュータ上で,画面の大きさがCIF(横352画素,縦288画素)の動画像をフレームレートが毎秒10フレームで符号化する場合の動作を示す。
【0114】
動き探索方法には,第1の実施例と同じく方法Aと方法Bを用意し,グローバル動き探索方法には,第1の実施例と同じく方法Dと方法Eを用意する。方法Aの動き探索の命令数は1000万で,方法Bの動き探索の命令数は500万であるとする。方法Dを採用した場合のグローバル動き探索の命令数は3000万で,方法Eを採用した場合のグローバル動き探索の命令数は1500万であるとする。ただし,第1の実施例と異なり,動き探索方法とグローバル動き探索方法は,画面内のマクロブロックに対して適宜変更する。
【0115】
図11に,第4の実施例における符号化方法の処理手順を示す。動き探索時間設定部405では,動き探索目標時間target_me_timeからローカル動き探索目標時間target_local_me_timeとグローバル動き探索目標時間target_global_me_timeを決定する。方法Aと方法Bの命令数を時間に変換した値を,me_time[i](i=1:方法A,i=2:方法B)とし,方法Dと方法Eの命令数を時間に変換した値を,me_time[i](i=4:方法D,i=5:方法E)とする。次の式に従って求める。
【0116】
target_local_me_time=target_me_time*me_time[1]/(me_time[l]+me_time[4])
target_global_me_time=target_me_time−target_local_me_time
動き探索制御部406における動き予測方法の選択フローを図12に,グローバル動き予測方法の選択フローを図13に示す。
【0117】
ブロック動き探索時間計測部412にて計測されたブロック毎の動き探索時間をフレーム単位で合計し,その合計したフレーム動き探索時間をtotal_local_me_timeとする。動き探索をしたマクロブロック数count_MBは,動き探索処理を行った回数をカウントすることにより計測するものとする。画面中のマクロブロック数をtotal_MBとする。
【0118】
グローバルブロック動き探索時間計測部419にて計測されたブロック毎の動き探索時間をフレーム単位で合計したフレームグローバル動き探索時間をtotal_global_me_timeとする。
【0119】
また,各フレームの画素の画像情報は0〜255までの値を取るものとし,ブロック優先度検出部416では,現フレームの原画像と前フレームの局所復号画像との間で同一位置の画素間の差分の絶対値を求め,差分絶対値が50以上となる画素(ここでは動画素と呼ぶ)の数をマクロブロック毎に計測する。動画素が多いほど,そのマクロブロックは動領域と判定できる。探索ブロック決定部417では,動画素の数の多い順番にマクロブロックの番号を並べたリストを作成する。
【0120】
このような手順の構成における本実施例の動作を示す。まず,符号化開始前に目標時間設定部401にて,フレームレートが毎秒10フレームであることから,符号化目標時間として100msecを設定する。また,動きパラメータ記憶部402にて,方法Aと方法Bの処理命令数を記憶する。
【0121】
続いて,符号化を開始後のJ番目のフレームの符号化手順を説明する。前提として,J−1番目のフレームにおける符号化時間計測部404において計測した符号化時間が100msecであったとする。また,total_local_me_timeは20msecであり,total_g1obal_me_timeは50msecであったとする。
【0122】
この状況において,まず動き探索時間設定部405にて,J番目のフレームに対する動き探索目標時間を求める。符号化時間が100msecであったことから,動き探索以外の処理の時間は,
100msec−20msec−50msec=30msec
と計算できる。次のフレームでの動き探索目標時間target_me_timeは,
100msec−(動き探索以外の時間)=100msec−30msec=70msec
と設定する。これから,ローカル動き探索目標時間target_local_me_timeとグローバル動き探索目標時間target_global_me_timeとを求める。
【0123】
Figure 0003670566
画像入力部407にて1フレーム分の画像情報を取得する。ブロック優先度検出部416では,現フレームの原画像と前フレームの局所復号画像との間の絶対値差分を求め,動画素の数をマクロブロック毎にカウントする。探索ブロック決定部417では,動画素数の多いマクロブロック順にマクロブロック番号を並べたリストを作成する。ここで作成したリストは図10と同じとする。
【0124】
ブロック動き探索部408では,図12の選択フローに従って動き探索方法を決定し,図10のリストの順にマクロブロック単位に動き探索をする。マクロブロック番号100番のマクロブロックを符号化した後で,フレーム動き探索時間が17.49999999msecとなったとすると,図12の選択フローに従って図10のリストに記載されているマクロブロックのうち,100番より後のマクロブロックについては動き探索を行わない。動き探索を行わないマクロブロックの動きベクトルは0ベクトルとする。
【0125】
グローバルブロック動き探索部409では,図13の選択フローに従ってグローバル動き探索方法を決定し,図10のリストの順にマクロブロック単位に動き探索をする。マクロブロック番号50番のマクロブロックを符号化した後で,フレームグローバル動き探索時間が52.49999999msecとなったとすると,図13の選択フローに従って図10のリストに記載されているマクロブロックのうち,50番より後のマクロブロックについては動き探索を行わない。動き探索を行わないマクロブロックの動きベクトルは0ベクトルとする。これらのマクロブロック単位の動きベクトルのうち,最もマクロブロック数の多い動きベクトルをグローバル動きベクトルとする。
【0126】
フレーム間予測符号化部410では,ブロック動き探索部408で求められた動きベクトルとグローバルブロック動き探索部409で求められたグローバル動きベクトルを用いて,J番目のフレームの画像情報を符号化する。局所復号部411では,符号化データを復号する。符号化時間計測部404は,J番目のフレームの符号化時間を計測する。
【0127】
このように,動き探索目標時間からローカル動き探索目標時間とグローバル動き探索目標時間を設定し,マクロブロック単位に動き探索処理時間やグローバル動き探索処理時間を計測することによって,フレーム途中で動き探索処理やグローバル動き探索処理時間を終了することが可能である。
【0128】
また,すべてのマクロブロックに対してブロック動き探索部408が,予め設定したローカル動き探索目標時間以内に終了した場合には,余った時間をグローバル動き探索目標時間に加算することも好適である。例えば,ブロック動き探索時間計測部412で計測されたフレーム動き探索時間が9msecでブロック動き探索部408を終了した場合,グローバル動き探索目標時間target_global_me_timeを
52.5msec+(17.5msec−9msec)=61msec
に設定する。この値に従って図13の選択フローに従ってグローバル動き探索方法を決定する。この場合は最初のマクロブロックに対して方法Dが選択される。その後,図11の手順に従って符号化する。
【0129】
このように,ブロック動き探索処理が目標よりも早く終了した場合には,グローバル動き探索目標時間を再度決定することにより,予測誤差のより少ないグローバル動きベクトルを求めることができる。
【0130】
なお,図12の動き探索の選択フローおよび図13のグローバル動き探索の選択フローに示す選択アルゴリズムは,前述した図9の例と同様であるので,各ステップごとの詳細な説明は省略する。
【0131】
【発明の効果】
本発明によれば,符号化前に予め,各動き探索方法に対する処理命令数と,各グローバル動き探索方法に対する処理命令数を設定しておき,この値に従って動き探索処理やグローバル動き探索処理を変更することにより,実時間で動画像を符号化できる。すなわち,パーソナルコンピュータで符号化する場合のように,他のプログラムが実行される間に符号化処理が停止したり,機種によりCPUの処理速度が異なるため,同一のプログラムでも実行環境により処理時間が異なるような場合にも,動きベクトル探索に要する時間を調節して,実時間で動画像を符号化することができるようになる。
【図面の簡単な説明】
【図1】マクロブロックと探索範囲の関係を示す図である。
【図2】画素の選択方法の例を示す図である。
【図3】探索位置を2画素ずつずらす例を説明する図である。
【図4】第1の実施例の手順を説明する図である。
【図5】第1の実施例における動き探索の選択フローである。
【図6】第2の実施例の手順を説明する図である。
【図7】第2の実施例におけるグローバル動き探索の選択フローである。
【図8】第3の実施例の手順を説明する図である。
【図9】第3の実施例における動き探索の選択フローである。
【図10】動き探索をするマクロブロックの順序の例を示す図である。
【図11】第4の実施例の手順を説明する図である。
【図12】第4の実施例における動き探索の選択フローである。
【図13】第4の実施例におけるグローバル動き探索の選択フローである。
【符号の説明】
101 目標時間設定部
102 動きパラメータ記憶部
103 グローバル動きパラメータ記憶部
104 符号化時間計測部
105 動き探索時間設定部
106 動き探索制御部
107 画像入力部
108 動き探索部
109 グローバル動き探索部
110 フレーム間予測符号化部
111 局所復号部[0001]
[Technical field to which the invention belongs]
The present invention relates to a moving image coding technique, and in particular, a moving image can be coded in real time by switching search accuracy even when the coding processing time varies depending on the execution environment of the coding processing. The present invention relates to a processing time adaptive image coding method.
[0002]
[Prior art]
In moving picture coding, a motion compensation interframe predictive coding method is generally used to improve coding efficiency. This method calculates the difference in image information (referred to as prediction error) between corresponding pixels between the original image of the current frame and a reference image created from a decoded image of another frame encoded before that. Encode. There are two methods for creating a reference image: a method using past and future frames and a method using affine transformation of past and future frames.
[0003]
In encoding the prediction error, first, frequency conversion such as discrete cosine transform (DCT) is performed on the prediction error, the coefficient is quantized, and then variable length coding is performed. If the prediction error at the translated position is smaller than the prediction error between pixels at the same position in the screen, the prediction error at the translated position is encoded in order to improve encoding efficiency. The translation amount is encoded as a motion vector.
[0004]
In general, the screen is divided into small areas, for example, macroblocks of 16 pixels vertically and horizontally, and a motion vector is set for each small area. For example, a pixel at a position that is similarly translated by a motion vector with respect to the pixels in the macroblock is set, and a prediction error between these pixels is DCTed. In addition, there is a method in which the same motion vector is not set for each pixel in the small area, but the translation amount of each pixel is obtained by calculation using the motion vector of the adjacent small area.
[0005]
Reference: G.J. Sullivan and R.L. Baker: "Motion Compensation for video compression using control grid interpolation", IEEE ICA SSP '91, pp. 2713-2716, 1991.
[0006]
Further, when the translation amount is not an integer, there is no pixel at the corresponding position in the reference image, and therefore, it is obtained by calculation from image information of peripheral pixels of the reference image.
[0007]
This process of obtaining the parallel movement amount is called “motion search”. In general, the screen is divided into macroblocks of 16 pixels vertically and horizontally, and a motion vector is obtained for each macroblock. As the evaluation function of the prediction error for all the pixels in the macroblock, the sum or variance of the absolute value differences of the image information of all the pixels in the macroblock is used. When a motion vector at a position where these values are small is selected, the encoding efficiency of the prediction error is increased. Therefore, a position where these values are the smallest is obtained.
[0008]
Further, since the motion vector candidates increase as the search range is increased, a motion vector with high coding efficiency can be obtained. Video coding method In H.263, the search range is shifted by a maximum of 16 pixels in the vertical and horizontal directions due to restrictions on the expression of the motion vector. This is shown in FIG. The absolute value difference sum and variance are calculated while shifting the search range one pixel at a time, and the position where these values are minimized is obtained.
[0009]
However, the larger the search range, the greater the amount of computation for motion search. Various methods are used to reduce the calculation amount of motion search. Three examples are given below.
[0010]
[Method 1]: The number of pixels for calculating the sum of absolute difference and variance is reduced. For example, calculation is performed with 64 pixels out of 16 pixels vertically and horizontally (total 256 pixels) in the macroblock. An example in which 64 pixels are selected in the macroblock is shown in FIG. In FIG. 2, if a pixel indicated by a black circle is selected, 64 pixels are calculated.
[0011]
[Method 2]: The position where the absolute value difference sum and variance are calculated within the search range is reduced. For example, the search is performed while shifting by two pixels. FIG. 3 shows a state of searching while shifting by two pixels.
[0012]
[Method 3]: Tree search. For example, a predetermined search position candidate is determined in advance, and only the vicinity of the position is searched.
[0013]
In addition, as one of motion compensation interframe predictive coding methods, a global motion compensation method that measures the motion of the entire screen such as camera panning, creates a reference image by affine transformation of the entire screen, and obtains a prediction error. There is. The affine transformation parameters at this time are called global motion vectors, and the process for obtaining the global motion vectors is called global motion search. In the video encoding method MPEG-4, it is possible to combine global motion compensation and motion compensation not using affine transformation. For example, global motion compensation and motion compensation that does not use affine transformation can be selected for each macroblock. By selecting the higher encoding efficiency, the encoding efficiency of the entire frame can be improved.
[0014]
In global motion search, there is a method of affine transformation of the entire screen and determining an affine transformation parameter that minimizes the prediction error of the entire screen, but there is also a method of using the result of motion search for each macroblock. In this case, an affine transformation parameter is determined from the position in the screen of each macroblock and the motion vector, and is used as a global motion vector. As the motion search range is increased, a global motion vector having a smaller prediction error is obtained. Conversely, as the range increases, the amount of calculation increases.
[0015]
[Problems to be solved by the invention]
As described above, increasing the search range for motion search increases the amount of computation. For this reason, when the purpose is to encode a moving image in real time, if the amount of calculation becomes large, the encoding is not in time, and there is a problem that encoded data at the target encoding speed cannot be obtained. In particular, if the purpose is to output encoded data at a fixed frame rate, the fixed frame rate cannot be maintained when one frame cannot be encoded in real time.
[0016]
When moving picture encoding is executed by hardware, the calculation processing speed in hardware is determined one-to-one for one calculation instruction. Therefore, if the hardware processing speed is designed in advance so that encoding can be executed even when the amount of calculation becomes maximum, there will be no problem that encoding cannot be made in time.
[0017]
On the other hand, when executed by software, the calculation processing speed depends on the machine, so the actual calculation processing speed is not determined one-to-one for one calculation instruction. Therefore, there is a problem that encoding is not in time when executed on a machine with a low arithmetic processing speed. In addition, other programs may be executed on the same machine, such as a personal computer (PC). In this case, if another program is executed during the moving image encoding, the machine computation process is divided into the program, so that the encoding cannot be executed, resulting in a decrease in the encoding speed. To do. As described above, there is a problem that a time during which the arithmetic processing for encoding is not executed occurs during encoding.
[0018]
[Means for Solving the Problems]
The calculation processing speed of a machine such as a personal computer is determined depending on the CPU access speed to the cache, the memory access speed, etc., but the processing of the CPU that mainly executes the calculation instructions in the program. Depends on speed. Further, since it is the CPU that actually performs the calculation, the number of times the CPU processes instructions for one calculation instruction becomes the calculation processing speed of the machine. That is, the result of dividing the CPU instruction processing count for one arithmetic instruction by the CPU operating frequency is the processing time of one arithmetic instruction on the machine. Therefore, for example, in order to obtain the processing time for encoding one frame, it is only necessary to measure the number of CPU instruction processing during encoding and divide it by the CPU operating frequency. Similarly, the processing time for executing the motion search process can be obtained by measuring the number of instruction processes of the CPU while it is being performed.
[0019]
In this way, the processing time can be measured from the number of instruction processes of the CPU. In addition, the number of instruction processes necessary for the encoding process that should be originally executed by the CPU depends only on the program configuration. Therefore, for example, in the case of processing where the number of processing instructions necessary for encoding one frame, such as motion search processing, is fixed, it is possible to obtain the required number of instruction processings in advance before execution. In the prediction error encoding, the number of processing instructions varies depending on the number of DCT operations for each frame.
[0020]
However, as described in the above problem, another program may be executed during encoding. Since the CPU operates in a time-sharing manner, the CPU does not perform an encoding process while another program is being executed. Accordingly, the number of CPU instruction processes during encoding includes instructions for executing other programs. This causes a decrease in encoding speed if another program is executed during encoding.
[0021]
In order to solve the above problems, the present invention is characterized in that the number of processing instructions required for motion vector search or global motion vector search is changed by switching search accuracy. Specifically, the following method is used.
[0022]
  In a first aspect of the present invention, in a moving picture coding method in which a motion search is performed by an arithmetic unit and a moving picture is coded using a motion compensated inter-frame predictive coding method, 1 is calculated from a predetermined frame rate before coding. Set the encoding target time, which is the time to encode the frame, and store the motion search instruction number information, which is the number of motion search processing instructions executed by the computing unit, for the motion search method set in advance before encoding. In order to measure the encoding time of each frame at the time of encoding and to perform a motion search for the next frame from the set encoding target time and the measured encoding time after the end of one frame encoding. The motion search target time is set, the motion search method is determined from the motion search target time according to the stored motion search command number information, and the motion search processing is controlled.
  In the setting of the motion search target time, after one frame encoding is completed, the processing time other than the motion search is estimated from the measured encoding time and the stored motion search command number information, and one frame is determined. To subtract the time for processing other than motion search from the encoding target time of the previous frame, and to subtract the delay time when the previous frame is encoded, to perform the motion search for the next frame Set as the motion search target time. In the invention described below, the delay time is similarly taken into consideration, and when a delay occurs in the encoding of the previous frame, the delay time is subtracted from the motion search target time.
[0023]
Here, the motion search instruction number information may be information substantially corresponding to the number of instructions, and may be information such as a value converted into time, for example. The same applies to the invention described below.
[0024]
According to the first aspect of the present invention, the number of motion search processing instructions to be executed by the arithmetic unit is obtained for each motion search method set in advance before encoding, so when the motion search time is set. The motion search method can be determined by obtaining the number of processing instructions executed at that time.
[0025]
For example, assume that the following two types of motion search are set in advance.
[0026]
[Method A]: An absolute value difference sum is obtained for all pixels in the macroblock. The absolute value difference sum is obtained by shifting one pixel at a time within the search range, and the parallel movement amount at the position where the absolute value difference sum is the smallest is taken as the motion vector.
[0027]
[Method B]: An absolute value difference sum is obtained for all the pixels in the macroblock. The absolute value difference sum is obtained by shifting two pixels at a time within the search range, and the parallel movement amount at the position where the absolute value difference sum is the smallest is taken as the motion vector.
[0028]
Prior to encoding, when motion search is performed in advance using method A and method B, the number of instructions to be executed by the computing unit is obtained. As a result, it is assumed that method A has 10 instructions and method B has 5 instructions. Thereafter, it is assumed that a motion search time is set when encoding is performed by an encoder equipped with an arithmetic unit, and this is equivalent to seven instructions by the arithmetic unit. In this case, method A cannot complete the motion search within 7 instructions, but method B can complete it within 7 instructions. Therefore, if method B is selected and motion search is executed, encoding can be performed in real time.
[0029]
According to the second aspect of the present invention, in a moving picture coding method in which a motion search is performed by an arithmetic unit and a moving picture is coded using a motion compensated inter-frame predictive coding method, 1 is calculated from a predetermined frame rate before coding. Set the encoding target time, which is the time to encode the frame, and store the motion search instruction number information, which is the number of motion search processing instructions executed by the computing unit, for the motion search method set in advance before encoding. In order to measure the encoding time of each frame at the time of encoding and to perform a motion search for the next frame from the set encoding target time and the measured encoding time after the end of one frame encoding. The motion search target time is set, the motion search method is determined from the motion search target time according to the stored motion search command number information, the motion search process is controlled, and the motion search process execution time is calculated. And, from actually measured motion search time, and updates the motion search instruction number information that has been said memory.
[0030]
According to the second invention, the number of motion search processing instructions set in advance in the first invention before encoding is updated with the number of instructions processed by the encoder that actually executes the motion search. be able to. This method is suitable when an accurate number of processing instructions cannot be obtained in advance before encoding. For example, when an encoder is configured by combining arithmetic units with different processing speeds, the overall processing speed of the encoder is not known, but the processing time required for motion search by actually encoding several frames is not known. The number of instructions can be obtained. In addition, when the encoding process is performed by a general-purpose arithmetic unit such as a CPU, since other programs may regularly use the CPU, the processing time required for the actual encoding is not known. However, according to the present invention, it is possible to obtain the number of instructions by actually obtaining the processing time required for motion search by encoding.
[0031]
According to a third aspect of the present invention, there is provided a moving picture coding method in which a motion search and a global motion search are performed by an arithmetic unit and a moving picture is coded using a motion compensated interframe predictive coding method. A motion search instruction that is the number of motion search processing instructions executed by a computing unit is set for a motion search method that is set in advance before encoding by setting an encoding target time that is a time for encoding one frame from the frame rate. Number information is stored, and global motion search instruction number information, which is the number of motion search processing instructions executed by the arithmetic unit, is stored for the global motion search method set in advance before encoding. The encoding time of each frame is measured at the time of encoding, and after the completion of one frame encoding, the motion search for the next frame and the global are calculated from the set encoding target time and the measured encoding time. The motion search target time is set for performing the search, and the motion search method and the global motion search method are determined from the motion search target time according to the stored motion search command number information and global motion search command number information. And control motion search processing and global motion search processing.
[0032]
According to the third invention, when performing global motion search in addition to motion search, the motion search method and the global motion search are performed so that the motion search can be executed within the target time as in the first invention. The method can be determined.
[0033]
According to a fourth aspect of the present invention, there is provided a moving picture coding method in which a motion search and a global motion search are performed by an arithmetic unit and a moving picture is coded using a motion compensation interframe predictive coding method. A motion search instruction that is the number of motion search processing instructions executed by a computing unit is set for a motion search method that is set in advance before encoding by setting an encoding target time that is a time for encoding one frame from the frame rate. Number information is stored, and global motion search instruction number information, which is the number of motion search processing instructions executed by the arithmetic unit, is stored for the global motion search method set in advance before encoding. The encoding time of each frame is measured at the time of encoding, and after the completion of one frame encoding, the motion search for the next frame and the global are calculated from the set encoding target time and the measured encoding time. A motion search target time is set for performing a search, and a motion search method and a global motion search method are determined according to the stored motion search command number information and global motion search command number information from the motion search target time. Control the motion search process and the global motion search process, measure the execution time of the motion search process, and update the stored motion search instruction number information from the actually measured motion search time. In addition, the execution time of the global motion search process is measured, and the stored global motion search command number information is updated from the actually measured global motion search time.
[0034]
According to the fourth aspect of the invention, when performing global motion search in addition to motion search, as in the case of the second aspect, encoding is actually performed to obtain a processing time required for the motion search, which is necessary for the motion search. The number of instructions can be obtained.
[0035]
According to a fifth aspect of the present invention, in the moving picture coding method, block motion search is performed for each area obtained by dividing the screen by a computing unit, and a moving picture is coded using a motion compensated interframe predictive coding method. Sets the encoding target time, which is the time for encoding one frame from a predetermined frame rate, and the number of motion search processing instructions to be executed by the arithmetic unit for the motion search method set in advance before encoding The motion search command number information is stored, the encoding time of each frame is measured at the time of encoding, and after the completion of 1 frame encoding, from the set encoding target time and the measured encoding time, The motion search target time for performing the motion search of the next frame is set, the motion search time for each area executed in the block motion search process is measured, and the motion search time for each measured block is set as the frame search time. Determine the frame motion search time and total beam units, according to the motion search instruction number information that has been said storage, controls the motion search to determine the motion search method from the motion search target time and the frame motion search time.
[0036]
According to the fifth aspect of the present invention, it is possible to measure a motion search time by executing a motion search for each region, and compare the total value of the time with a motion search target time. This is suitable when the number of motion search commands actually processed by the encoder during encoding is different from the number of motion search processing commands set in advance before encoding. For example, when the total value of motion search times becomes larger than the target time, the motion search for that frame can be forcibly terminated. As a region, a macroblock or a slice that is a set of macroblocks can be applied. For a region that could not be searched when forcibly terminated, a zero vector (still), a motion vector at the same position in the previous frame, or a motion vector in the surrounding region can be used as the motion vector of that region.
[0037]
According to a sixth aspect of the present invention, there is provided a moving picture coding method in which block motion search and global motion search are performed for each region obtained by dividing the screen by a computing unit, and a moving picture is coded using a motion compensation interframe predictive coding method. , Set a coding target time, which is a time for coding one frame from a predetermined frame rate before coding, and perform motion search to be executed by an arithmetic unit for a motion search method set in advance before coding The number of motion search instruction number information is stored, and the global motion search instruction is the number of motion search process instructions to be executed by the arithmetic unit in accordance with the global motion search method set in advance before encoding. Number information is stored, the encoding time of each frame is measured at the time of encoding, and after one frame encoding is completed, from the set encoding target time and the measured encoding time, A local motion search target time that is a motion search target time for performing frame motion search and a global motion search target time that is a motion search target time for performing global motion search are set and executed in block motion search processing. The motion search time for each area is measured, and the motion search time for each block is obtained by summing the measured motion search times for each block, and the motion search time for each area executed in the global block motion search process is calculated. The frame global motion search time obtained by measuring and summing the measured motion search times for each block in units of frames is obtained, and the local motion search target time and the frame motion search time are determined according to the stored motion search command number information. The motion search method is determined from the above to control the motion search process, and the stored global Accordance with the motion search command number information, determines a global motion estimation method and a global motion search target time frame global motion search time, controls the global motion search.
[0038]
According to the sixth invention, when performing global motion search in addition to motion search, as in the fifth invention, for example, motion search or global motion actually processed by the encoder during encoding is performed. When the total number of motion search time and global motion search is greater than the target time when the number of search commands is different from the number of motion search or global motion search processing commands set in advance before encoding Can forcibly terminate the motion search or global motion search for that frame.
[0039]
According to a seventh aspect of the present invention, in the moving picture coding method, block motion search is performed for each region obtained by dividing the screen by a computing unit, and a moving picture is coded using a motion compensated interframe predictive coding method. Sets the encoding target time, which is the time for encoding one frame from a predetermined frame rate, and the number of motion search processing instructions to be executed by the arithmetic unit for the motion search method set in advance before encoding The motion search command number information is stored, the image statistical information of each area in the screen is detected from the image information of the input image, the order of the areas to be searched for motion is determined from the detected image statistical information, Measure the encoding time of one frame, and set the motion search target time for performing the motion search of the next frame from the set encoding target time and the measured encoding time after the end of encoding of one frame , The motion search time for each area executed in the block motion search process is measured, the motion search time for each block is calculated to obtain the frame motion search time for each frame, and the stored motion search command According to the numerical information, the motion search method is determined from the motion search target time and the frame motion search time, and the motion search process is controlled.
[0040]
According to the seventh invention, when the motion search is terminated in the middle of the frame as in the fifth invention, the motion search order is set in advance for each area before the motion search is performed. Is possible. For example, before the motion search is performed, it is possible to measure whether each area in the screen is a moving area and to perform a motion search process prior to the stationary area. In the motion search of the area that was determined to be a stationary area before the motion search, the total value of the motion search time becomes larger than the target time, and even if the motion search for that frame is forcibly terminated, The motion vector of the region can be a zero vector. As a result, it is possible to reduce a decrease in encoding efficiency after the motion vector is actually obtained.
[0041]
According to an eighth aspect of the present invention, there is provided a moving picture coding method in which a block motion search and a global motion search are performed for each region obtained by dividing the screen by a computing unit, and a moving picture is coded using a motion compensation interframe prediction coding method. , Set a coding target time, which is a time for coding one frame from a predetermined frame rate before coding, and perform motion search to be executed by an arithmetic unit for a motion search method set in advance before coding The number of motion search instruction number information is stored, and the global motion search instruction is the number of motion search process instructions to be executed by the arithmetic unit in accordance with the global motion search method set in advance before encoding. Number information is stored, image statistical information of each area in the screen is detected from the image information of the input image, and the order of the areas to be searched for motion is determined from the detected image statistical information. Is a motion search target time for performing a motion search for the next frame from the set encoding target time and the measured encoding time after one frame encoding is completed. A local motion search target time and a global motion search target time that is a motion search target time for performing a global motion search are set, and a motion search time for each area executed in the block motion search process is measured and measured. The frame motion search time obtained by summing the motion search time for each block in units of frames is obtained, the motion search time for each area executed in the global block motion search process is measured, and the motion search time for each measured block is calculated in units of frames. The total frame global motion search time is obtained, and local motion search is performed according to the stored motion search command number information. The motion search method is determined from the target time and the frame motion search time, the motion search process is controlled, and the global motion search target time and the frame global motion search time are globally determined according to the stored global motion search command number information. Determines the motion search method and controls the global motion search process.
[0042]
According to the eighth aspect, as in the seventh aspect, the motion search is forcibly terminated in the middle of the frame by setting the order of the motion search for each region in advance before performing the motion search. The reduction in encoding efficiency can be reduced. In addition, before performing motion search, determine whether to perform motion search for each region in advance, perform motion search only in that region during encoding, and increase the time allocated for global motion search It is possible. For example, before performing a motion search, it is determined in advance whether each region is a moving region or a stationary region, the motion search is performed only for the moving region, and the motion search is not performed for the still region. As a result, the time for motion search in the still region can be allocated to global motion search.
[0043]
A software program for realizing the above processing method by a computer can be stored in an appropriate recording medium such as a portable medium memory, a semiconductor memory, or a hard disk that can be read by the computer.
[0044]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, embodiments of the present invention will be described with reference to the drawings.
[0045]
In the first embodiment, the number of processing instructions for each motion search method and the number of processing instructions for each global motion search method are set in advance before encoding, and a moving image is encoded in real time according to this value. Describe the mechanism to do.
[0046]
An operation when a moving image having a screen size of CIF (horizontal 352 pixels, vertical 288 pixels) is encoded at a frame rate of 10 frames per second on a computer equipped with a CPU having an operating frequency of 500 MHz will be described.
[0047]
The following method A, method B, and method C are prepared as motion search methods. Apply the same method to all macroblocks in the screen.
[0048]
[Method A]: An absolute value difference sum is obtained for all pixels in the macroblock. The search range is 16 pixels vertically and 16 pixels horizontally. The absolute value difference sum is obtained by shifting one pixel at a time within the search range, and the parallel movement amount at the position where the absolute value difference sum is the smallest is taken as the motion vector.
[0049]
[Method B]: An absolute value difference sum is obtained for all the pixels in the macroblock. The search range is 16 pixels vertically and 16 pixels horizontally. The absolute value difference sum is obtained by shifting two pixels at a time within the search range, and the parallel movement amount at the position where the absolute value difference sum is the smallest is taken as the motion vector.
[0050]
[Method C]: The motion vectors of all macroblocks are set to 0 vectors.
[0051]
It is assumed that the number of motion search instructions in method A is 10 million, the number of motion search instructions in method B is 5 million, and the number of instructions in method C is 10,000.
[0052]
As a global motion search method, the screen is first divided into blocks each having 8 pixels in the vertical direction and 8 pixels in the horizontal direction, and the motion search is performed in units of the blocks. After the motion search for all blocks is completed, the number of blocks for the motion vector is totaled, and the motion vector with the largest number of blocks is defined as the global motion vector. The following method D, method E, and method F are prepared for the block-by-block motion search. Apply the same method to all blocks in the screen.
[0053]
[Method D]: An absolute value difference sum is obtained for all the pixels in the block. The search range is 32 pixels vertically and 32 pixels horizontally. The absolute value difference sum is obtained by shifting one pixel at a time within the search range, and the parallel movement amount at the position where the absolute value difference sum is the smallest is taken as the motion vector.
[0054]
[Method E]: An absolute value difference sum is obtained for all the pixels in the block. The search range is 32 pixels vertically and 32 pixels horizontally. The absolute value difference sum is obtained by even every two pixels within the search range, and the parallel movement amount at the position where the absolute value difference sum is the smallest is taken as the motion vector.
[0055]
[Method F]: The motion vectors of all blocks are set to 0 vectors.
[0056]
The number of global motion search instructions when Method D is adopted is 30 million, the number of global motion search instructions when Method E is adopted is 15 million, and the number of global motion search instructions when Method F is adopted is Suppose that it is 10,000.
[0057]
FIG. 4 shows a processing procedure of the encoding method in the first embodiment. Note that the “part” described in each block shown in FIG. 4 can be read as “procedure”. The same applies to the other embodiments.
[0058]
In the motion search control unit (motion search control procedure) 106 in FIG. 4, any one of preset method A, method B, or method C, or any of method D, method E, or method F is selected. Select.
[0059]
The flow to select is shown in FIG. The motion search target time is set to target_me_time, and the value obtained by converting the number of instructions from method A to method F into time is me_time [i] (i = 1: method A, i = 2: method B, i = 3: method C). , 1 = 4: Method D, i = 5: Method E, i = 6: Method F). Make the following selections:
[0060]
When the sum of me_time [1] and me_time [4] is smaller than the motion search target time (target_me_time), method A and method D are selected (step S10).
[0061]
When the sum of me_time [1] and me_time [5] is smaller than the motion search target time (target_me_time), method A and method E are selected (step S11).
[0062]
When the sum of me_time [1] and me_time [6] is smaller than the motion search target time (target_me_time), method A and method F are selected (step S12).
[0063]
When the sum of me_time [2] and me_time [6] is smaller than the motion search target time (target_me_time), the method B and the method F are selected (step S13).
[0064]
When the sum of me_time [3] and me_time [6] is smaller than the motion search target time (target_me_time), the method C and the method F are selected (step S14).
[0065]
As described above, when any combination is selected, the motion search and the global motion search are selected to be processed within the motion search target time. If Method C and Method F are selected and the motion search target time is not reached (NO in Step S14), encoding of the next frame is started without encoding the frame. In this case, an encoding target time for encoding one frame is added to the motion search target time.
[0066]
First, since the frame rate is 10 frames per second in the target time setting unit 101 before the start of encoding, 100 msec is set as the encoding target time. The motion parameter storage unit 102 stores the number of processing instructions from method A to method C, and the global motion parameter storage unit 103 stores the number of processing instructions from method D to method F.
[0067]
In this embodiment, the actual time corresponding to the number of processing instructions is as follows.
[0068]
Figure 0003670566
Next, the encoding procedure for the Jth and J + 1th frames after the start of encoding will be described. Assume that encoding is not in time for the encoding target time in the (J-1) th frame, and encoding is in time for the encoding target time in the Jth frame. It is assumed that the encoding time measured by the encoding time measuring unit 104 is 110 msec using the method A for motion search and the method D for global motion search for the J-1th frame. That is, a delay of 10 msec occurs.
[0069]
In this situation, first, the motion search time setting unit 105 obtains the motion search target time for the J-th frame. Since the encoding time using method A and method D was 110 msec, the processing time other than motion search is
110 msec- (time of method A + time of method D) = 110 msec- (20 msec + 60 msec) = 30 msec
Can be calculated.
[0070]
Based on the recovery from the 10 msec delay in the next frame, the motion search target time target_me_time is:
100 msec-(delay time)-(time other than motion search) = 100 msec-10 msec-30 msec = 60 msec
And set. The motion search control unit 106 selects the method A and the method E according to the selection flow in FIG.
[0071]
The image input unit 107 acquires image information for one frame. The motion search unit 108 performs motion search by the method A, and the global motion search unit 109 performs global motion search by the method E. The inter-frame predictive encoding unit 110 encodes the image information of the Jth frame using the motion vector obtained by the motion search unit 108 and the global motion vector obtained by the global motion search unit 109. The local decoding unit 111 decodes the encoded data. The encoding time measuring unit 104 measures the encoding time of the Jth frame. Assume that the encoding time is 55 msec.
[0072]
In this case, the 10 msec delay generated in the (J-1) th frame is eliminated, and the encoding is performed in real time. As described above, even when the previous frame cannot be encoded in real time, the delay can be eliminated in the next frame by adjusting the motion search time of the next frame.
[0073]
Subsequently, the motion search time setting unit 105 obtains a motion search target time for the J + 1th frame. Since the encoding time using method A and method E was 55 msec, the processing time other than motion search is
55 msec- (time of method A + time of method E) = 50 msec- (20 msec + 30 msec) = 5 msec
Can be calculated. Therefore, the motion search target time target_me_time is:
100 msec- (time other than motion search) = 100 msec-5 msec = 95 msec
And set. The motion search control unit 106 selects the method A and the method D according to the selection flow in FIG.
[0074]
The image input unit 107 acquires image information for one frame. The motion search unit 108 performs motion search by the method A, and the global motion search unit 109 performs global motion search by the method D. The inter-frame predictive encoding unit 110 encodes the image information of the Jth frame using the motion vector obtained by the motion search unit 108 and the global motion vector obtained by the global motion search unit 109. The local decoding unit 111 decodes the encoded data. The encoding time measuring unit 104 measures the encoding time of the J + 1th frame.
[0075]
Thus, when the encoding time of the previous frame is within the encoding target time, it is possible to increase the encoding efficiency over the previous frame by increasing the motion search processing time of the next frame. .
[0076]
As in the first embodiment, the number of processing instructions for each motion search method and the number of processing instructions for each global motion search method are set in advance before encoding, and motion search processing and global motion search are performed according to these values. By changing the processing, the moving image can be encoded in real time.
[0077]
In the first embodiment, as a method for changing the number of motion vector search and global motion search processing instructions, a method of shifting one pixel at a time within the search range (method A and method D), and two pixels at a time within the search range. The method of shifting (method B and method E) and the method of calculating only when the motion vector is 0 vector (method C and method F) have been shown, but the number of processing instructions can be further reduced by shifting the number of pixels by 3 pixels or more. It is also possible to do. In addition, although the motion vector search range is 16 pixels vertically and 16 pixels horizontally, and the global motion search search region is 32 pixels vertically and 32 pixels horizontally, the number of processing instructions can be increased by expanding or reducing the search range. It is also possible to change. The same applies to the second to fourth embodiments described below.
[0078]
Further, in the case where the global motion search is not used, in the first embodiment shown in FIG. 4, it will be described that the procedure of the global motion parameter storage unit 103 and the global motion search unit 109 is omitted. Nor. The same applies to other embodiments described below.
[0079]
In the second embodiment, the number of processing instructions for each motion search method and the number of processing instructions for each global motion search method are set in advance before encoding, and the moving image is encoded according to this value. A mechanism for changing the number of processing instructions along the way will be described.
[0080]
An operation when a moving image having a screen size of CIF (horizontal 352 pixels, vertical 288 pixels) is encoded at a frame rate of 10 frames per second on a computer equipped with a CPU having an operating frequency of 500 MHz will be described.
[0081]
The method A, method B, and method C are prepared for the motion search method as in the first embodiment, and the method D, method E, and method F are prepared for the global motion search method as in the first embodiment. . The motion search method and the global motion search method all apply the same method to macroblocks in the screen.
[0082]
FIG. 6 shows the processing procedure of the encoding method in the second embodiment. Here, in the motion search control unit 206, the selection flow of the motion prediction method and the global motion search method is the same as that in the first embodiment shown in FIG.
[0083]
The encoding procedure for the Jth and J + 1th frames after the start of encoding will be described. In the J-1th frame, encoding is not in time for the encoding target time, and in the Jth frame, encoding is in time for the encoding target time. As a premise, it is assumed that the encoding time measured by the encoding time measuring unit 204 using the method A for the motion search and the method D for the global motion search is 120 msec for the J-1th frame. That is, a delay of 20 msec occurs.
[0084]
The motion search time measured by the motion search time measurement unit 212 is 40 msec, and the global motion search time measured by the global motion search time measurement unit 214 is 60 msec.
[0085]
The number of instructions of each method stored in the motion parameter storage unit 202 is 10 million for method A, 5 million for method B, and 10,000 for method C. It is assumed that the number of instructions of each method stored in the global motion parameter storage unit 203 is 30 million for method D, 15 million for method E, and 10,000 for method F.
[0086]
In this situation, first, the number of motion search instructions and the number of global motion search instructions for the Jth frame are updated. The motion parameter update unit 213 sets the number of instructions for method A to 40 msec * 500 MHz = 20 million, and the global motion parameter update unit 215 sets the number of instructions for method D.
60msec * 500MHz = 30 million
Update to
[0087]
Therefore, the actual time corresponding to the number of processing instructions is as follows.
[0088]
Figure 0003670566
Subsequently, the motion search time setting unit 205 obtains a motion search target time for the Jth frame. Since the encoding time using method A and method D was 120 msec, the processing time other than motion search is
Figure 0003670566
Can be calculated.
[0089]
Based on the recovery from the delay of 20 msec in the next frame, the motion search target time target_me_time is:
Figure 0003670566
And set. The motion search control unit 206 selects the method A and the method F according to the flow of FIG.
[0090]
The image input unit 207 acquires image information for one frame. The motion search unit 208 performs motion search by the method A, and the global motion search unit 209 performs global motion search by the method F. The inter-frame prediction encoding unit 210 encodes the image information of the Jth frame using the motion vector obtained by the motion search unit 208 and the global motion vector obtained by the global motion search unit 209. The local decoding unit 211 decodes the encoded data. The encoding time measuring unit 204 measures the encoding time of the Jth frame. Assume that the encoding time is 55 msec. The motion search time measured by the motion search time measurement unit 212 is 40 msec, and the global motion search time measured by the global motion search time measurement unit 214 is 0.1 msec.
[0091]
In this situation, first, the number of motion search instructions and the number of global motion search instructions for the J + 1th frame are updated. The motion parameter update unit 213 sets the number of instructions for method A to 40 msec * 500 MHz = 20 million, and the global motion parameter update unit 215 sets the number of instructions for method F.
0.1msec * 500MHz = 50,000
Update to
[0092]
Therefore, the actual time corresponding to the number of processing instructions is as follows.
[0093]
Figure 0003670566
Subsequently, the motion search time setting unit 205 obtains a motion search target time for the J + 1th frame. Since the encoding time using method A and method F was 55 msec, the processing time other than motion search is
Figure 0003670566
And can be calculated. Therefore, the motion search target time target_me_time is:
Figure 0003670566
And set. The motion search control unit 206 selects the method A and the method E according to the flow of FIG.
[0094]
The image input unit 207 acquires image information for one frame. The motion search unit 208 performs motion search by the method A, and the global motion search unit 209 performs global motion search by the method E. The inter-frame prediction encoding unit 210 encodes the image information of the J + 1th frame using the motion vector obtained by the motion search unit 208 and the global motion vector obtained by the global motion search unit 209. The local decoding unit 211 decodes the encoded data. The encoding time measuring unit 204 measures the encoding time of the J + 1th frame.
[0095]
As described above, in the second embodiment, the number of motion search instructions and the number of global motion search instructions in the computing unit are obtained and updated from the previous frame encoding, so that the motion corresponding to the computation processing speed of the computing unit is obtained. A search method and a global motion search method can be selected.
[0096]
In the second embodiment, after the processing of the motion search unit 208 is executed, the motion search time is measured by the motion search time measurement unit 212, and this time is also used to perform the global motion search again. A method of resetting the target time is also suitable. For example, if the motion search time in the J + 1th frame is 20 msec, the motion search target time for the global motion search in the J + 1th frame is
target_me_time = 85.1 msec−20 msec = 65.1 msec
And set. Based on this information, the global motion search method is determined again. This selection flow is shown in FIG. According to this selection flow, method D is selected (step S20), and global motion search is performed. The operation after obtaining the global motion vector is the same as the processing procedure of FIG.
[0097]
In the selection flow of FIG. 7, when the target_me_time is larger than me_time [4] (step S20), the method D is selected, and when the target_me_time is smaller than me_time [4] and larger than me_time [5] (step S21). ), Method E is selected. Furthermore, if the target_me_time is equal to or smaller than me_time [5] and larger than me_time [6] (step S22), the method F is selected, and if it is equal to or smaller than me_time [6], global motion compensation is not performed.
[0098]
In this way, by re-setting the motion search target time for global motion search after motion search, a global motion vector with less prediction error can be obtained.
[0099]
In the third embodiment, a mechanism is described in which the number of processing instructions for each motion search method is set in advance before encoding and a moving image is encoded in real time according to this value. However, unlike the first embodiment, the motion search is controlled by measuring the motion search time in units of macroblocks. Prior to encoding, the priority of motion search is determined in advance for each macroblock. The following example shows an example of an operation that forcibly terminates when motion search cannot be executed for all macroblocks within the motion search target time.
[0100]
An operation when a moving image having a screen size of CIF (horizontal 352 pixels, vertical 288 pixels) is encoded at a frame rate of 10 frames per second on a computer equipped with a CPU having an operating frequency of 500 MHz will be described.
[0101]
As the motion search method, the method A and the method B described in the first embodiment are prepared. It is assumed that the number of instructions for motion search in method A is 10 million, and the number of instructions for motion search in method B is 5 million. However, unlike the first embodiment, the motion search method is changed as appropriate for macroblocks in the screen. FIG. 8 shows the processing procedure of the encoding method in the third embodiment. Here, a selection flow of a motion prediction method performed by the motion search control unit 306 is shown in FIG.
[0102]
The motion search times for each block measured by the block motion search time measuring unit 312 are summed in units of frames, the total frame motion search time is set as total_me_time, the motion search target time is set as target_me_time, and until method A and method B Let me_time [i] (i = 1: Method A, i = 2: Method B) be a value obtained by converting the number of instructions to time. The number of macroblocks count_MB subjected to motion search is measured by counting the number of times that motion search processing has been performed. Let the number of macroblocks in the screen be total_MB.
[0103]
The block priority detection unit 316 detects edge pixels in the screen and counts the number of edge pixels for each macroblock. Edges are important to maintain the visual quality, so it is important to improve the quality of the image. For this reason, it is necessary to improve the encoding efficiency of a macroblock including many edge pixels. The search block determination unit 317 creates a list in which the macroblock numbers are arranged in the descending order of the number of edge pixels.
[0104]
The operation of this embodiment in such a procedure configuration will be described. First, since the frame rate is 10 frames per second in the target time setting unit 301 before encoding starts, 100 msec is set as the encoding target time. Further, the motion parameter storage unit 302 stores the number of processing instructions of the method A and the method B.
[0105]
Next, the encoding procedure for the Jth frame after starting encoding will be described. It is assumed that the encoding time measured by the encoding time measuring unit 304 in the J-1th frame is 90 msec. Further, it is assumed that total_me_time is 80 msec.
[0106]
In this situation, first, the motion search time setting unit 305 obtains the motion search target time for the J-th frame. Since the encoding time was 90 msec, the processing time other than motion search is
90msec-80msec = 10msec
Can be calculated. The motion search target time target_me_time in the next frame is:
100 msec- (time other than motion search) = 100 msec-10 msec = 90 msec
And set. For this reason, the motion search method A is selected in the first macroblock.
[0107]
The image input unit 307 acquires image information for one frame. The block priority detection unit 316 performs edge detection and counts the number of edge pixels for each macroblock. The search block determination unit 317 creates a list in which macroblock numbers are arranged in the order of macroblocks having many edge pixels. An example of the list created here is shown in FIG. The block motion search unit 308 determines a motion search method according to the selection flow of FIG. 9, and performs a motion search for each macroblock in the order of the list of FIG.
[0108]
In the selection of the movement method, as shown in FIG. 9, if the product of me_time [1] obtained by dividing the difference between total_MB and count_MB by total_MB is smaller than the difference between target_me_time and total_me_time (step S30), Select A. Otherwise, the product of me_time [2] is calculated by dividing the difference between total_MB and count_MB by total_MB, and if it is smaller than the difference between target_me_time and total_me_time (step S31), method B is selected. . Otherwise, the motion search is stopped.
[0109]
If the frame motion search time is 69.99999999 msec after encoding the macroblock with the macroblock number 200, 200 macroblocks listed in the list of FIG. No motion search is performed for macroblocks after the number. The motion vector of a macroblock that is not subjected to motion search is a 0 vector.
[0110]
The inter-frame prediction encoding unit 310 encodes the image information of the J-th frame using the motion vector obtained by the block motion search unit 308. The local decoding unit 311 decodes the encoded data. The encoding time measuring unit 304 measures the encoding time of the Jth frame.
[0111]
Thus, by measuring the motion search processing time for each macroblock, it is possible to end the motion search processing in the middle of the frame. Also, even when motion search ends in the middle of a frame, the encoding efficiency of macroblocks that contain a large number of edge pixels is improved by determining the order of motion search for each macroblock before encoding. Therefore, it is possible to reduce the degradation of image quality.
[0112]
In the fourth embodiment, the number of processing instructions for each motion search method and the number of processing instructions for each global motion search method are set in advance before encoding, and a moving image is encoded in real time according to this value. Describe the mechanism of However, unlike the first embodiment, the motion search time is measured for each macroblock to control the motion search, and the global motion search time is measured for each macroblock to control the global motion search. In addition, priorities of motion search and global motion search are determined in advance for each macroblock before encoding. The following example shows an operation example in which the block motion search unit 408 forcibly terminates when motion search cannot be executed for all macroblocks within the local motion search target time.
[0113]
An operation when a moving image having a screen size of CIF (horizontal 352 pixels, vertical 288 pixels) is encoded at a frame rate of 10 frames per second on a computer equipped with a CPU having an operating frequency of 500 MHz will be described.
[0114]
As the motion search method, method A and method B are prepared as in the first embodiment, and as the global motion search method, method D and method E are prepared as in the first embodiment. It is assumed that the number of instructions for motion search in method A is 10 million, and the number of instructions for motion search in method B is 5 million. Assume that the number of instructions for global motion search when method D is adopted is 30 million, and the number of instructions for global motion search when method E is adopted is 15 million. However, unlike the first embodiment, the motion search method and the global motion search method are appropriately changed for macroblocks in the screen.
[0115]
FIG. 11 shows a processing procedure of the encoding method in the fourth embodiment. The motion search time setting unit 405 determines a local motion search target time target_local_me_time and a global motion search target time target_global_me_time from the motion search target time target_me_time. The value obtained by converting the number of instructions in method A and method B into time is me_time [i] (i = 1: method A, i = 2: method B), and the number of instructions in method D and method E is converted into time. The value is me_time [i] (i = 4: method D, i = 5: method E). Obtained according to the following formula.
[0116]
target_local_me_time = target_me_time * me_time [1] / (me_time [l] + me_time [4])
target_global_me_time = target_me_time-target_local_me_time
The selection flow of the motion prediction method in the motion search control unit 406 is shown in FIG. 12, and the selection flow of the global motion prediction method is shown in FIG.
[0117]
The motion search times for each block measured by the block motion search time measuring unit 412 are totaled in units of frames, and the total frame motion search time is defined as total_local_me_time. The number of macroblocks count_MB subjected to motion search is measured by counting the number of times that motion search processing has been performed. Let the number of macroblocks in the screen be total_MB.
[0118]
Let global_global_me_time be the frame global motion search time obtained by adding the motion search times for each block measured by the global block motion search time measuring unit 419 in units of frames.
[0119]
In addition, the image information of the pixels of each frame takes a value from 0 to 255, and the block priority detection unit 416 determines whether there is an inter-pixel position between the original image of the current frame and the locally decoded image of the previous frame. The absolute value of the difference is obtained, and the number of pixels (herein referred to as moving pixels) having the difference absolute value of 50 or more is measured for each macroblock. The more moving picture elements, the more the macroblock can be determined as a moving area. The search block determination unit 417 creates a list in which the macroblock numbers are arranged in the descending order of the number of moving pixels.
[0120]
The operation of this embodiment in such a procedure configuration will be described. First, before the start of encoding, the target time setting unit 401 sets 100 msec as the encoding target time because the frame rate is 10 frames per second. Further, the motion parameter storage unit 402 stores the number of processing instructions of the method A and the method B.
[0121]
Next, the encoding procedure for the Jth frame after starting encoding will be described. As a premise, it is assumed that the encoding time measured by the encoding time measuring unit 404 in the J-1th frame is 100 msec. In addition, it is assumed that total_local_me_time is 20 msec and total_g1obsal_me_time is 50 msec.
[0122]
In this situation, first, the motion search time setting unit 405 obtains the motion search target time for the J-th frame. Since the encoding time was 100 msec, the processing time other than motion search is
100msec-20msec-50msec = 30msec
Can be calculated. The motion search target time target_me_time in the next frame is:
100 msec- (time other than motion search) = 100 msec-30 msec = 70 msec
And set. From this, the local motion search target time target_local_me_time and the global motion search target time target_global_me_time are obtained.
[0123]
Figure 0003670566
The image input unit 407 acquires image information for one frame. The block priority detection unit 416 obtains an absolute value difference between the original image of the current frame and the locally decoded image of the previous frame, and counts the number of moving pixels for each macroblock. The search block determination unit 417 creates a list in which macroblock numbers are arranged in the order of macroblocks having the largest number of moving pixels. The list created here is the same as in FIG.
[0124]
The block motion search unit 408 determines a motion search method according to the selection flow in FIG. 12, and performs a motion search in units of macroblocks in the order of the list in FIG. If the frame motion search time becomes 17.4999999 msec after encoding the macroblock with the macroblock number 100, 100th of the macroblocks listed in the list of FIG. 10 according to the selection flow of FIG. No motion search is performed for later macroblocks. The motion vector of a macroblock that is not subjected to motion search is a 0 vector.
[0125]
The global block motion search unit 409 determines a global motion search method according to the selection flow in FIG. 13, and performs motion search in units of macroblocks in the order of the list in FIG. If the frame global motion search time becomes 52.4999999 msec after encoding the macroblock of macroblock number 50, 50 macroblocks listed in the list of FIG. 10 according to the selection flow of FIG. No motion search is performed for macroblocks after the number. The motion vector of a macroblock that is not subjected to motion search is a 0 vector. Of these motion vectors in units of macroblocks, the motion vector having the largest number of macroblocks is defined as a global motion vector.
[0126]
The inter-frame prediction encoding unit 410 encodes the image information of the Jth frame using the motion vector obtained by the block motion search unit 408 and the global motion vector obtained by the global block motion search unit 409. The local decoding unit 411 decodes the encoded data. The encoding time measuring unit 404 measures the encoding time of the Jth frame.
[0127]
In this way, the local motion search target time and the global motion search target time are set from the motion search target time, and the motion search processing time and the global motion search processing time are measured in units of macroblocks. It is possible to end the global motion search processing time.
[0128]
In addition, when the block motion search unit 408 for all macroblocks ends within the preset local motion search target time, it is also preferable to add the surplus time to the global motion search target time. For example, when the frame motion search time measured by the block motion search time measuring unit 412 is 9 msec and the block motion search unit 408 is terminated, the global motion search target time target_global_me_time is set to
52.5msec + (17.5msec-9msec) = 61msec
Set to. According to this value, the global motion search method is determined according to the selection flow of FIG. In this case, method D is selected for the first macroblock. Thereafter, encoding is performed according to the procedure of FIG.
[0129]
Thus, when the block motion search process is completed earlier than the target, a global motion vector with less prediction error can be obtained by determining the global motion search target time again.
[0130]
Note that the selection algorithm shown in the motion search selection flow in FIG. 12 and the global motion search selection flow in FIG. 13 is the same as that in the above-described example of FIG. 9, and thus detailed description for each step is omitted.
[0131]
【The invention's effect】
According to the present invention, the number of processing instructions for each motion search method and the number of processing instructions for each global motion search method are set in advance before encoding, and the motion search process and the global motion search process are changed according to these values. By doing so, a moving image can be encoded in real time. That is, as in the case of encoding with a personal computer, the encoding process stops while another program is executed, or the CPU processing speed varies depending on the model. Even in different cases, it is possible to encode a moving image in real time by adjusting the time required for motion vector search.
[Brief description of the drawings]
FIG. 1 is a diagram illustrating a relationship between a macroblock and a search range.
FIG. 2 is a diagram illustrating an example of a pixel selection method.
FIG. 3 is a diagram illustrating an example in which a search position is shifted by two pixels.
FIG. 4 is a diagram for explaining the procedure of the first embodiment;
FIG. 5 is a motion search selection flow in the first embodiment;
FIG. 6 is a diagram for explaining the procedure of the second embodiment;
FIG. 7 is a selection flow of global motion search in the second embodiment.
FIG. 8 is a diagram for explaining the procedure of the third embodiment;
FIG. 9 is a motion search selection flow in the third embodiment;
FIG. 10 is a diagram illustrating an example of the order of macroblocks for motion search.
FIG. 11 is a diagram illustrating the procedure of a fourth embodiment.
FIG. 12 is a motion search selection flow in the fourth embodiment;
FIG. 13 is a selection flow of global motion search in the fourth embodiment.
[Explanation of symbols]
101 Target time setting section
102 Motion parameter storage unit
103 Global motion parameter storage unit
104 Coding time measurement unit
105 Motion search time setting section
106 Motion search control unit
107 Image input unit
108 Motion search unit
109 Global motion search unit
110 Interframe prediction encoding unit
111 Local decoding unit

Claims (9)

演算器で動き探索を行い,動き補償フレーム間予測符号化方式を用いて動画像を符号化する動画像符号化方法において,
画像を入力する画像入力ステップと,
動き探索をする動き探索ステップと,
動き探索ステップにて求めた動きベクトルを使って動き補償フレーム間予測符号化を行うフレーム間予測符号化ステップと,
符号化データを復号する局所復号ステップと,
を実行する動画像符号化方法であって,
符号化前に予め定められたフレームレートから1フレームを符号化する時間である符号化目標時間を設定する目標時間設定ステップと,
符号化前に予め設定した動き探索方法に対して,演算器で実行する動き探索の処理命令数である動き探索命令数情報を記憶しておく動きパラメータ記憶ステップと,
1フレームの符号化時間を計測する符号化時間計測ステップと,
1フレーム符号化終了後に,符号化時間計測ステップにて計測された符号化時間と動きパラメータ記憶ステップにて記憶してある動き探索命令数情報とから,動き探索以外の処理の時間を推定し,目標時間設定ステップにて設定される符号化目標時間から動き探索以外の処理の時間を引き,さらに前のフレームの符号化にて遅延が生じている場合にその遅延時間を引いた値を,次のフレームの動き探索を行うための動き探索目標時間として設定する動き探索時間設定ステップと,
動きパラメータ記憶ステップにて記憶してある動き探索命令数情報に従って,動き探索目標時間から動き探索方法を決定し動き探索処理を制御する動き探索制御ステップと,
を実行することを特徴とする処理時間適応画像符号化方法。
In a moving picture coding method in which a motion search is performed by a computing unit and a moving picture is coded using a motion compensation interframe predictive coding method,
An image input step for inputting an image;
A motion search step for motion search,
An inter-frame prediction encoding step for performing motion compensation inter-frame prediction encoding using the motion vector obtained in the motion search step;
A local decoding step for decoding the encoded data;
A video encoding method for executing
A target time setting step for setting an encoding target time that is a time for encoding one frame from a predetermined frame rate before encoding;
A motion parameter storing step for storing motion search command number information, which is the number of motion search processing commands executed by an arithmetic unit, for a motion search method set in advance before encoding;
An encoding time measuring step for measuring the encoding time of one frame;
After one frame encoding is completed, the time for processing other than motion search is estimated from the encoding time measured in the encoding time measuring step and the motion search instruction number information stored in the motion parameter storage step. Subtract the time for processing other than motion search from the encoding target time set in the target time setting step, and subtract the delay time if there is a delay in encoding the previous frame. A motion search time setting step for setting as a motion search target time for performing motion search of the frame of
A motion search control step for determining the motion search method from the motion search target time and controlling the motion search process according to the motion search command number information stored in the motion parameter storage step;
The processing time adaptive image coding method characterized by performing this.
演算器で動き探索を行い,動き補償フレーム間予測符号化方式を用いて動画像を符号化する動画像符号化方法において,
画像を入力する画像入力ステップと,
動き探索をする動き探索ステップと,
動き探索ステップにて求めた動きベクトルを使って動き補償フレーム間予測符号化を行うフレーム間予測符号化ステップと,
符号化データを復号する局所復号ステップと,
を実行する動画像符号化方法であって,
符号化前に予め定められたフレームレートから1フレームを符号化する時間である符号化目標時間を設定する目標時間設定ステップと,
符号化前に予め設定した動き探索方法に対して,演算器で実行する動き探索の処理命令数である動き探索命令数情報を記憶しておく動きパラメータ記憶ステップと,
1フレームの符号化時間を計測する符号化時間計測ステップと,
動き探索ステップの実行時間を測定する動き探索時間計測ステップと,
1フレーム符号化終了後に,符号化時間計測ステップにて計測された符号化時間と動き探索時間計測ステップにて計測された動き探索時間とから,動き探索以外の処理の時間を推定し,目標時間設定ステップにて設定される符号化目標時間から動き探索以外の処理の時間を引き,さらに前のフレームの符号化にて遅延が生じている場合にその遅延時間を引いた値を,次のフレームの動き探索を行うための動き探索目標時間として設定する動き探索時間設定ステップと,
次のフレームの動き探索を行うための動き探索目標時間を設定する動き探索時間設定ステップと,
きパラメータ記憶ステップにて記憶してある動き探索命令数情報に従って,動き探索目標時間から動き探索方法を決定し動き探索処理を制御する動き探索制御ステップと,
動き探索時間計測ステップにて計測された動き探索時間から,動きパラメータ記憶ステップに記憶してある動き探索命令数情報を更新する動きパラメータ更新ステップと,
を実行することを特徴とする処理時間適応画像符号化方法。
In a moving picture coding method in which a motion search is performed by a computing unit and a moving picture is coded using a motion compensation interframe predictive coding method,
An image input step for inputting an image;
A motion search step for motion search,
An inter-frame prediction encoding step for performing motion compensation inter-frame prediction encoding using the motion vector obtained in the motion search step;
A local decoding step for decoding the encoded data;
A video encoding method for executing
A target time setting step for setting an encoding target time that is a time for encoding one frame from a predetermined frame rate before encoding;
A motion parameter storing step for storing motion search command number information, which is the number of motion search processing commands executed by an arithmetic unit, for a motion search method set in advance before encoding;
An encoding time measuring step for measuring the encoding time of one frame;
A motion search time measurement step for measuring the execution time of the motion search step;
After one frame encoding is completed , the processing time other than motion search is estimated from the encoding time measured in the encoding time measurement step and the motion search time measured in the motion search time measurement step, and the target time Subtract the time for processing other than motion search from the target encoding time set in the setting step , and if there is a delay in encoding the previous frame, subtract the delay time to the next frame. A motion search time setting step for setting a motion search target time for performing a motion search of
A motion search time setting step for setting a motion search target time for performing motion search for the next frame;
Accordance with the motion search instruction number information stored in the dynamic-out parameter storing step, a motion search control step of controlling the motion search to determine the motion search method from the motion search target time,
A motion parameter update step for updating the motion search instruction number information stored in the motion parameter storage step from the motion search time measured in the motion search time measurement step;
The processing time adaptive image coding method characterized by performing this.
演算器で動き探索とグローバル動き探索を行い,動き補償フレーム間予測符号化方式を用いて動画像を符号化する動画像符号化方法において,
画像を入力する画像入力ステップと,
動き探索をする動き探索ステップと,
グローバル動き探索をするグローバル動き探索ステップと,
動き探索ステップにて求めた動きベクトルとグローバル動き探索ステップにて求めたグローバル動きベクトルを使って動き補償フレーム間予測符号化を行うフレーム間予測符号化ステップと,
符号化データを復号する局所復号ステップと,
を実行する動画像符号化方法であって,
符号化前に予め定められたフレームレートから1フレームを符号化する時間である符号化目標時間を設定する目標時間設定ステップと,
符号化前に予め設定した動き探索方法に対して,演算器で実行する動き探索の処理命令数である動き探索命令数情報を記憶しておく動きパラメータ記憶ステップと,
符号化前に予め設定したグローバル動き探索方法に対して,演算器で実行する動き探索の処理命令数であるグローバル動き探索命令数情報を記憶しておくグローバル動きパラメータ記憶ステップと,
1フレームの符号化時間を計測する符号化時間計測ステップと,
1フレーム符号化終了後に,符号化時間計測ステップにて計測された符号化時間と動きパラメータ記憶ステップにて記憶してある動き探索命令数情報とから,動き探索以外の処理の時間を推定し,目標時間設定ステップにて設定される符号化目標時間から動き探索以外の処理の時間を引き,さらに前のフレームの符号化にて遅延が生じている場合にその遅延時間を引いた値を,次のフレームの動き探索とグローバル動き探索を行うための動き探索目標時間として設定する動き探索時間設定ステップと,
動き探索目標時間から,動きパラメータ記憶ステップにて記憶してある動き探索命令数情報とグローバル動きパラメータ記憶ステップにて記憶してあるグローバル動き探索命令数情報に従って,動き探索方法とグローバル動き探索方法を決定し,動き探索処理とグローバル動き探索処理を制御する動き探索制御ステップと,
を実行することを特徴とする処理時間適応画像符号化方法。
In a video encoding method that performs motion search and global motion search with an arithmetic unit and encodes a video using a motion compensated interframe prediction encoding method,
An image input step for inputting an image;
A motion search step for motion search,
A global motion search step for global motion search;
An inter-frame prediction encoding step for performing motion compensation inter-frame prediction encoding using the motion vector obtained in the motion search step and the global motion vector obtained in the global motion search step;
A local decoding step for decoding the encoded data;
A video encoding method for executing
A target time setting step for setting an encoding target time that is a time for encoding one frame from a predetermined frame rate before encoding;
A motion parameter storing step for storing motion search command number information, which is the number of motion search processing commands executed by an arithmetic unit, for a motion search method set in advance before encoding;
A global motion parameter storage step for storing global motion search command number information, which is the number of motion search processing commands executed by an arithmetic unit, with respect to a global motion search method set in advance before encoding;
An encoding time measuring step for measuring the encoding time of one frame;
After one frame encoding is completed, the time for processing other than motion search is estimated from the encoding time measured in the encoding time measuring step and the motion search instruction number information stored in the motion parameter storage step. Subtract the time for processing other than motion search from the encoding target time set in the target time setting step, and subtract the delay time if there is a delay in encoding the previous frame. A motion search time setting step for setting a motion search target time for performing frame motion search and global motion search,
According to the motion search target time, the motion search method and the global motion search method are determined according to the motion search command number information stored in the motion parameter storage step and the global motion search command number information stored in the global motion parameter storage step. A motion search control step for determining and controlling motion search processing and global motion search processing;
The processing time adaptive image coding method characterized by performing this.
演算器で動き探索とグローバル動き探索を行い,動き補償フレーム間予測符号化方式を用いて動画像を符号化する動画像符号化方法において,
画像を入力する画像入力ステップと,
動き探索をする動き探索ステップと,
グローバル動き探索をするグローバル動き探索ステップと,
動き探索ステップにて求めた動きベクトルとグローバル動き探索ステップにて求めたグローバル動きベクトルを使って動き補償フレーム間予測符号化を行うフレーム間予測符号化ステップと,
符号化データを復号する局所復号ステップと,
を実行する動画像符号化方法であって,
符号化前に予め定められたフレームレートから1フレームを符号化する時間である符号化目標時間を設定する目標時間設定ステップと,
符号化前に予め設定した動き探索方法に対して,演算器で実行する動き探索の処理命令数である動き探索命令数情報を記憶しておく動きパラメータ記憶ステップと,
符号化前に予め設定したグローバル動き探索方法に対して,演算器で実行する動き探索の処理命令数であるグローバル動き探索命令数情報を記憶しておくグローバル動きパラメータ記憶ステップと,
1フレームの符号化時間を計測する符号化時間計測ステップと,
動き探索ステップの実行時間を測定する動き探索時間計測ステップと,
1フレーム符号化終了後に,符号化時間計測ステップにて計測された符号化時間と動き探索時間計測ステップにて計測された動き探索時間とから,動き探索以外の処理の時間を 推定し,目標時間設定ステップにて設定される符号化目標時間から動き探索以外の処理の時間を引き,さらに前のフレームの符号化にて遅延が生じている場合にその遅延時間を引いた値を,次のフレームの動き探索とグローバル動き探索を行うための動き探索目標時間として設定する動き探索時間設定ステップと,
動き探索目標時間から,動きパラメータ記憶ステップにて記憶してある動き探索命令数情報とグローバル動きパラメータ記憶ステップにて記憶してあるグローバル動き探索命令数情報に従って,動き探索方法とグローバル動き探索方法を決定し,動き探索処理とグローバル動き探索処理を制御する動き探索制御ステップと,
き探索時間計測ステップにて計測された動き探索時間から,動きパラメータ記憶ステップに記憶してある動き探索命令数情報を更新する動きパラメータ更新ステップと,
グローバル動き探索ステップの実行時間を測定するグローバル動き探索時間計測ステップと,
グローバル動き探索時間計測ステップにて計測されたグローバル動き探索時間から,グローバル動きパラメータ記憶ステップに記憶してあるグローバル動き探索命令数情報を更新するグローバル動きパラメータ更新ステップと,
を実行することを特徴とする処理時間適応画像符号化方法。
In a video encoding method that performs motion search and global motion search with an arithmetic unit and encodes a video using a motion compensated interframe prediction encoding method,
An image input step for inputting an image;
A motion search step for motion search,
A global motion search step for global motion search;
An inter-frame prediction encoding step for performing motion compensation inter-frame prediction encoding using the motion vector obtained in the motion search step and the global motion vector obtained in the global motion search step;
A local decoding step for decoding the encoded data;
A video encoding method for executing
A target time setting step for setting an encoding target time that is a time for encoding one frame from a predetermined frame rate before encoding;
A motion parameter storing step for storing motion search command number information, which is the number of motion search processing commands executed by an arithmetic unit, for a motion search method set in advance before encoding;
A global motion parameter storage step for storing global motion search command number information, which is the number of motion search processing commands executed by an arithmetic unit, with respect to a global motion search method set in advance before encoding;
An encoding time measuring step for measuring the encoding time of one frame;
A motion search time measurement step for measuring the execution time of the motion search step;
After one frame encoding is completed , the processing time other than motion search is estimated from the encoding time measured in the encoding time measurement step and the motion search time measured in the motion search time measurement step , and the target time Subtract the time for processing other than motion search from the target encoding time set in the setting step , and if there is a delay in encoding the previous frame, subtract the delay time to the next frame. A motion search time setting step for setting a motion search target time for performing motion search and global motion search,
According to the motion search target time, the motion search method and the global motion search method are determined according to the motion search command number information stored in the motion parameter storage step and the global motion search command number information stored in the global motion parameter storage step. A motion search control step for determining and controlling motion search processing and global motion search processing;
From motion search time measured by dynamic-out search time measurement step, a motion parameter updating step of updating the motion search instruction number information stored in the motion parameter storage step,
A global motion search time measurement step for measuring the execution time of the global motion search step;
A global motion parameter update step for updating the global motion search command number information stored in the global motion parameter storage step from the global motion search time measured in the global motion search time measurement step;
The processing time adaptive image coding method characterized by performing this.
演算器で動き探索を行い,動き補償フレーム間予測符号化方式を用いて動画像を符号化する動画像符号化方法において,
画像を入力する画像入力ステップと,
画面内を領域に分割し,領域毎に動き探索をするブロック動き探索ステップと,
動き探索ステップにて求めた領域毎に動きベクトルを使って動き補償フレーム間予測符号化を行うフレーム間予測符号化ステップと,
符号化データを復号する局所復号ステップと,
を実行する動画像符号化方法であって,
符号化前に予め定められたフレームレートから1フレームを符号化する時間である符号化目標時間を設定する目標時間設定ステップと,
符号化前に予め設定した動き探索方法に対して,演算器で実行する動き探索の処理命令数である動き探索命令数情報を記憶しておく動きパラメータ記憶ステップと,
1フレームの符号化時間を計測する符号化時間計測ステップと,
ブロック動き探索ステップで実行される領域毎の動き探索時間を測定するブロック動き探索時間計測ステップと,
ブロック動き探索時間計測ステップにて計測されたブロック毎の動き探索時間を,フレーム単位で合計したフレーム動き探索時間を求めるブロック動き探索時間加算ステップと,
1フレーム符号化終了後に,符号化時間計測ステップにて計測された符号化時間と前記フレーム動き探索時間とから,動き探索以外の処理の時間を推定し,目標時間設定ステップにて設定される符号化目標時間から動き探索以外の処理の時間を引き,さらに前のフレームの符号化にて遅延が生じている場合にその遅延時間を引いた値を,次のフレームの動き探索を行うための動き探索目標時間として設定する動き探索時間設定ステップと,
きパラメータ記憶ステップにて記憶してある動き探索命令数情報に従って,動き探索目標時間とフレーム動き探索時間から動き探索方法を決定し動き探索処理を制御する動き探索制御ステップと,
を実行することを特徴とする処理時間適応画像符号化方法。
In a moving picture coding method in which a motion search is performed by a computing unit and a moving picture is coded using a motion compensation interframe predictive coding method,
An image input step for inputting an image;
A block motion search step that divides the screen into regions and performs motion search for each region;
An inter-frame prediction encoding step for performing motion compensation inter-frame prediction encoding using a motion vector for each region obtained in the motion search step;
A local decoding step for decoding the encoded data;
A video encoding method for executing
A target time setting step for setting an encoding target time that is a time for encoding one frame from a predetermined frame rate before encoding;
A motion parameter storing step for storing motion search command number information, which is the number of motion search processing commands executed by an arithmetic unit, for a motion search method set in advance before encoding;
An encoding time measuring step for measuring the encoding time of one frame;
A block motion search time measuring step for measuring a motion search time for each area executed in the block motion search step;
A block motion search time addition step for obtaining a frame motion search time obtained by summing the motion search times for each block measured in the block motion search time measurement step in units of frames;
After one frame encoding is completed , a time other than motion search is estimated from the encoding time measured in the encoding time measuring step and the frame motion search time, and the code set in the target time setting step Motion to perform motion search for the next frame by subtracting the time for processing other than motion search from the target time and subtracting the delay time when there is a delay in encoding the previous frame A motion search time setting step for setting as a search target time;
Accordance with the motion search instruction number information stored in the dynamic-out parameter storing step, a motion search control step of controlling the determined motion search motion estimation method from the motion search target time and the frame motion search time,
The processing time adaptive image coding method characterized by performing this.
演算器で動き探索とグローバル動き探索を行い,動き補償フレーム間予測符号化方式を用いて動画像を符号化する動画像符号化方法において,
画像を入力する画像入力ステップと,
画面内を領域に分割し,領域毎に動き探索をするブロック動き探索ステップと,
画面内を領域に分割し,領域毎に動き探索をしてグローバル動きベクトルを求めるグローバルブロック動き探索ステップと,
ブロック動き探索ステップにて求めた領域毎の動きベクトルとグローバルブロック動き探索ステップにて求めたグローバル動きベクトルを使って動き補償フレーム間予測符号化を行うフレーム間予測符号化ステップと,
符号化データを復号する局所復号ステップと,
を実行する動画像符号化方法であって,
符号化前に予め定められたフレームレートから1フレームを符号化する時間である符号化目標時間を設定する目標時間設定ステップと,
符号化前に予め設定した動き探索方法に対して,演算器で実行する動き探索の処理命令数である動き探索命令数情報を記憶しておく動きパラメータ記憶ステップと,
符号化前に予め設定したグローバル動き探索方法に対して,演算器で実行する動き探索の処理命令数であるグローバル動き探索命令数情報を記憶しておくグローバル動きパラメータ記憶ステップと,
1フレームの符号化時間を計測する符号化時間計測ステップと,
ブロック動き探索ステップで実行される領域毎の動き探索時間を測定するブロック動き探索時間計測ステップと,
ブロック動き探索時間計測ステップにて計測されたブロック毎の動き探索時間を,フレーム単位で合計したフレーム動き探索時間を求めるブロック動き探索時間加算ステップと,
グローバルブロック動き探索ステップで実行される領域毎の動き探索時間を測定するグローバルブロック動き探索時間計測ステップと,
グローバルブロック動き探索時間計測ステップにて計測されたブロック毎の動き探索時間を,フレーム単位で合計したフレームグローバル動き探索時間を求めるグローバルブロック動き探索時間加算ステップと,
1フレーム符号化終了後に,符号化時間計測ステップにて計測された符号化時間と前記フレーム動き探索時間と前記フレームグローバル動き探索時間とから,動き探索以外の処理の時間を推定し,目標時間設定ステップにて設定される符号化目標時間から動き探索以外の処理の時間を引き,さらに前のフレームの符号化にて遅延が生じている場合にその遅延時間を引いた値をもとに,次のフレームの動き探索を行うための動き探索目標時間であるローカル動き探索目標時間と,グローバル動き探索を行うための動き探索目標時間であるグローバル動き探索目標時間を設定する動き探索時間設定ステップと,
きパラメータ記憶ステップにて記憶してある動き探索命令数情報に従って,ローカル動き探索目標時間とフレーム動き探索時間から動き探索方法を決定し動き探索処理を制御する動き探索制御ステップと,
グローバル動きパラメータ記憶ステップにて記憶してあるグローバル動き探索命令数情報に従って,グローバル動き探索目標時間とフレームグローバル動き探索時間からグローバル動き探索方法を決定しグローバル動き探索処理を制御するグローバル動き探索制御ステップと,
を実行することを特徴とする処理時間適応画像符号化方法。
In a video encoding method that performs motion search and global motion search with an arithmetic unit and encodes a video using a motion compensated interframe prediction encoding method,
An image input step for inputting an image;
A block motion search step that divides the screen into regions and performs motion search for each region;
A global block motion search step that divides the screen into regions and performs a motion search for each region to obtain a global motion vector;
An inter-frame prediction encoding step for performing motion compensation inter-frame prediction encoding using the motion vector for each region obtained in the block motion search step and the global motion vector obtained in the global block motion search step;
A local decoding step for decoding the encoded data;
A video encoding method for executing
A target time setting step for setting an encoding target time that is a time for encoding one frame from a predetermined frame rate before encoding;
A motion parameter storing step for storing motion search command number information, which is the number of motion search processing commands executed by an arithmetic unit, for a motion search method set in advance before encoding;
A global motion parameter storage step for storing global motion search command number information, which is the number of motion search processing commands executed by an arithmetic unit, with respect to a global motion search method set in advance before encoding;
An encoding time measuring step for measuring the encoding time of one frame;
A block motion search time measuring step for measuring a motion search time for each area executed in the block motion search step;
A block motion search time addition step for obtaining a frame motion search time obtained by summing the motion search times for each block measured in the block motion search time measurement step in units of frames;
A global block motion search time measuring step for measuring a motion search time for each region executed in the global block motion search step;
A global block motion search time addition step for obtaining a frame global motion search time obtained by summing the motion search times for each block measured in the global block motion search time measurement step in units of frames;
After the completion of one frame encoding, the processing time other than motion search is estimated from the encoding time measured in the encoding time measuring step, the frame motion search time, and the frame global motion search time, and the target time is set. Subtract the time for processing other than motion search from the target encoding time set in step , and if there is a delay in encoding the previous frame, A motion search time setting step for setting a local motion search target time, which is a motion search target time for performing motion search of a frame, and a global motion search target time, which is a motion search target time for performing global motion search,
Accordance with the motion search instruction number information stored in the dynamic-out parameter storing step, a motion search control step of controlling the determined motion search motion estimation method from the local motion estimation target time and the frame motion search time,
Global motion search control step for controlling a global motion search process by determining a global motion search method from a global motion search target time and a frame global motion search time according to the global motion search command number information stored in the global motion parameter storage step When,
The processing time adaptive image coding method characterized by performing this.
演算器で動き探索を行い,動き補償フレーム間予測符号化方式を用いて動画像を符号化する動画像符号化方法において,
画像を入力する画像入力ステップと,
画面内を領域に分割し,領域毎に動き探索をするブロック動き探索ステップと,
動き探索ステップにて求めた領域毎に動きベクトルを使って動き補償フレーム間予測符号化を行うフレーム間予測符号化ステップと,
符号化データを復号する局所復号ステップと,
を実行する動画像符号化方法であって,
符号化前に予め定められたフレームレートから1フレームを符号化する時間である符号化目標時間を設定する目標時間設定ステップと,
符号化前に予め設定した動き探索方法に対して,演算器で実行する動き探索の処理命令数である動き探索命令数情報を記憶しておく動きパラメータ記憶ステップと,
入力画像の画像情報から,画面内の各領域の画像統計情報を検出するブロック優先度検出ステップと,
画像統計情報から,動き探索する領域の順序を決定する探索ブロック決定ステップと,
1フレームの符号化時間を計測する符号化時間計測ステップと,
ブロック動き探索ステップで実行される領域毎の動き探索時間を測定するブロック動き探索時間計測ステップと,
ブロック動き探索時間計測ステップにて計測されたブロック毎の動き探索時間を,フレーム単位で合計したフレーム動き探索時間を求めるブロック動き探索時間加算ステップと,
1フレーム符号化終了後に,符号化時間計測ステップにて計測された符号化時間と前記フレーム動き探索時間とから,動き探索以外の処理の時間を推定し,目標時間設定ステップにて設定される符号化目標時間から動き探索以外の処理の時間を引き,さらに前のフレームの符号化にて遅延が生じている場合にその遅延時間を引いた値を,次のフレームの動き探索を行うための動き探索目標時間として設定する動き探索時間設定ステップと,
きパラメータ記憶ステップにて記憶してある動き探索命令数情報に従って,動き探索目標時間とフレーム動き探索時間から動き探索方法を決定し動き探索処理を制御する動き探索制御ステップと,
を実行することを特徴とする処理時間適応画像符号化方法。
In a moving picture coding method in which a motion search is performed by a computing unit and a moving picture is coded using a motion compensation interframe predictive coding method,
An image input step for inputting an image;
A block motion search step that divides the screen into regions and performs motion search for each region;
An inter-frame prediction encoding step for performing motion compensation inter-frame prediction encoding using a motion vector for each region obtained in the motion search step;
A local decoding step for decoding the encoded data;
A video encoding method for executing
A target time setting step for setting an encoding target time that is a time for encoding one frame from a predetermined frame rate before encoding;
A motion parameter storing step for storing motion search command number information, which is the number of motion search processing commands executed by an arithmetic unit, for a motion search method set in advance before encoding;
A block priority detection step for detecting image statistical information of each area in the screen from the image information of the input image;
A search block determination step for determining the order of regions for motion search from image statistical information;
An encoding time measuring step for measuring the encoding time of one frame;
A block motion search time measuring step for measuring a motion search time for each area executed in the block motion search step;
A block motion search time addition step for obtaining a frame motion search time obtained by summing the motion search times for each block measured in the block motion search time measurement step in units of frames;
After one frame encoding is completed , a time other than motion search is estimated from the encoding time measured in the encoding time measuring step and the frame motion search time, and the code set in the target time setting step Motion to perform motion search for the next frame by subtracting the time for processing other than motion search from the target time and subtracting the delay time when there is a delay in encoding the previous frame A motion search time setting step for setting as a search target time;
Accordance with the motion search instruction number information stored in the dynamic-out parameter storing step, a motion search control step of controlling the determined motion search motion estimation method from the motion search target time and the frame motion search time,
The processing time adaptive image coding method characterized by performing this.
演算器で動き探索とグローバル動き探索を行い,動き補償フレーム間予測符号化方式を用いて動画像を符号化する動画像符号化方法において,
画像を入力する画像入力ステップと,
画面内を領域に分割し,領域毎に動き探索をするブロック動き探索ステップと,
画面内を領域に分割し,領域毎に動き探索をしてグローバル動きベクトルを求めるグローバルブロック動き探索ステップと,
ブロック動き探索ステップにて求めた領域毎の動きベクトルとグローバルブロック動き探索ステップにて求めたグローバル動きベクトルを使って動き補償フレーム間予測符号化を行うフレーム間予測符号化ステップと,
符号化データを復号する局所復号ステップと,
を実行する動画像符号化方法であって,
符号化前に予め定められたフレームレートから1フレームを符号化する時間である符号化目標時間を設定する目標時間設定ステップと,
符号化前に予め設定した動き探索方法に対して,演算器で実行する動き探索の処理命令数である動き探索命令数情報を記憶しておく動きパラメータ記憶ステップと,
符号化前に予め設定したグローバル動き探索方法に対して,演算器で実行する動き探索の処理命令数であるグローバル動き探索命令数情報を記憶しておくグローバル動きパラメータ記憶ステップと,
入力画像の画像情報から,画面内の各領域の画像統計情報を検出するブロック優先度検出ステップと,
画像統計情報から,動き探索する領域の順序を決定する探索ブロック決定ステップと,
1フレームの符号化時間を計測する符号化時間計測ステップと,
ブロック動き探索ステップで実行される領域毎の動き探索時間を測定するブロック動き探索時間計測ステップと,
ブロック動き探索時間計測ステップにて計測されたブロック毎の動き探索時間を,フレーム単位で合計したフレーム動き探索時間を求めるブロック動き探索時間加算ステップと,
グローバルブロック動き探索ステップで実行される領域毎の動き探索時間を測定するグローバルブロック動き探索時間計測ステップと,
グローバルブロック動き探索時間計測ステップにて計測されたブロック毎の動き探索時間を,フレーム単位で合計したフレームグローバル動き探索時間を求めるグローバルブロック動き探索時間加算ステップと,
1フレーム符号化終了後に,符号化時間計測ステップにて計測された符号化時間と前記 フレーム動き探索時間と前記フレームグローバル動き探索時間とから,動き探索以外の処理の時間を推定し,目標時間設定ステップにて設定される符号化目標時間から動き探索以外の処理の時間を引き,さらに前のフレームの符号化にて遅延が生じている場合にその遅延時間を引いた値をもとに,次のフレームの動き探索を行うための動き探索目標時間であるローカル動き探索目標時間と,グローバル動き探索を行うための動き探索目標時間であるグローバル動き探索目標時間を設定する動き探索時間設定ステップと,
きパラメータ記憶ステップにて記憶してある動き探索命令数情報に従って,ローカル動き探索目標時間とフレーム動き探索時間から動き探索方法を決定し動き探索処理を制御する動き探索制御ステップと,
グローバル動きパラメータ記憶ステップにて記憶してあるグローバル動き探索命令数情報に従って,グローバル動き探索目標時間とフレームグローバル動き探索時間からグローバル動き探索方法を決定しグローバル動き探索処理を制御するグローバル動き探索制御ステップと,
を実行することを特徴とする処理時間適応画像符号化方法。
In a video encoding method that performs motion search and global motion search with an arithmetic unit and encodes a video using a motion compensated interframe prediction encoding method,
An image input step for inputting an image;
A block motion search step that divides the screen into regions and performs motion search for each region;
A global block motion search step that divides the screen into regions and performs a motion search for each region to obtain a global motion vector;
An inter-frame prediction encoding step for performing motion compensation inter-frame prediction encoding using the motion vector for each region obtained in the block motion search step and the global motion vector obtained in the global block motion search step;
A local decoding step for decoding the encoded data;
A video encoding method for executing
A target time setting step for setting an encoding target time that is a time for encoding one frame from a predetermined frame rate before encoding;
A motion parameter storing step for storing motion search command number information, which is the number of motion search processing commands executed by an arithmetic unit, for a motion search method set in advance before encoding;
A global motion parameter storage step for storing global motion search command number information, which is the number of motion search processing commands executed by an arithmetic unit, with respect to a global motion search method set in advance before encoding;
A block priority detection step for detecting image statistical information of each area in the screen from the image information of the input image;
A search block determination step for determining the order of regions for motion search from image statistical information;
An encoding time measuring step for measuring the encoding time of one frame;
A block motion search time measuring step for measuring a motion search time for each area executed in the block motion search step;
A block motion search time addition step for obtaining a frame motion search time obtained by summing the motion search times for each block measured in the block motion search time measurement step in units of frames;
A global block motion search time measuring step for measuring a motion search time for each region executed in the global block motion search step;
A global block motion search time addition step for obtaining a frame global motion search time obtained by summing the motion search times for each block measured in the global block motion search time measurement step in units of frames;
After the completion of one frame encoding, the processing time other than motion search is estimated from the encoding time measured in the encoding time measuring step, the frame motion search time, and the frame global motion search time, and the target time is set. Subtract the time for processing other than motion search from the target encoding time set in step , and if there is a delay in encoding the previous frame, A motion search time setting step for setting a local motion search target time, which is a motion search target time for performing motion search of a frame, and a global motion search target time, which is a motion search target time for performing global motion search,
Accordance with the motion search instruction number information stored in the dynamic-out parameter storing step, a motion search control step of controlling the determined motion search motion estimation method from the local motion estimation target time and the frame motion search time,
Global motion search control step for controlling a global motion search process by determining a global motion search method from a global motion search target time and a frame global motion search time according to the global motion search command number information stored in the global motion parameter storage step When,
The processing time adaptive image coding method characterized by performing this.
請求項1から請求項8までのいずれか1項に記載の処理時間適応画像符号化方法をコンピュータに実行させるためのプログラムを記録した
ことを特徴とする処理時間適応画像符号化プログラムの記録媒体。
A recording medium for a processing time adaptive image encoding program, wherein a program for causing a computer to execute the processing time adaptive image encoding method according to any one of claims 1 to 8 is recorded.
JP2000303509A 2000-10-03 2000-10-03 Processing time adaptive image encoding method and program recording medium Expired - Fee Related JP3670566B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2000303509A JP3670566B2 (en) 2000-10-03 2000-10-03 Processing time adaptive image encoding method and program recording medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2000303509A JP3670566B2 (en) 2000-10-03 2000-10-03 Processing time adaptive image encoding method and program recording medium

Publications (2)

Publication Number Publication Date
JP2002112274A JP2002112274A (en) 2002-04-12
JP3670566B2 true JP3670566B2 (en) 2005-07-13

Family

ID=18784700

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2000303509A Expired - Fee Related JP3670566B2 (en) 2000-10-03 2000-10-03 Processing time adaptive image encoding method and program recording medium

Country Status (1)

Country Link
JP (1) JP3670566B2 (en)

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100727910B1 (en) * 2000-10-11 2007-06-13 삼성전자주식회사 Method and apparatus for motion estimation of hybrid type
US7515634B2 (en) * 2002-06-28 2009-04-07 Qualcomm Incorporated Computationally constrained video encoding
JP3787633B2 (en) * 2003-04-21 2006-06-21 独立行政法人情報通信研究機構 Real-time content editing system
JP4401861B2 (en) * 2004-04-30 2010-01-20 キヤノン株式会社 Image processing apparatus and control method thereof
JP2007074592A (en) * 2005-09-09 2007-03-22 Sony Corp Image processing apparatus and method thereof, program, and recording medium
TWI305109B (en) * 2005-12-30 2009-01-01 Altek Corp Method for processing motion image
JP4670688B2 (en) * 2006-03-06 2011-04-13 日本電気株式会社 Motion vector detection method, motion vector detection device, and motion vector detection program
US8340185B2 (en) * 2006-06-27 2012-12-25 Marvell World Trade Ltd. Systems and methods for a motion compensated picture rate converter
EP2163097A2 (en) 2007-05-25 2010-03-17 Arc International, Plc Adaptive video encoding apparatus and methods
JP4891204B2 (en) * 2007-11-16 2012-03-07 キヤノン株式会社 Video processing apparatus, video processing method, video processing program, and storage medium
JP2011211498A (en) * 2010-03-30 2011-10-20 Sanyo Electric Co Ltd Image coding apparatus and method
JP6922215B2 (en) * 2016-12-27 2021-08-18 富士通株式会社 Video encoding device

Also Published As

Publication number Publication date
JP2002112274A (en) 2002-04-12

Similar Documents

Publication Publication Date Title
KR100677562B1 (en) Motion estimation method and motion estimation apparatus
US8340189B1 (en) Phase correlation based motion estimation in hybrid video compression
US20060045186A1 (en) Apparatus and method for coding moving picture
US7953154B2 (en) Image coding device and image coding method
JP4467541B2 (en) Encoding method and apparatus for improving compression efficiency through model switching during motion estimation of subpixels
US20150172687A1 (en) Multiple-candidate motion estimation with advanced spatial filtering of differential motion vectors
JP5078895B2 (en) Integrated space-time prediction method
US20080002772A1 (en) Motion vector estimation method
JP3670566B2 (en) Processing time adaptive image encoding method and program recording medium
JP4573438B2 (en) Video coding
US20060114997A1 (en) Temporal prediction in video coding
JP2000236552A (en) Motion vector detector
CN109640097B (en) Adaptive factor video affine motion estimation method
JP4677932B2 (en) Moving picture coding method, moving picture coding apparatus, program, and medium
JP5613319B2 (en) Video encoding apparatus, video encoding method, and video encoding program
KR20090014371A (en) Motion detection device
EP2362655B1 (en) Motion-vector estimation
KR20000023275A (en) Method and apparatus for fractional-pel motion estimation using estimated distortion values
KR100490730B1 (en) Method and apparatus for motion estimation using of adaptive search pattern for video sequence compression
JP2002247584A (en) Method and device for encoding image, program for image encoding processing, and recording medium for the program
JP3615963B2 (en) Fast motion estimation method and apparatus for real-time video coding
JPH11113003A (en) Motion vector detector and motion vector detection method
JP2002051342A (en) Coding apparatus, method of coding and storage medium
JPH09200763A (en) Motion compensating method for moving image encoding
JP3860435B2 (en) Moving picture coding apparatus and method, moving picture coding processing program, and recording medium for the program

Legal Events

Date Code Title Description
A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20050111

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20050223

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: 20050412

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20050414

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

RD02 Notification of acceptance of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: R3D02

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

Free format text: PAYMENT UNTIL: 20090422

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20090422

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20100422

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20100422

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20110422

Year of fee payment: 6

LAPS Cancellation because of no payment of annual fees