JP2004023372A - Method and device for encoding image - Google Patents

Method and device for encoding image Download PDF

Info

Publication number
JP2004023372A
JP2004023372A JP2002174328A JP2002174328A JP2004023372A JP 2004023372 A JP2004023372 A JP 2004023372A JP 2002174328 A JP2002174328 A JP 2002174328A JP 2002174328 A JP2002174328 A JP 2002174328A JP 2004023372 A JP2004023372 A JP 2004023372A
Authority
JP
Japan
Prior art keywords
block
error
average value
pixels
pixel
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2002174328A
Other languages
Japanese (ja)
Inventor
Yuji Harada
原田 裕司
Koji Onishi
大西 孝ニ
Naoyuki Tanimoto
谷本 尚之
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.)
Ikegami Tsushinki Co Ltd
Original Assignee
Ikegami Tsushinki Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ikegami Tsushinki Co Ltd filed Critical Ikegami Tsushinki Co Ltd
Priority to JP2002174328A priority Critical patent/JP2004023372A/en
Publication of JP2004023372A publication Critical patent/JP2004023372A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Compression Of Band Width Or Redundancy In Fax (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To encode a high quality image with a high compression rate by a simple operation without requiring special data. <P>SOLUTION: An inputting part 1 receives an image signal, and an 8 × 8 block input circuit 2a divides the image into blocks of 8 × 8 pixels. An average calculation circuit 3a calculates the average of pixel values in a divided block, and a predictive error quantizer 4a calculates a predictive error from the calculated average and quantizes the predictive error. A predictive error inverse quantizer and a new average calculation circuit 5a dequantize the quantized error to calculate an error and add or subtract the error to/from the calculated error to calculate a new average. An error calculation circuit 6a compares the new average with all pixel values in the block to thereby calculate an error. An error comparison circuit 7a compares the calculated error with a threshold. <P>COPYRIGHT: (C)2004,JPO

Description

【0001】
【発明の属する技術分野】
本発明は、テレビ電話、監視カメラ等に適用され、画像信号を符号化処理して伝送や蓄積を行う際の画像符号化方法及びその装置に関するものである。
【0002】
【従来の技術】
一般的な画像信号の圧縮規格として、静止画像についてはJPEGが提案されており、動画像についてはMPEGが提案されている。また、代表的な画像圧縮方法としては、JPEGやMPEGで採用しているDCTを用いた直交変換の他に、予測符号化やベクトル量子化がある。
【0003】
MPEGの場合、圧縮率が高くなるものの、動き補償(予測)とDCTを用いるために、演算量が多くなり、ハードウェアによって実行する場合には、専用のハードウェアを用いる必要があり、ソフトウェアによって実行する場合には、高性能CPUを用いる必要がある。
【0004】
また、Bピクチャ(Bidirectional predictive符号化画像)を用いるプロファイルの場合には、遅延量が多くなり、テレビ電話などの会話に適用するのが困難である。
【0005】
予測符号化は、互いに隣接する画素から当該画素値を予測し、その予測誤差を量子化する符号化であるが、この場合、圧縮率を高めるに従って量子化レベル数を減少する必要があり、その結果、画質の劣化が顕著になる。
【0006】
ベクトル量子化は、複数の画素値を所定の代表ベクトルに置き換える手法であり、テレビ電話のように入力画像に特徴のある場合には有効であるが、一般のテレビジョン映像のように様々な映像が入力される場合には、コードブック(符号化データすなわちテーブル)を生成するのが困難となる。
【0007】
【発明が解決しようとする課題】
これまで説明したように、MPEGなどで用いられるDCTでは、複雑な加減乗除演算が行われるとともに演算量が膨大になるという不都合がある。また、予測符号化の場合、圧縮率を高くすると画質の劣化が顕著になり、ベクトル量子化の場合、特別なデータ(コードブック)を必要とする。
【0008】
本発明の目的は、特別なデータを必要とすることなく、簡単かつ少ない演算量によって高品質かつ高圧縮率の画像の符号化を行うことができる画像符号化方法及びその装置を提供することである。
【0009】
【課題を解決するための手段】
本発明による画像符号化方法は、
画像信号を符号化処理して伝送する画像符号化方法であって、
全画面を、所定の画素単位のブロックに分割し、
前記ブロック内の画素値の平均値を算出し、
前記画素値と前記平均値との誤差をそれぞれ算出し、
これらの誤差が所定の値内であるか否かに基づいて、前記ブロックの符号化を行うか前記ブロックを更に分割するかの判定を行い、
その判定の結果に応じた適切な画素単位のブロックで符号化処理を行うことを特徴とする。
【0010】
本発明によれば、所定の画素単位に分割されたブロックの符号化を行うかブロックを更に分割するかの判定を行い、その判定の結果に応じた適切な画素単位のブロックで符号化処理を行っているので、DCTのような複雑な加減乗除算及び膨大な演算量を必要としない。また、予測符号化のように圧縮率を高めるに従って量子化レベル数を減少する必要がないので、高品質かつ高圧縮の符号化を行うことができる。さらに、ベクトル量子化のように特別なデータを必要としない。
【0011】
好適には、前記ブロックの平均値と前記ブロック内の画素値との差の絶対値の最大値をブロックごとに求めたヒストグラムを作成し、前記所定の値を前記ヒストグラムから算出する。
【0012】
本発明による画像符号化装置は、
画像信号を符号化処理して伝送する画像符号化装置であって、
全画面を、所定の画素単位のブロックに分割するブロック分割手段と、
前記ブロック内の画素値の平均値を算出する平均値算出手段と、
前記画素値と前記平均値との誤差をそれぞれ算出する誤差算出手段と、
これらの誤差が所定の値内であるか否かに基づいて、前記ブロックの符号化を行うか前記ブロックを更に分割するかの判定を行う判定手段と、
その判定の結果に応じた適切な画素単位のブロックで符号化処理を行う符号化手段とを具えることを特徴とする。
【0013】
本発明によれば、DCTのような複雑な加減乗除算及び膨大な演算量を必要とせず、高品質かつ高圧縮の符号化を行うことができ、かつ、特別なデータを必要としない。
【0014】
【発明の実施の形態】
本発明による画像符号化方法及びその装置の実施の形態を、図面を参照して詳細に説明する。
【0015】
図1は、本発明による画像符号化方法の実施の形態の動作のフローチャートである。この場合、全画面を、水平方向に8画素及び垂直方向に8画素を有するブロック、すなわち、8×8画素のブロックに分割し、このように分割された8×8画素のブロックを基準としている。
【0016】
図1に示す制御ルーチンは、例えば、画像監視システムの送信側で実行され、先ず、ステップS1において、符号化の前処理として、判定処理用のしきい値を算出する。なお、ステップS1を、図2及び図3を用いて後に詳細に説明する。
【0017】
次いで、ステップS2において、全画面を8×8画素のブロックに分割したときの全ブロック数Jを設定する。全ブロック数Jは、縦横の画素数によって決定される。次いで、ステップS3において、図5を用いて後に詳細に説明する8×8画素のブロックの処理を行う。
【0018】
次いで、全ブロック数Jから1を減算し(ステップS4)、その後、全ブロックの処理が終了したか否かを判定する(ステップS5)。終了した場合には、このルーチンを終了し、終了しない場合には、ステップS3に戻る。
【0019】
図2は、図1のステップS1のサブルーチンの前半のフローチャートであり、図3は、図1のステップS1のサブルーチンの後半のフローチャートである。本実施の形態では、基準となるブロックを8×8画素のブロックから構成している。8×8画素のブロックを基準として処理するため、そのブロックを縦横それぞれ半分に分割すれば、4×4画素のブロックに分割され、更にその半分に分割すれば、2×2画素のブロックに分割されることとなる。図2及び図3のサブルーチンは、2×2画素のブロックを基準とし、4×4画素のブロック、8×8画素のブロックへと演算を進めて平均値及びしきい値を算出する。
【0020】
先ず、ステップS11〜S13において、全ブロック数J、4×4画素のブロックの演算数k及び2×2画素のブロックの演算数lをそれぞれ、パラメータとしてセットする。この場合、演算数k,lはいずれも4となる。
【0021】
次いで、ステップS14において、8×8画素のブロックを2×2画素のブロックに分割したときにおける2×2画素のブロックについての平均値を算出する。2×2画素であるため、画素数は4となる。4画素の平均値を求めるためには、これらの画素値を合計した後に4で除算すればよい。4による除算は、デジタル計算の場合には右方向に2ビットだけシフトすればよいので、複雑な構成の除算器を必要としない。すなわち、画素値をそれぞれA1,A2,A3,A4とすれば、第1の平均値(平均値2)は、1/4(A1+A2+A3+A4)となる。
【0022】
次いで、平均値2と各画素との間の差の絶対値を求め(ステップS15)、求めた4個の差の絶対値のうちの最大値を検出して、後に説明する第1のヒストグラム(ヒストグラム1)に登録し(ステップS16)、演算数lから1を減算し(ステップS17)、演算数lが0であるか否か、すなわち、2×2画素のブロックの全てについて処理が終了したか否か判定する。処理が終了している場合、次のステップS19に進み、それに対して、処理が終了していない場合には、ステップS14に戻る。
【0023】
ステップS19において、2×2画素のブロックの処理の結果を利用して4×4画素のブロックの平均値を算出する。4×4画素であるため、画素数は16となる。16画素の平均値を求めるためには、上記平均値2を使用して、四つの2×2画素のブロックの加算平均を求めればよい。四つの2×2画素のブロックの平均値をそれぞれB1,B2,B3,B4とすれば、第2の平均値(平均値4)は、1/4(B1+B2+B3+B4)となる。
【0024】
次いで、平均値4と各画素との間の差の絶対値を求め(ステップS20)、求めた4個の差の絶対値のうちの最大値を検出して、後に説明する第2のヒストグラム(ヒストグラム2)に登録し(ステップS21)、演算数kから1を減算し(ステップS22)、演算数kが0であるか否か、すなわち、4×4画素のブロックの全てについて処理が終了したか否か判定する。処理が終了している場合、次のステップS24に進み、それに対して、処理が終了していない場合には、ステップS13に戻る。
【0025】
次いで、ステップS24において、4×4画素のブロックの処理の結果を利用して8×8画素のブロックの平均値を算出する。8×8画素であるため、画素数は64となる。64画素の平均値を求めるためには、上記平均値4を使用して、四つの4×4画素のブロックの加算平均を求めればよい。四つの4×4画素のブロックの平均値をそれぞれC1,C2,C3,C4とすれば、第3の平均値(平均値8)は、1/4(C1+C2+C3+C4)となる。
【0026】
次いで、平均値8と各画素との間の差の絶対値を求め(ステップS25)、求めた64個の差の絶対値のうちの最大値を検出して、後に説明する第3のヒストグラム(ヒストグラム3)に登録する(ステップS26)。
【0027】
次いで、ステップS27において、全ブロック数Jから1を減算し、ステップS28において、全ブロックすなわち画像全体(1画面)について処理が終了したか否か判定する。処理が終了した場合には、ステップS29に進み、それに対して、処理が終了していない場合には、ステップS12に戻る。
【0028】
ステップS29において、ヒストグラム1,2及び3と、後段に接続される図示しないバッファメモリの前フレーム処理後の空き容量とから、後の処理で使用するしきい値及び量子化テーブル番号を決定し、このサブルーチンを終了する。
【0029】
この場合、しきい値は、図4のように得られたヒストグラム1,2及び3の分布から決定され、8×8画素のブロック用、4×4画素のブロック用及び2×2画素のブロック用の3種類が求められる。また、平均値8、平均値4及び平均値2を量子化するための3種類の量子化テーブル番号を決定する。
【0030】
図5は、図1のステップS3のサブルーチンのフローチャートである。このサブルーチンは、可変長符号化を行うために量子化を行うものである。
先ず、ステップS41において、所定の8×8画素の平均値の予測誤差を、図3のステップS29で算出した量子化テーブルに基づいて量子化する。
【0031】
次いで、ステップS42において、量子化した予測誤差を逆量子化して誤差を算出し、元の平均値に対して加減算を行うことによって補正をし、新たな平均値を算出する。
【0032】
次いで、新たな平均値とブロック内の64画素とを比較し(ステップS43)、この比較の結果に基づいて、図3のステップS29で求めた8×8画素のブロック用のしきい値内であるか否かを判定する(ステップS44)。しきい値内にある場合には、このサブルーチンを終了し、それに対して、しきい値内にない場合には、ステップS45に進む。
【0033】
次いで、演算数k(この場合4)をセットし(ステップS45)、ステップS42で算出した新たな平均値と、4×4画素のブロックの平均値との差を量子化する(ステップS46)。
【0034】
次いで、ステップS47において、量子化した誤差を逆量子化して誤差を算出し、元の平均値に対して加減算を行うことによって補正をし、新たな平均値(新平均値)を算出する。
【0035】
次いで、新たな平均値とブロック内の16画素とを比較し(ステップS48)、この比較の結果に基づいて、図3のステップS29で求めた4×4画素のブロック用のしきい値内であるか否かを判定する(ステップS49)。しきい値内にない場合には、図6を用いて後に詳細に説明する2×2画素のブロック処理を行った(ステップS50)後、ステップS51に進み、それに対して、しきい値内にある場合には、直接ステップS51に進む。
【0036】
ステップS51において、演算数kから1を減じる。次いで、ステップS52において、4×4画素のブロックの全てについて処理が終了したか否か判定する。処理が終了したと判定した場合、このサブルーチンを終了し、それに対して、処理が終了していないと判定した場合、ステップS46に戻る。
【0037】
図6は、図5のステップS50のサブルーチンのフローチャートである。この場合、先ず、ステップS61において、2×2画素のブロックの処理数L(この場合4)を、パラメータとしてセットする。
【0038】
次いで、ステップS62において、図5のステップS47で算出した4×4画素のブロックの新たな平均値と2×2画素のブロックの平均値の差を量子化する。次いで、ステップS63において、量子化した誤差を逆量子化して誤差を算出し、2×2画素のブロックの平均値に補正を行い、これを新たな平均値(新平均値)とする。
【0039】
次いで、ステップS63で求めた新平均値と2×2画素のブロック内の全画素とを比較し(ステップS64)、全画素値が2×2画素のブロック用のしきい値内に存在するか否か判定する(ステップS65)。全画素値が2×2画素のブロック用のしきい値内に存在しない場合、新平均値と4画素の差をそれぞれ量子化した(ステップS66)後にステップS67に進み、それに対して、全画素値が2×2画素のブロック用のしきい値内に存在する場合、直接ステップS67に進む。
【0040】
なお、図5のステップS41〜S52は、分割された8×8画素のブロック全てに対して行われる。また、各平均値は、2×2画素、4×4画素及び8×8画素のブロックの量子化誤差によって、ステップS1で算出した値から変化するので、8×8画素のブロックのラインごとに発生符号量を参照し、各ブロック内のしきい値及び量子化テーブル番号の設定値を調整する。
【0041】
画像を符号化処理する際に、各画素間の相関を利用して、近傍画素から当該画素の予測値を計算し、実際の画素値との誤差を量子化しただけでは、圧縮率を高くすることができないが、本実施の形態によれば、複数の画素間の相関を予め求め、相関があると判断した場合には、それらの画素値の平均を代表値とし、この処理を比較的大きなブロックに分割して行うことによって実現する。
【0042】
すなわち、符号化処理しうる最大ブロックの中で画素間の相関の度合いを求め、相関があると判断した場合には、そのブロックの画素値の平均を代表値とし、それに対して、相関がないと判断した場合には、そのブロックを分割し、分割したブロックの中で画素間の相関の度合いを求める。
【0043】
ブロックの分割は、相関があると判断されるまで繰り返され、最小ブロックすなわち2×2画素のブロックまで分割しても相関がないと判断した場合には、そのブロックの画素値の平均値の他に、その平均値と各画素との誤差(残差)を量子化する。
【0044】
なお、画像監視システムの受信側における画像復号化処理については、図1のフローチャートと逆の動作を行うことによって行われる。
【0045】
図7〜10は、本発明による画像符号化方法の他の実施の形態の動作のフローチャートである。
先ず、ステップS101において、全画面を8×8画素のブロックに分割したときの全ブロック数Jを設定する。
【0046】
次いで、ステップS102において、8×8画素のブロックの各々の平均値を算出し、ステップS103において、ステップS102で算出した平均値のいわゆる予測誤差を求めて量子化する。
【0047】
次いで、ステップS104において、ステップS103で量子化された予測誤差を補正するために逆量子化を行って予測誤差を新たに求め、ステップS102で算出した平均値と演算することによって求められた新たな平均値(新平均値)を算出する。
【0048】
次いで、ステップS105において、新平均値と各画素との間の誤差の最大値(絶対値)を検出して、第1の誤差テーブル(誤差テーブル1)に保存し、かつ、第1のヒストグラム(ヒストグラム1)に登録する。
【0049】
次いで、全ブロック数Jから1を減算し(ステップS106)、その後、全ブロックの処理すなわち画像全体(1画面)についての処理が終了したか否かを判定する(ステップS107)。処理が終了した場合には、ステップS108に進み、それに対して、処理が終了しない場合には、ステップS102に戻る。
【0050】
ステップS108において、後段に接続される図示しないバッファメモリの前フレーム処理後の空き容量、8×8画素のブロックの平均値データの情報ビット量、ヒストグラム1等から、8×8画素のブロック用のしきい値を算出する。
【0051】
次いで、上記誤差テーブル1と、ステップS108で算出したしきい値とを比較し(ステップS109)、誤差がしきい値内であるか否か判断する(ステップS110)。誤差がしきい値内である場合、8×8画素のブロックの平均値を代表値とし、後に説明するステップS118までスキップする。
【0052】
誤差がしきい値内でない場合、4×4画素のブロックの処理のために、ステップS111において、8×8画素のブロックを4×4画素のブロックに分割したときのブロック数kとして4を設定する。
【0053】
次いで、ステップS112において、4×4画素のブロックの各々の平均値を算出し、ステップS113において、ステップS104で算出した8×8画素のブロックの新平均値とステップS112で算出した平均値の誤差を求めて量子化する。
【0054】
次いで、ステップS114において、ステップS113で量子化された誤差を補正するために逆量子化を行って誤差を新たに求め、ステップS112で算出した平均値と演算することによって求められた新たな平均値(新平均値)を算出する。
【0055】
次いで、ステップS115において、新平均値と各画素との間の誤差の最大値(絶対値)を検出して、第2の誤差テーブル(誤差テーブル2)に保存し、かつ、第2のヒストグラム(ヒストグラム2)に登録する。
【0056】
次いで、ブロック数kから1を減算し(ステップS116)、その後、4×4画素のブロックについての処理が終了したか否かを判定する(ステップS117)。処理が終了した場合には、ステップS118に進み、それに対して、処理が終了しない場合には、ステップS112に戻る。
【0057】
4×4画素のブロックについての処理が終了した場合又はステップS110においてしきい値が誤差より大きいと判定された場合、ステップS118において、全ブロックについての処理が終了したか否かを判定する。
【0058】
ステップS119において、バッファメモリの前フレーム処理後の空き容量、4×4画素のブロックの平均値データの情報ビット量、ヒストグラム2等から、4×4画素のブロック用のしきい値を算出する。
【0059】
次いで、上記誤差テーブル2と、ステップS119で算出したしきい値とを比較し(ステップS120)、誤差がしきい値内であるか否か判断する(ステップS121)。誤差がしきい値内である場合、4×4画素のブロックの平均値を代表値とし、後に説明するステップS129までスキップする。
【0060】
誤差がしきい値内でない場合、2×2画素のブロックの処理のために、ステップS122において、4×4画素のブロックを2×2画素のブロックに分割したときのブロック数lとして4を設定する。
【0061】
次いで、ステップS123において、2×2画素のブロックの各々の平均値を算出し、ステップS124において、ステップS114で算出した4×4画素のブロックの新平均値とステップS123で算出した平均値の誤差を求めて量子化する。
【0062】
次いで、ステップS125において、ステップS124で量子化された誤差を補正するために逆量子化を行って誤差を新たに求め、ステップS123で算出した平均値と演算することによって求められた新たな平均値(新平均値)を算出する。
【0063】
次いで、ステップS126において、新平均値と各画素との間の誤差の最大値(絶対値)を検出して第3の誤差テーブル(誤差テーブル3)に保存し、かつ、第3のヒストグラム(ヒストグラム3)に登録する。
【0064】
次いで、ブロック数lから1を減算し(ステップS127)、その後、2×2画素のブロックについての処理が終了したか否かを判定する(ステップS128)。処理が終了した場合には、ステップS129に進み、それに対して、処理が終了しない場合には、ステップS123に戻る。
【0065】
2×2画素のブロックについての処理が終了した場合又はステップS121においてしきい値が誤差より大きいと判定された場合、ステップS129において、4×4画素のブロックの全てについての処理が終了したか否かを判定する。
【0066】
ステップS130において、バッファメモリの前フレーム処理後の空き容量、2×2画素のブロックの平均値データの情報ビット量、ヒストグラム3等から、2×2画素のブロック用のしきい値を算出する。
【0067】
次いで、上記誤差テーブル3と、ステップS130で算出したしきい値とを比較し(ステップS131)、誤差がしきい値内であるか否か判断する(ステップS132)。誤差がしきい値内である場合、2×2画素のブロックの平均値を代表値とし、後に説明するステップS134までスキップする。
【0068】
誤差がしきい値内でない場合、新平均値と各画素の誤差を量子化し(ステップS133)、その後、2×2画素のブロックの全てについての処理が終了したか否かを判定する(ステップS134)。処理が終了した場合には、この制御ルーチンを終了し、それに対して、処理が終了しない場合には、ステップS131に戻る。
【0069】
なお、画像監視システムの受信側における画像復号化処理については、図7〜10のフローチャートと逆の動作を行うことによって行われる。
【0070】
図11は、本発明による画像符号化装置の実施の形態のブロック図である。この画像符号化装置は、例えば、画像監視システムの送信側に適用され、入力部1と、8×8ブロック入力回路2aと、4×4ブロック入力回路2bと、2×2ブロック入力回路2cと、平均値算出回路3a,3b,3cと、予測誤差量子化器4a,4b,4cと、予測誤差逆量子化器及び新平均値算出回路5a,5b,5cと、誤差算出回路6a,6b,6cと、誤差比較回路7a,7b,7cと、量子化器8と、制御器9と、切替器10とを具える。
【0071】
本実施の形態の動作を説明する。入力部1には、図示しない監視カメラからのデジタル化された画像信号が入力され、8×8ブロック入力回路2aは、その画像を8×8画素のブロックに分割する。
【0072】
平均値算出回路3aは、分割されたブロック中の画素値の平均値を算出する。8×8の64画素の平均値は、加算及びシフト演算によって求めることができるので、平均値算出回路3aを、簡単な回路で構成することができる。
【0073】
予測誤差量子化器4aは、算出された平均値からいわゆる予測誤差を求め、それを量子化する。予測誤差量子化器による量子化によって、データのビット数が削減される。
【0074】
予測誤差逆量子化器及び新平均値算出回路5aは、量子化された誤差を逆量子化して誤差を求め、平均値算出回路3aで算出した平均値にその誤差を加算又は減算して、新たな平均値を算出する。
【0075】
誤差算出回路6aは、新たな平均値とブロック内の全画素値とを比較することによって誤差を算出し、誤差比較回路7aはそれぞれ、誤差算出回路6aで求めた誤差としきい値との比較を行う。誤差がしきい値内である場合、8×8画素のブロックの平均値を代表値とし、予測誤差量子化器4aの出力を切替器10を通じて出力するように制御器9を制御する。それに対して、誤差がしきい値外である場合、8×8画素のブロックを4×4ブロック入力回路2b以降で処理する。
【0076】
4×4ブロック入力回路2bは、8×8画素のブロックを更に半分に分割し、すなわち、水平方向に4画素及び垂直方向に4画素を有する4×4画素のブロックに分割する。
【0077】
平均値算出回路3bは、分割されたブロック中の画素値の平均値を算出する。4×4の16画素の平均値も、加算及びシフト演算によって求めることができるので、平均値算出回路3bも簡単な回路で構成することができる。
【0078】
予測誤差量子化器4bは、算出された平均値からいわゆる予測誤差を求め、それを量子化する。予測誤差量子化器4bによる量子化によって、データのビット数が削減される(又は、新平均値算出回路5aの新平均値との差を量子化する)。
【0079】
予測誤差逆量子化器及び新平均値算出回路5bは、量子化された誤差を逆量子化して誤差を求め、平均値算出回路3bで算出した平均値にその誤差を加算又は減算して、新たな平均値を算出する。
【0080】
誤差算出回路6bは、新たな平均値とブロック内の全画素値とを比較することによって誤差を算出し、誤差比較回路7bはそれぞれ、誤差算出回路6bで求めた誤差としきい値との比較を行う。誤差がしきい値内である場合、4×4画素のブロックの平均値を代表値とし、予測誤差量子化器4bの出力を切替器10を通じて出力するように制御器9を制御する。それに対して、誤差がしきい値外である場合、4×4画素のブロックを2×2ブロック入力回路2c以降で処理する。
【0081】
2×2ブロック入力回路2cは、4×4画素のブロックを更に半分に分割し、すなわち、水平方向に2画素及び垂直方向に2画素を有する2×2画素のブロックに分割する。
【0082】
平均値算出回路3cは、分割されたブロック中の画素値の平均値を算出する。2×2の4画素の平均値も、加算及びシフト演算によって求めることができるので、平均値算出回路3cも簡単な回路で構成することができる。
【0083】
予測誤差量子化器4cは、算出された平均値からいわゆる予測誤差を求め、それを量子化する。予測誤差量子化器4cによる量子化によって、データのビット数が削減される(又は、新平均値算出回路5bの新平均値との差を量子化する)。
【0084】
予測誤差逆量子化器及び新平均値算出回路5cは、量子化された誤差を逆量子化して誤差を求め、平均値算出回路3cで算出した平均値にその誤差を加算又は減算して、新たな平均値を算出する。
【0085】
誤差算出回路6cは、新たな平均値とブロック内の全画素値とを比較することによって誤差を算出し、誤差比較回路7cはそれぞれ、誤差算出回路6cで求めた誤差としきい値との比較を行う。誤差がしきい値内である場合、2×2画素のブロックの平均値を代表値とし、予測誤差量子化器4cの出力を切替器10を通じて出力するように制御器9を制御する。それに対して、誤差がしきい値外である場合、量子化器8は、誤差算出回路6cで算出された誤差を量子化する。
【0086】
切替器10から出力された信号は、受信側において、図11に示す素子と同様な素子によって構成された画像復号化装置に入力され、図11に示す画像符号化装置の動作と逆の動作を行うことによって、復号化され、例えばモニタに出力される。
【0087】
上記実施の形態によれば、監視カメラの画像における道路や壁のような平坦で変化の少ない部分については、8×8画素のブロックの処理を行い、変化の多い部分については、2×2画素のブロックの処理を行うことによって、好適な画像監視システムを構成することができる。
【0088】
また、平坦な画像が比較的多い場合、8×8画素のブロックよりも大きなブロック、例えば16×16画素のブロックの処理を行うことによって、高圧縮伝送システムを構成することができる。
【0089】
本発明は、上記実施の形態に限定されるものではなく、幾多の変更及び変形が可能である。
例えば、本発明による画像符号化方法及びその装置を、任意の伝送システムの送信側で使用することができ、対応する画像復号化方法及び装置を、対応するシステムの受信側で使用することができる。
【0090】
また、8×8画素のブロック、4×4画素のブロック及び2×2画素のブロックの順に処理したが、本発明を、2×2画素のブロック(n:自然数)に対して適用することができ、例えば、16×16画素のブロック、8×8画素のブロック、4×4画素のブロック及び2×2画素のブロックの順に処理することもできる。
【0091】
上記実施の形態では、8×8画素のブロック、4×4画素のブロック及び2×2画素のブロックの平均値データを量子化し、可変長ビットに変換する処理を行ったが、量子化を行うことなく固定長ビットで送出を行うことによって、演算量を減少させることもできる。
【0092】
さらに、フレーム内処理の場合について説明したが、フレーム間処理を組み合わせることもできる。すなわち、任意の大きさのブロックを処理するに際し、前フレームとの比較を行う処理を挿入することによって、フレーム間処理を容易に追加することができる。
【図面の簡単な説明】
【図1】本発明による画像符号化方法の実施の形態のフローチャートである。
【図2】図1のステップS1のサブルーチンの一部のフローチャートである。
【図3】図1のステップS1のサブルーチンの一部のフローチャートである。
【図4】平均値と各画素の差の絶対値とブロック数との関係を示す図である。
【図5】図1のステップS3のサブルーチンのフローチャートである。
【図6】図5のステップS50のサブルーチンのフローチャートである。
【図7】本発明による画像符号化方法の他の実施の形態の動作のフローチャートの一部である。
【図8】本発明による画像符号化方法の他の実施の形態の動作のフローチャートの一部である。
【図9】本発明による画像符号化方法の他の実施の形態の動作のフローチャートの一部である。
【図10】本発明による画像符号化方法の他の実施の形態の動作のフローチャートの一部である。
【図11】本発明による画像符号化装置の実施の形態のブロック図である。
【符号の説明】
1 入力部
2a 8×8ブロック入力回路
2b 4×4ブロック入力回路
2c 2×2ブロック入力回路
3a,3b,3c 平均値算出回路
4a,4b,4c 予測誤差量子化器
5a,5b,5c 予測誤差逆量子化器及び新平均値算出回路
6a,6b,6c 誤差算出回路
7a,7b,7c 誤差比較回路
8 量子化器
9 制御器
10 切替器
[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to an image encoding method and apparatus for encoding and processing image signals for transmission and storage, which are applied to videophones, surveillance cameras, and the like.
[0002]
[Prior art]
As a general compression standard for image signals, JPEG has been proposed for still images, and MPEG has been proposed for moving images. Typical image compression methods include predictive coding and vector quantization, in addition to orthogonal transform using DCT employed in JPEG and MPEG.
[0003]
In the case of MPEG, although the compression ratio is high, the amount of calculation is large due to the use of motion compensation (prediction) and DCT, and when executed by hardware, it is necessary to use dedicated hardware. For execution, it is necessary to use a high-performance CPU.
[0004]
Also, in the case of a profile using a B picture (Bidirectional predictive coded image), the amount of delay is large, and it is difficult to apply to a conversation such as a videophone.
[0005]
Predictive coding is coding that predicts the pixel value from pixels adjacent to each other and quantizes the prediction error.In this case, it is necessary to reduce the number of quantization levels as the compression ratio increases. As a result, the image quality is significantly deteriorated.
[0006]
Vector quantization is a method of replacing a plurality of pixel values with a predetermined representative vector, and is effective when the input image has a characteristic such as a videophone. Is input, it is difficult to generate a codebook (encoded data, that is, a table).
[0007]
[Problems to be solved by the invention]
As described above, DCT used in MPEG or the like has disadvantages in that complicated addition, subtraction, multiplication, and division operations are performed and the amount of operation is enormous. Further, in the case of predictive coding, when the compression ratio is increased, the deterioration of image quality becomes remarkable, and in the case of vector quantization, special data (codebook) is required.
[0008]
SUMMARY OF THE INVENTION An object of the present invention is to provide an image encoding method and an image encoding apparatus capable of encoding an image of high quality and a high compression rate with a simple and small operation amount without requiring special data. is there.
[0009]
[Means for Solving the Problems]
The image encoding method according to the present invention comprises:
An image encoding method for encoding and transmitting an image signal, comprising:
The entire screen is divided into predetermined pixel units,
Calculating the average of the pixel values in the block,
Calculating the error between the pixel value and the average value,
Based on whether these errors are within a predetermined value, determine whether to encode the block or to further divide the block,
It is characterized in that the encoding process is performed in an appropriate pixel unit block according to the result of the determination.
[0010]
According to the present invention, it is determined whether to perform encoding of a block divided into predetermined pixel units or to further divide a block, and perform encoding processing on an appropriate pixel unit block according to the result of the determination. Since it is performed, complicated addition, subtraction, multiplication, division, and an enormous amount of operation such as DCT are not required. Further, since it is not necessary to reduce the number of quantization levels as the compression rate is increased unlike in predictive coding, it is possible to perform high quality and high compression coding. Furthermore, no special data is required as in vector quantization.
[0011]
Preferably, a histogram is created in which the maximum value of the absolute value of the difference between the average value of the block and the pixel value in the block is obtained for each block, and the predetermined value is calculated from the histogram.
[0012]
An image encoding device according to the present invention includes:
An image encoding device for encoding and transmitting an image signal,
Block dividing means for dividing the entire screen into blocks of a predetermined pixel unit,
Average value calculation means for calculating an average value of pixel values in the block,
Error calculating means for calculating an error between the pixel value and the average value,
A determination unit configured to determine whether to encode the block or to further divide the block, based on whether these errors are within a predetermined value;
Encoding means for performing an encoding process on an appropriate pixel unit block according to the result of the determination.
[0013]
According to the present invention, it is possible to perform high-quality and high-compression encoding without requiring complicated addition, subtraction, multiplication, division, and an enormous amount of computation such as DCT, and does not require special data.
[0014]
BEST MODE FOR CARRYING OUT THE INVENTION
An embodiment of an image encoding method and an image encoding apparatus according to the present invention will be described in detail with reference to the drawings.
[0015]
FIG. 1 is a flowchart of the operation of the embodiment of the image encoding method according to the present invention. In this case, the entire screen is divided into blocks having 8 pixels in the horizontal direction and 8 pixels in the vertical direction, that is, blocks of 8 × 8 pixels, and the block of 8 × 8 pixels thus divided is used as a reference. .
[0016]
The control routine shown in FIG. 1 is executed, for example, on the transmission side of the image monitoring system. First, in step S1, a threshold value for determination processing is calculated as preprocessing for encoding. Step S1 will be described later in detail with reference to FIGS.
[0017]
Next, in step S2, the number J of all blocks when the entire screen is divided into blocks of 8 × 8 pixels is set. The total number of blocks J is determined by the number of vertical and horizontal pixels. Next, in step S3, processing of an 8 × 8 pixel block, which will be described later in detail with reference to FIG. 5, is performed.
[0018]
Next, 1 is subtracted from the total number of blocks J (step S4), and thereafter, it is determined whether or not the processing of all the blocks is completed (step S5). If the processing has been completed, this routine ends. If not, the processing returns to step S3.
[0019]
FIG. 2 is a flowchart of the first half of the subroutine of step S1 in FIG. 1, and FIG. 3 is a flowchart of the second half of the subroutine of step S1 in FIG. In this embodiment, the reference block is composed of 8 × 8 pixel blocks. Since processing is performed on the basis of an 8 × 8 pixel block, the block is divided into 4 × 4 pixel blocks if it is divided in half vertically and horizontally, and further divided into 2 × 2 pixel blocks if it is further divided into half. Will be done. The subroutine in FIGS. 2 and 3 calculates the average value and the threshold value by proceeding with the calculation of the block of 4 × 4 pixels and the block of 8 × 8 pixels based on the block of 2 × 2 pixels.
[0020]
First, in steps S11 to S13, the number of all blocks J, the number of operations k for a block of 4 × 4 pixels, and the number of operations 1 for a block of 2 × 2 pixels are set as parameters. In this case, the numbers of operations k and l are both 4.
[0021]
Next, in step S14, the average value of the block of 2 × 2 pixels when the block of 8 × 8 pixels is divided into the block of 2 × 2 pixels is calculated. Since there are 2 × 2 pixels, the number of pixels is four. In order to obtain an average value of four pixels, it is sufficient to sum these pixel values and then divide by four. The division by 4 does not require a divider having a complicated configuration, since the digital calculation only requires shifting by 2 bits to the right. That is, if the pixel values are A1, A2, A3, and A4, respectively, the first average value (average value 2) is 1 / (A1 + A2 + A3 + A4).
[0022]
Next, the absolute value of the difference between the average value 2 and each pixel is obtained (step S15), the maximum value of the obtained absolute values of the four differences is detected, and a first histogram (described later) is used. Histogram 1) is registered (step S16), 1 is subtracted from the number of operations l (step S17), and whether or not the number of operations 1 is 0, that is, the processing is completed for all blocks of 2 × 2 pixels Is determined. If the process has been completed, the process proceeds to the next step S19, whereas if the process has not been completed, the process returns to step S14.
[0023]
In step S19, the average value of the 4 × 4 pixel block is calculated using the processing result of the 2 × 2 pixel block. Since there are 4 × 4 pixels, the number of pixels is 16. In order to obtain the average value of 16 pixels, it is sufficient to use the above average value 2 to obtain the average of four 2 × 2 pixel blocks. Assuming that the average value of the four 2 × 2 pixel blocks is B1, B2, B3, and B4, the second average value (average value 4) is 1 / (B1 + B2 + B3 + B4).
[0024]
Next, the absolute value of the difference between the average value 4 and each pixel is obtained (step S20), the maximum value of the obtained absolute values of the four differences is detected, and a second histogram (described later) Histogram 2) is registered (step S21), 1 is subtracted from the number of operations k (step S22), and whether or not the number of operations k is 0, that is, processing is completed for all blocks of 4 × 4 pixels Is determined. If the process has been completed, the process proceeds to the next step S24, whereas if the process has not been completed, the process returns to step S13.
[0025]
Next, in step S24, the average value of the block of 8 × 8 pixels is calculated using the processing result of the block of 4 × 4 pixels. Since there are 8 × 8 pixels, the number of pixels is 64. In order to calculate the average value of 64 pixels, it is sufficient to calculate the average of four 4 × 4 pixel blocks using the average value 4 described above. Assuming that the average value of the four 4 × 4 pixel blocks is C1, C2, C3, and C4, the third average value (average value 8) is と (C1 + C2 + C3 + C4).
[0026]
Next, the absolute value of the difference between the average value 8 and each pixel is obtained (step S25), the maximum value of the obtained absolute values of the 64 differences is detected, and a third histogram (to be described later) is used. It is registered in the histogram 3) (step S26).
[0027]
Next, in step S27, 1 is subtracted from the total number J of blocks, and in step S28, it is determined whether the processing has been completed for all blocks, that is, the entire image (one screen). If the processing has been completed, the process proceeds to step S29. If the processing has not been completed, the process returns to step S12.
[0028]
In step S29, a threshold value and a quantization table number to be used in the subsequent processing are determined from the histograms 1, 2, and 3 and the free space after the previous frame processing in a buffer memory (not shown) connected to the subsequent stage, This subroutine ends.
[0029]
In this case, the threshold value is determined from the distribution of the histograms 1, 2, and 3 obtained as shown in FIG. 4, and is used for the block of 8 × 8 pixels, the block of 4 × 4 pixels, and the block of 2 × 2 pixels. Three types are required. Further, three types of quantization table numbers for quantizing the average value 8, the average value 4, and the average value 2 are determined.
[0030]
FIG. 5 is a flowchart of a subroutine of step S3 in FIG. This subroutine performs quantization in order to perform variable length coding.
First, in step S41, a prediction error of an average value of predetermined 8 × 8 pixels is quantized based on the quantization table calculated in step S29 of FIG.
[0031]
Next, in step S42, the quantized prediction error is inversely quantized to calculate the error, and the original average is corrected by performing addition and subtraction to calculate a new average.
[0032]
Next, the new average value is compared with the 64 pixels in the block (step S43), and based on the result of this comparison, within the threshold value for the block of 8 × 8 pixels obtained in step S29 in FIG. It is determined whether or not there is (step S44). If it is within the threshold value, this subroutine ends. If it is not within the threshold value, the process proceeds to step S45.
[0033]
Next, the number of operations k (in this case, 4) is set (step S45), and the difference between the new average value calculated in step S42 and the average value of the block of 4 × 4 pixels is quantized (step S46).
[0034]
Next, in step S47, the quantized error is inversely quantized to calculate the error, and the original average is corrected by performing addition and subtraction to calculate a new average (new average).
[0035]
Next, the new average value is compared with the 16 pixels in the block (step S48), and based on the result of this comparison, within the threshold value for the 4 × 4 pixel block obtained in step S29 in FIG. It is determined whether or not there is (step S49). If it is not within the threshold value, block processing of 2 × 2 pixels, which will be described in detail later with reference to FIG. 6, is performed (step S50), and then the process proceeds to step S51. If there is, the process directly proceeds to step S51.
[0036]
In step S51, 1 is subtracted from the number of operations k. Next, in step S52, it is determined whether or not the processing has been completed for all of the 4 × 4 pixel blocks. If it is determined that the processing has been completed, this subroutine is completed. If it is determined that the processing has not been completed, the process returns to step S46.
[0037]
FIG. 6 is a flowchart of a subroutine of step S50 in FIG. In this case, first, in step S61, the processing number L (4 in this case) of a block of 2 × 2 pixels is set as a parameter.
[0038]
Next, in step S62, the difference between the new average value of the 4 × 4 pixel block calculated in step S47 of FIG. 5 and the average value of the 2 × 2 pixel block is quantized. Next, in step S63, the quantized error is inversely quantized to calculate the error, the average value of the block of 2 × 2 pixels is corrected, and this is set as a new average value (new average value).
[0039]
Next, the new average value obtained in step S63 is compared with all the pixels in the 2 × 2 pixel block (step S64), and whether all the pixel values are within the threshold value for the 2 × 2 pixel block. It is determined whether or not it is (step S65). If all the pixel values are not within the threshold value for the block of 2 × 2 pixels, the difference between the new average value and the four pixels is quantized (step S66), and then the process proceeds to step S67. If the value is within the threshold value for the block of 2 × 2 pixels, the process directly proceeds to step S67.
[0040]
Steps S41 to S52 in FIG. 5 are performed on all the divided blocks of 8 × 8 pixels. Each average value changes from the value calculated in step S1 due to the quantization error of the 2 × 2 pixel, 4 × 4 pixel, and 8 × 8 pixel blocks. The set values of the threshold value and the quantization table number in each block are adjusted with reference to the generated code amount.
[0041]
When encoding an image, using the correlation between each pixel, the prediction value of the pixel is calculated from the neighboring pixels, and simply quantizing the error from the actual pixel value increases the compression ratio. However, according to the present embodiment, the correlation between a plurality of pixels is obtained in advance, and if it is determined that there is a correlation, the average of those pixel values is used as a representative value, and this processing is performed with a relatively large value. This is realized by dividing into blocks.
[0042]
That is, the degree of correlation between pixels in the largest block that can be encoded is obtained, and when it is determined that there is a correlation, the average of the pixel values of the block is used as a representative value, and there is no correlation. If it is determined, the block is divided and the degree of correlation between pixels in the divided block is determined.
[0043]
The block division is repeated until it is determined that there is a correlation, and if it is determined that there is no correlation even if the block is divided into the smallest block, that is, a block of 2 × 2 pixels, other than the average pixel value of the block, Next, the error (residual error) between the average value and each pixel is quantized.
[0044]
Note that the image decoding process on the receiving side of the image monitoring system is performed by performing an operation reverse to the flowchart of FIG.
[0045]
7 to 10 are flowcharts of the operation of another embodiment of the image encoding method according to the present invention.
First, in step S101, the number J of all blocks when the entire screen is divided into blocks of 8 × 8 pixels is set.
[0046]
Next, in step S102, an average value of each of the 8 × 8 pixel blocks is calculated, and in step S103, a so-called prediction error of the average value calculated in step S102 is obtained and quantized.
[0047]
Next, in step S104, a new prediction error is obtained by performing inverse quantization to correct the prediction error quantized in step S103, and the new prediction error obtained by calculating with the average value calculated in step S102. Calculate the average value (new average value).
[0048]
Next, in step S105, the maximum value (absolute value) of the error between the new average value and each pixel is detected and stored in the first error table (error table 1), and the first histogram (error table 1) is used. Register in histogram 1).
[0049]
Next, 1 is subtracted from the total block number J (step S106), and thereafter, it is determined whether or not the processing for all blocks, that is, the processing for the entire image (one screen) is completed (step S107). When the process is completed, the process proceeds to step S108, whereas when the process is not completed, the process returns to step S102.
[0050]
In step S108, based on the free space after the previous frame processing of the buffer memory (not shown) connected to the subsequent stage, the information bit amount of the average value data of the 8 × 8 pixel block, the histogram 1, and the like, the 8 × 8 pixel block Calculate the threshold.
[0051]
Next, the error table 1 is compared with the threshold calculated in step S108 (step S109), and it is determined whether or not the error is within the threshold (step S110). If the error is within the threshold value, the average value of the block of 8 × 8 pixels is set as the representative value, and the process skips to step S118 described later.
[0052]
If the error is not within the threshold value, 4 is set as the number k of blocks when the 8 × 8 pixel block is divided into 4 × 4 pixel blocks in step S111 for processing of 4 × 4 pixel blocks. I do.
[0053]
Next, in step S112, the average value of each of the 4 × 4 pixel blocks is calculated, and in step S113, the error between the new average value of the 8 × 8 pixel block calculated in step S104 and the average value calculated in step S112. And quantize.
[0054]
Next, in step S114, a new error is obtained by performing inverse quantization to correct the error quantized in step S113, and the new average value obtained by calculating with the average value calculated in step S112. (New average).
[0055]
Next, in step S115, the maximum value (absolute value) of the error between the new average value and each pixel is detected and stored in the second error table (error table 2), and the second histogram (error table 2) is used. Register in histogram 2).
[0056]
Next, 1 is subtracted from the number k of blocks (step S116), and thereafter, it is determined whether or not the processing on the block of 4 × 4 pixels has been completed (step S117). If the process has been completed, the process proceeds to step S118, whereas if not, the process returns to step S112.
[0057]
When the processing for the block of 4 × 4 pixels is completed, or when it is determined in step S110 that the threshold value is larger than the error, in step S118, it is determined whether the processing for all blocks is completed.
[0058]
In step S119, a threshold value for the block of 4 × 4 pixels is calculated from the free space of the buffer memory after the previous frame processing, the information bit amount of the average value data of the block of 4 × 4 pixels, the histogram 2, and the like.
[0059]
Next, the error table 2 is compared with the threshold calculated in step S119 (step S120), and it is determined whether or not the error is within the threshold (step S121). If the error is within the threshold, the average value of the block of 4 × 4 pixels is set as the representative value, and the process skips to step S129 described later.
[0060]
If the error is not within the threshold value, 4 is set as the number l of blocks when the 4 × 4 pixel block is divided into 2 × 2 pixel blocks in step S122 for processing of the 2 × 2 pixel block. I do.
[0061]
Next, in step S123, the average value of each of the 2 × 2 pixel blocks is calculated. In step S124, the error between the new average value of the 4 × 4 pixel block calculated in step S114 and the average value calculated in step S123. And quantize.
[0062]
Next, in step S125, a new error is obtained by performing inverse quantization to correct the error quantized in step S124, and the new average value obtained by calculating the error with the average value calculated in step S123. (New average).
[0063]
Next, in step S126, the maximum value (absolute value) of the error between the new average value and each pixel is detected and stored in the third error table (error table 3), and the third histogram (histogram) Register in 3).
[0064]
Next, 1 is subtracted from the number of blocks l (step S127), and thereafter, it is determined whether or not the processing for the block of 2 × 2 pixels has been completed (step S128). If the process has been completed, the process proceeds to step S129. If the process has not been completed, the process returns to step S123.
[0065]
When the processing for the block of 2 × 2 pixels is completed or when it is determined in step S121 that the threshold value is larger than the error, whether or not the processing for all the blocks of 4 × 4 pixels is completed in step S129 Is determined.
[0066]
In step S130, a threshold value for a 2 × 2 pixel block is calculated from the free space of the buffer memory after the previous frame processing, the information bit amount of the average value data of the 2 × 2 pixel block, the histogram 3, and the like.
[0067]
Next, the error table 3 is compared with the threshold calculated in step S130 (step S131), and it is determined whether or not the error is within the threshold (step S132). When the error is within the threshold value, the average value of the block of 2 × 2 pixels is set as the representative value, and the process skips to step S134 described later.
[0068]
If the error is not within the threshold value, the error between the new average value and each pixel is quantized (step S133), and thereafter, it is determined whether or not the processing has been completed for all the 2 × 2 pixel blocks (step S134). ). When the process is completed, the control routine is terminated. When the process is not completed, the process returns to step S131.
[0069]
Note that the image decoding process on the receiving side of the image monitoring system is performed by performing an operation reverse to the flowcharts of FIGS.
[0070]
FIG. 11 is a block diagram of an embodiment of an image encoding device according to the present invention. This image coding apparatus is applied, for example, to the transmission side of an image monitoring system, and includes an input unit 1, an 8 × 8 block input circuit 2a, a 4 × 4 block input circuit 2b, and a 2 × 2 block input circuit 2c. , Average value calculation circuits 3a, 3b, 3c, prediction error quantizers 4a, 4b, 4c, prediction error inverse quantizer and new average value calculation circuits 5a, 5b, 5c, error calculation circuits 6a, 6b, 6c, error comparison circuits 7a, 7b, 7c, a quantizer 8, a controller 9, and a switch 10.
[0071]
The operation of the present embodiment will be described. A digitized image signal from a surveillance camera (not shown) is input to the input unit 1, and the 8 × 8 block input circuit 2a divides the image into blocks of 8 × 8 pixels.
[0072]
The average value calculation circuit 3a calculates an average value of the pixel values in the divided blocks. Since the average value of 64 8 × 8 pixels can be obtained by addition and shift operations, the average value calculation circuit 3a can be configured with a simple circuit.
[0073]
The prediction error quantizer 4a obtains a so-called prediction error from the calculated average value and quantizes it. The number of data bits is reduced by the quantization by the prediction error quantizer.
[0074]
The prediction error inverse quantizer and the new average value calculation circuit 5a inversely quantizes the quantized error to obtain an error, and adds or subtracts the error to or from the average value calculated by the average value calculation circuit 3a to newly calculate the error. Calculate the average value.
[0075]
The error calculation circuit 6a calculates an error by comparing the new average value with all pixel values in the block, and the error comparison circuit 7a compares the error obtained by the error calculation circuit 6a with the threshold value. Do. If the error is within the threshold value, the controller 9 is controlled to output the output of the prediction error quantizer 4 a through the switch 10 using the average value of the block of 8 × 8 pixels as the representative value. On the other hand, when the error is outside the threshold, the block of 8 × 8 pixels is processed by the 4 × 4 block input circuit 2b and thereafter.
[0076]
The 4 × 4 block input circuit 2b further divides the block of 8 × 8 pixels into half, that is, the block of 4 × 4 pixels having 4 pixels in the horizontal direction and 4 pixels in the vertical direction.
[0077]
The average value calculation circuit 3b calculates an average value of pixel values in the divided blocks. Since the average value of 4 × 4 16 pixels can also be obtained by addition and shift operation, the average value calculation circuit 3b can also be constituted by a simple circuit.
[0078]
The prediction error quantizer 4b obtains a so-called prediction error from the calculated average value and quantizes it. The quantization by the prediction error quantizer 4b reduces the number of data bits (or quantizes the difference from the new average value of the new average value calculation circuit 5a).
[0079]
The prediction error inverse quantizer and the new average value calculation circuit 5b inversely quantize the quantized error to obtain an error, and add or subtract the error to or from the average value calculated by the average value calculation circuit 3b, and Calculate the average value.
[0080]
The error calculation circuit 6b calculates an error by comparing the new average value with all pixel values in the block, and the error comparison circuit 7b compares the error obtained by the error calculation circuit 6b with the threshold value. Do. When the error is within the threshold value, the controller 9 is controlled such that the average value of the block of 4 × 4 pixels is set as the representative value, and the output of the prediction error quantizer 4 b is output through the switch 10. On the other hand, if the error is outside the threshold, the block of 4 × 4 pixels is processed by the 2 × 2 block input circuit 2c and thereafter.
[0081]
The 2 × 2 block input circuit 2c further divides the block of 4 × 4 pixels into halves, that is, the block of 2 × 2 pixels having two pixels in the horizontal direction and two pixels in the vertical direction.
[0082]
The average value calculation circuit 3c calculates an average value of the pixel values in the divided blocks. Since the average value of 2 × 2 four pixels can also be obtained by addition and shift operation, the average value calculation circuit 3c can also be constituted by a simple circuit.
[0083]
The prediction error quantizer 4c obtains a so-called prediction error from the calculated average value and quantizes it. By the quantization by the prediction error quantizer 4c, the number of data bits is reduced (or the difference from the new average value of the new average value calculation circuit 5b is quantized).
[0084]
The prediction error inverse quantizer and the new average value calculation circuit 5c inversely quantize the quantized error to obtain an error, and add or subtract the error to or from the average value calculated by the average value calculation circuit 3c, Calculate the average value.
[0085]
The error calculation circuit 6c calculates an error by comparing the new average value with all pixel values in the block, and the error comparison circuit 7c compares the error obtained by the error calculation circuit 6c with the threshold value. Do. When the error is within the threshold value, the controller 9 is controlled to output the output of the prediction error quantizer 4c through the switch 10 using the average value of the block of 2 × 2 pixels as the representative value. On the other hand, if the error is outside the threshold, the quantizer 8 quantizes the error calculated by the error calculation circuit 6c.
[0086]
The signal output from the switch 10 is input on the receiving side to an image decoding device composed of elements similar to the elements shown in FIG. 11, and performs an operation opposite to the operation of the image encoding device shown in FIG. By doing so, it is decoded and output to, for example, a monitor.
[0087]
According to the above embodiment, a flat and small change portion such as a road or a wall in the image of the surveillance camera is processed by a block of 8 × 8 pixels, and a portion with a large change is 2 × 2 pixels. By performing the processing of the above blocks, a suitable image monitoring system can be configured.
[0088]
In the case where the number of flat images is relatively large, a high compression transmission system can be configured by performing processing of a block larger than a block of 8 × 8 pixels, for example, a block of 16 × 16 pixels.
[0089]
The present invention is not limited to the above embodiment, and many modifications and variations are possible.
For example, the image coding method and device according to the present invention can be used on the transmission side of any transmission system, and the corresponding image decoding method and device can be used on the reception side of the corresponding system. .
[0090]
In addition, the processing was performed in the order of the block of 8 × 8 pixels, the block of 4 × 4 pixels, and the block of 2 × 2 pixels. n × 2 n It can be applied to a block of pixels (n: natural number). For example, processing is performed in the order of a block of 16 × 16 pixels, a block of 8 × 8 pixels, a block of 4 × 4 pixels, and a block of 2 × 2 pixels. You can also.
[0091]
In the above embodiment, the process of quantizing the average value data of the 8 × 8 pixel block, the 4 × 4 pixel block, and the 2 × 2 pixel block and converting the data into variable-length bits is performed. By performing transmission using fixed-length bits without performing such operations, the amount of calculation can be reduced.
[0092]
Further, the case of the intra-frame processing has been described, but the inter-frame processing may be combined. That is, when processing a block of an arbitrary size, an inter-frame process can be easily added by inserting a process for comparing with a previous frame.
[Brief description of the drawings]
FIG. 1 is a flowchart of an embodiment of an image encoding method according to the present invention.
FIG. 2 is a flowchart of a part of a subroutine of step S1 in FIG.
FIG. 3 is a flowchart of a part of a subroutine of step S1 in FIG. 1;
FIG. 4 is a diagram illustrating a relationship between an average value, an absolute value of a difference between pixels, and the number of blocks.
FIG. 5 is a flowchart of a subroutine of step S3 in FIG. 1;
FIG. 6 is a flowchart of a subroutine of step S50 in FIG.
FIG. 7 is a part of a flowchart of an operation of another embodiment of the image encoding method according to the present invention.
FIG. 8 is a part of a flowchart of an operation of another embodiment of the image encoding method according to the present invention.
FIG. 9 is a part of a flowchart of an operation of another embodiment of the image encoding method according to the present invention.
FIG. 10 is a part of a flowchart of an operation of another embodiment of the image encoding method according to the present invention.
FIG. 11 is a block diagram of an embodiment of an image encoding device according to the present invention.
[Explanation of symbols]
1 Input section
2a 8 × 8 block input circuit
2b 4 × 4 block input circuit
2c 2 × 2 block input circuit
3a, 3b, 3c Average value calculation circuit
4a, 4b, 4c prediction error quantizer
5a, 5b, 5c prediction error inverse quantizer and new average value calculation circuit
6a, 6b, 6c Error calculation circuit
7a, 7b, 7c error comparison circuit
8 Quantizer
9 Controller
10 Switch

Claims (3)

画像信号を符号化処理して伝送する画像符号化方法であって、
全画面を、所定の画素単位のブロックに分割し、
前記ブロック内の画素値の平均値を算出し、
前記画素値と前記平均値との誤差をそれぞれ算出し、
これらの誤差が所定の値内であるか否かに基づいて、前記ブロックの符号化を行うか前記ブロックを更に分割するかの判定を行い、
その判定の結果に応じた適切な画素単位のブロックで符号化処理を行うことを特徴とする画像符号化方法。
An image encoding method for encoding and transmitting an image signal, comprising:
The entire screen is divided into predetermined pixel units,
Calculating the average of the pixel values in the block,
Calculating the error between the pixel value and the average value,
Based on whether these errors are within a predetermined value, determine whether to encode the block or to further divide the block,
An image encoding method, comprising: performing an encoding process on an appropriate pixel-unit block according to a result of the determination.
前記ブロックの平均値と前記ブロック内の画素値との差の絶対値の最大値をブロックごとに求めたヒストグラムを作成し、前記所定の値を前記ヒストグラムから算出することを特徴とする請求項1記載の画像符号化方法。2. A histogram in which a maximum value of an absolute value of a difference between an average value of the block and a pixel value in the block is obtained for each block, and the predetermined value is calculated from the histogram. Image coding method as described in the above. 画像信号を符号化処理して伝送する画像符号化装置であって、
全画面を、所定の画素単位のブロックに分割するブロック分割手段と、
前記ブロック内の画素値の平均値を算出する平均値算出手段と、
前記画素値と前記平均値との誤差をそれぞれ算出する誤差算出手段と、
これらの誤差が所定の値内であるか否かに基づいて、前記ブロックの符号化を行うか前記ブロックを更に分割するかの判定を行う判定手段と、
その判定の結果に応じた適切な画素単位のブロックで符号化処理を行う符号化手段とを具えることを特徴とする画像符号化装置。
An image encoding device for encoding and transmitting an image signal,
Block dividing means for dividing the entire screen into blocks of a predetermined pixel unit,
Average value calculation means for calculating an average value of pixel values in the block,
Error calculating means for calculating an error between the pixel value and the average value,
A determination unit configured to determine whether to encode the block or to further divide the block, based on whether these errors are within a predetermined value;
An image encoding device comprising: an encoding unit that performs an encoding process on a block in an appropriate pixel unit according to a result of the determination.
JP2002174328A 2002-06-14 2002-06-14 Method and device for encoding image Pending JP2004023372A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002174328A JP2004023372A (en) 2002-06-14 2002-06-14 Method and device for encoding image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002174328A JP2004023372A (en) 2002-06-14 2002-06-14 Method and device for encoding image

Publications (1)

Publication Number Publication Date
JP2004023372A true JP2004023372A (en) 2004-01-22

Family

ID=31173326

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002174328A Pending JP2004023372A (en) 2002-06-14 2002-06-14 Method and device for encoding image

Country Status (1)

Country Link
JP (1) JP2004023372A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6964372B1 (en) * 2021-05-19 2021-11-10 忠久 片岡 Code generation method, code generator, program, data collation method
JP7128555B1 (en) * 2021-05-19 2022-08-31 忠久 片岡 Data matching method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6964372B1 (en) * 2021-05-19 2021-11-10 忠久 片岡 Code generation method, code generator, program, data collation method
JP7128555B1 (en) * 2021-05-19 2022-08-31 忠久 片岡 Data matching method

Similar Documents

Publication Publication Date Title
CA2295689C (en) Apparatus and method for object based rate control in a coding system
US6690833B1 (en) Apparatus and method for macroblock based rate control in a coding system
US6208692B1 (en) Apparatus and method for performing scalable hierarchical motion estimation
KR100604702B1 (en) Apparatus for encoding an image sequence and method for generating a quantizer scale to quantize an image signals
US6438168B2 (en) Bandwidth scaling of a compressed video stream
EP1797722B1 (en) Adaptive overlapped block matching for accurate motion compensation
WO2000045602A1 (en) Optimal encoding scheme for motion compensated video
JP4226172B2 (en) Video compression encoding apparatus and decoding apparatus using adaptive conversion method and method thereof
US6252905B1 (en) Real-time evaluation of compressed picture quality within a digital video encoder
JPH09307904A (en) Quantizer for video signal coding system
US6373894B1 (en) Method and apparatus for recovering quantized coefficients
CN111164972A (en) System and method for controlling video encoding at frame level
EP1158806A1 (en) Motion vector coding
KR100961760B1 (en) Motion Estimation Method and Apparatus Which Refer to Discret Cosine Transform Coefficients
CN111164980A (en) System and method for controlling video encoding within image frames
KR100229796B1 (en) Image decoding system including compensation at detoriorate image
WO2003107682A1 (en) A method and system for optimizing image sharpness during coding
JP2001519988A (en) System for extracting coding parameters from video data
US5822000A (en) Video encoding using rearrangement of transform coefficients and inter-block correlation
US20050141616A1 (en) Video encoding and decoding methods and apparatuses using mesh-based motion compensation
US5724096A (en) Video signal encoding method and apparatus employing inter-block redundancies
JP4532607B2 (en) Apparatus and method for selecting a coding mode in a block-based coding system
JP2004023372A (en) Method and device for encoding image
EP1484925A2 (en) Method and device for compressing image data
JP2702139B2 (en) Video predictive coding

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20040831

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20070122

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20070206

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20070409

RD03 Notification of appointment of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7423

Effective date: 20070409

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20070717