JP2004023370A - Image encoding method and apparatus - Google Patents
Image encoding method and apparatus Download PDFInfo
- Publication number
- JP2004023370A JP2004023370A JP2002174307A JP2002174307A JP2004023370A JP 2004023370 A JP2004023370 A JP 2004023370A JP 2002174307 A JP2002174307 A JP 2002174307A JP 2002174307 A JP2002174307 A JP 2002174307A JP 2004023370 A JP2004023370 A JP 2004023370A
- Authority
- JP
- Japan
- Prior art keywords
- block
- pixels
- error
- new
- 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
Links
- 238000000034 method Methods 0.000 title claims description 82
- 238000004364 calculation method Methods 0.000 claims abstract description 42
- 238000013139 quantization Methods 0.000 abstract description 21
- 238000007906 compression Methods 0.000 abstract description 9
- 238000010586 diagram Methods 0.000 abstract description 8
- 238000012545 processing Methods 0.000 description 42
- 230000006835 compression Effects 0.000 description 8
- 230000005540 biological transmission Effects 0.000 description 7
- 238000012544 monitoring process Methods 0.000 description 5
- 241000255925 Diptera Species 0.000 description 3
- 238000012937 correction Methods 0.000 description 1
- 230000006866 deterioration Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000007781 pre-processing Methods 0.000 description 1
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
【課題】ブロック歪みや互いに隣接する画素の間の量子化歪みを大幅に軽減し、特別なデータを必要とすることなく高品質かつ高圧縮率の画像の符号化を行う。
【解決手段】入力部1には、画像信号が入力され、8×8ブロック入力回路2aは、その画像を8×8画素のブロックに分割し、頂点を検出する。予測誤差量子化器3aは、検出された頂点の予測誤差を求めて量子化する。予測誤差逆量子化器及び新頂点算出回路4aは、予測誤差量子化器3aで量子化した誤差を逆量子化して予測誤差を新たに求め、新頂点を算出する。新画素算出回路5aは、新頂点及び双一次曲面を用いて、ブロック内の新画素を算出する。誤差算出回路6aは、新画素算出回路5aで算出した新画素と、ブロック内の64画素とを比較して、誤差を算出する。誤差比較回路7aはそれぞれ、誤差算出回路6aで算出した誤差としきい値との比較を行う。
【選択図】 図15Kind Code: A1 The present invention significantly reduces block distortion and quantization distortion between mutually adjacent pixels, and encodes a high-quality and high-compression image without requiring special data.
An image signal is input to an input unit, and an 8 × 8 block input circuit 2a divides the image into blocks of 8 × 8 pixels and detects vertices. The prediction error quantizer 3a calculates and quantizes the prediction error of the detected vertex. The prediction error inverse quantizer and new vertex calculation circuit 4a inversely quantizes the error quantized by the prediction error quantizer 3a to newly obtain a prediction error, and calculates a new vertex. The new pixel calculation circuit 5a calculates a new pixel in the block using the new vertex and the bilinear surface. The error calculation circuit 6a compares the new pixel calculated by the new pixel calculation circuit 5a with 64 pixels in the block to calculate an error. Each of the error comparison circuits 7a compares the error calculated by the error calculation circuit 6a with a threshold value.
[Selection diagram] FIG.
Description
【0001】
【発明の属する技術分野】
本発明は、テレビ電話、監視カメラ等に適用され、画像信号を符号化処理して伝送や蓄積を行う際の画像符号化方法及びその装置に関するものである。
【0002】
【従来の技術】
一般的な画像信号の圧縮規格として、静止画像についてはJPEGが提案されており、動画像についてはMPEGが提案されている。また、代表的な画像圧縮方法としては、JPEGやMPEGで採用しているブロック符号化の他に、非ブロック符号化として予測符号化やベクトル量子化がある。
【0003】
MPEGの場合、圧縮率が高くなるものの、ブロックに分割してDCT係数の削減を行うために、モスキートノイズやブロック歪みが発生する。
【0004】
予測符号化は、互いに隣接する画素から当該画素値を予測し、その予測誤差を量子化する符号化であり、この場合、モスキートノイズやブロック歪みが発生しないものの、圧縮率を高めるに従って量子化歪みに起因する画質の劣化が顕著になる。
【0005】
ベクトル量子化は、複数の画素値を所定の代表ベクトルに置き換える手法であり、予測符号化の場合に比べて圧縮率を高めることができるが、一般のテレビジョン映像のように様々な映像が入力される場合には、コードブック(符号化データすなわちテーブル)を生成するのが困難となり、コードブックの種類を削減すると、ブロック歪みが発生しやすくなる。
【0006】
【発明が解決しようとする課題】
本発明の目的は、ブロック歪みや互いに隣接する画素の間の量子化歪みを大幅に軽減し、特別なデータを必要とすることなく高品質かつ高圧縮率の画像の符号化を行うことができる画像符号化方法及びその装置を提供することである。
【0007】
【課題を解決するための手段】
本発明による画像符号化方法は、
全画面を、所定の画素単位のブロックに分割し、
前記ブロック内の画素の頂点及び双一次曲面を用いて、新たな画素値を算出し、
前記ブロック内の画素値と、前記新たな画素値との差をそれぞれ算出し、
これらの差が所定の範囲内であるか否かに基づいて、前記ブロックの符号化を行うか前記ブロックを更に分割するかの判定を行い、
その判定の結果に応じた適切な画素単位のブロックで符号化処理を行うことを特徴とする。
【0008】
本発明によれば、所定の画素単位に分割されたブロックの符号化を行うかブロックを更に分割するかの判定を、新たな画素値を用いて行い、その判定の結果に応じた適切な画素単位のブロックで符号化処理を行うことによって、MPEG、予測符号化及びベクトル量子化に固有の問題が発生しない。その結果、ブロック歪みや互いに隣接する画素の間の量子化歪みを大幅に軽減し、特別なデータを必要とすることなく高品質かつ高圧縮率の画像の符号化を行うことができる。
【0009】
好適には、前記差の絶対値の最大値をブロックごとに求めたヒストグラムを作成し、前記所定の値を前記ヒストグラムから算出する。
【0010】
本発明による画像符号化装置は、
画像信号を符号化処理して伝送する画像符号化装置であって、
全画面を、所定の画素単位のブロックに分割するブロック分割手段と、
前記ブロック内の画素の頂点及び双一次曲面を用いて、新たな画素値を算出する新画素値算出手段と、
前記ブロック内の画素値と、前記新たな画素値との差をそれぞれ算出する差算出手段と、
これらの差が所定の範囲内であるか否かに基づいて、前記ブロックの符号化を行うか前記ブロックを更に分割するかの判定を行う判定手段と、
その判定の結果に応じた適切な画素単位のブロックで符号化処理を行う符号化手段とを具えることを特徴とする。
【0011】
本発明によれば、ブロック歪みや互いに隣接する画素の間の量子化歪みを大幅に軽減し、特別なデータを必要とすることなく高品質かつ高圧縮率の画像の符号化を行うことができる。
【0012】
【発明の実施の形態】
本発明の理解を容易にするために、先ず、本発明の基本原理を説明する。
画像圧縮方法は、相関の利用に関して二つの方法に分類される。
第1の方法は、互いに隣接する画素間の相関を利用する方法であり、具体的には、予測符号化のように互いに隣接する画素間の差分を利用して量子化ビット数を削減するような空間的に処理する方法や、DCT又はウェーブレット変換のように変換系を利用して高域の係数を削減するような周波数的に処理する方法を挙げることができる。
しかしながら、上記第1の方法では、圧縮率を高くするに従って量子化歪みが顕著になり又はブロック歪みやモスキートノイズが発生するおそれがある。
【0013】
第2の方法は、所定のパターンと画像との相関を計算し、相関の高いパターンに近似させる方法であり、具体的には、フラクタル符号化や曲面近似を挙げることができる。なお、パターンは、画像から抽出され又は適切な関係式から計算することによって求められる。
しかしながら、計算によって係数を求め又はマッチングや相関のような手法を用いたとしても、実際には最適なパターンを検出するのが困難である。
【0014】
本発明は、曲面近似を用いる。しかしながら、高次の曲面では、その画像に近似する曲面の形状、次数、係数等を簡単な手法によって決定するのは容易でない。したがって、双一次曲面を用いて近似するが、複雑な次数を有する画像に対しては、画像領域を分割する。具体的には、比較的大きな矩形領域を、その矩形領域の4個の頂点を用いて計算し、内部点を近似する。しかしながら、計算値との誤差が大きい場合には、その矩形領域を分割し、分割された矩形領域の4個の頂点を用いて計算する。このような分割を最小の矩形領域まで繰り返し、最小の矩形領域まで分割しても近似しきれない場合には、各画素との誤差を量子化する。
【0015】
本発明は、画像の画素値を用いて双一次曲面を所定の式に基づいて計算するので、曲面のテーブルを用いる必要がない。また、矩形領域を、後に説明するようなブロック及び頂点によって構成することによって、内部点の計算を簡単にするとともに、ブロック境界の歪みを発生させないようにすることができる。
【0016】
双一次曲面を用いた処理を更に詳しく説明すると、先ず、全画面を、所定の画素単位のブロックに分割する。これらのブロックをそれぞれ、例えば、水平方向に8画素及び垂直方向に8画素を有する8×8画素のブロックとすることができるが、各ブロックの大きさを任意に設定することができる。
【0017】
ブロックは更に分割され、例えば8×8画素のブロックに分割した場合、4×4画素のブロック及び2×2画素のブロックに順次分割される。ここで、ブロックの頂点は、例えば8×8画素のブロックに分割した場合、図1に示すように左上の画素aに対応するが、それ以外の画素を頂点に選択することもできる。なお、4×4画素のブロック及び2×2画素のブロックの場合も同様である。
【0018】
すなわち、分割された最大単位のブロックの中で、双一次曲面の式を用いて計算した値と画像の画素値との相関の強さを求め、相関がある場合には、そのブロックの頂点を代表値とする。相関がない場合には、ブロックを更に分割し、更に分割したブロックの中で、同様にして相関の強さを求める。ブロックの分割は、相関があるようになるまで繰り返されるが、分割しうる最小のブロックまで分割しても相関がないと判断された場合、そのブロックの頂点の他に、頂点及び双一次曲面から算出した新たな画素と各画素との誤差を量子化する。
【0019】
双一次曲面Q(u,w)は、その4個のコーナ部の座標をそれぞれP(0,0),P(0,1),P(1,0),P(1,1)とした場合、以下の式によって表現される。
〔数1〕
Q(u,w)=P(0,0)(1−u)(1−w)+P(0,1)(1−u)w+P(1,0)u(1−w)+P(1,1)uw
【0020】
本発明によれば、隣接する3個のブロック(右、下、及び右斜め下)の頂点の画素をP座標とし、双一次曲面Q(u,w)のu,wに相当する値を1/2,1/4,1/8等の2のべき乗で表現できる値を使用することによって、加減算及びシフト演算のみが行われ、例えば、1/8=0.125の場合には、3ビット右にシフトするだけでよい。
【0021】
次に、本発明による画像符号化方法及びその装置の実施の形態を、図面を参照して詳細に説明する。
図2は、本発明による画像符号化方法の実施の形態の動作のフローチャートである。この場合、全画面を8×8画素のブロックに分割し、このように分割された8×8画素のブロックを基準としている。
【0022】
図2に示す制御ルーチンは、例えば、画像監視システムの送信側で実行され、先ず、ステップS1において、符号化の前処理として、判定処理用のしきい値を算出する。なお、ステップS1を、図3及び図4を用いて後に詳細に説明する。
【0023】
次いで、ステップS2において、全画面を8×8画素のブロックに分割したときの全ブロック数Jを設定する。全ブロック数Jは、縦横の画素数によって決定される。次いで、ステップS3において、図7及び8を用いて後に詳細に説明する8×8画素のブロックの処理を行う。
【0024】
次いで、全ブロック数Jから1を減算し(ステップS4)、その後、全ブロックの処理が終了したか否かを判定する(ステップS5)。終了した場合には、このルーチンを終了し、終了しない場合には、ステップS3に戻る。
【0025】
図3は、図2のステップS1のサブルーチンの前半のフローチャートであり、図4は、図2のステップS1のサブルーチンの後半のフローチャートである。本実施の形態では、基準となるブロックを8×8画素のブロックから構成している。8×8画素のブロックを基準として処理するため、そのブロックを縦横それぞれ半分に分割すれば、4×4画素のブロックに分割され、更にその半分に分割すれば、2×2画素のブロックに分割されることとなる。図3及び図4のサブルーチンは、2×2画素のブロックを基準とし、4×4画素のブロック、8×8画素のブロックへと演算を進めてしきい値を算出する。
【0026】
先ず、ステップS11において、全画面を2×2画素のブロックに分割したときのブロック数mをセットする。次いで、ステップS12において、2×2画素のブロックの頂点と、それに隣接する3ブロックの頂点から、新たな画素(新画素)を算出する。例えば、図5に示すように、画素A0,A2,C0及びC2から、双一次曲面によって画素A0を頂点とするブロック内の新画素を算出する。
【0027】
次いで、ブロック内の各画素(図5の画素A0,A1,B0及びB1)と、ステップS12で算出した新画素とを比較し(ステップS13)、比較した差の絶対値の最大値を検出して、後に説明する第1のヒストグラム(ヒストグラム1)に登録し(ステップS14)、ブロック数mから1を減算し(ステップS15)、ブロック数mが0であるか否か、すなわち、2×2画素のブロックの全てについて処理が終了したか否か判定する。処理が終了している場合、4×4画素のブロックについての処理を行うために次のステップS17に進み、それに対して、処理が終了していない場合には、ステップS12に戻る。
【0028】
次いで、ステップS17において、全画面を4×4画素のブロックに分割したときのブロック数lをセットする。次いで、ステップS18において、4×4画素のブロックの頂点と、それに隣接する3ブロックの頂点から、新たな画素(新画素)を算出する。例えば、図5に示すように、画素A0,A4,E0及びE4から、双一次曲面によって画素A0を頂点とするブロック内の新画素を算出する。
【0029】
次いで、ブロック内の各画素(図5の画素A0〜A3,B0〜B3,C0〜C3及びD0〜D3)と、ステップS18で算出した新画素とを比較し(ステップS19)、比較した差の絶対値の最大値を検出して、後に説明する第2のヒストグラム(ヒストグラム2)に登録し(ステップS20)、ブロック数lから1を減算し(ステップS21)、ブロック数lが0であるか否か、すなわち、4×4画素のブロックの全てについて処理が終了したか否か判定する。処理が終了している場合、8×8画素のブロックについての処理を行うために次のステップS23に進み、それに対して、処理が終了していない場合には、ステップS18に戻る。
【0030】
次いで、ステップS23において、全画面を8×8画素のブロックに分割したときのブロック数kをセットする。次いで、ステップS24において、8×8画素のブロックの頂点と、それに隣接する3ブロックの頂点から、新たな画素(新画素)を算出する。例えば、図5に示すように、画素A0,A8,I0及びI8から、双一次曲面によって画素A0を頂点とするブロック内の新画素を算出する。
【0031】
次いで、ブロック内の各画素(図5の画素A0〜A7,B0〜B7,C0〜C7,D0〜D7,E0〜E7,F0〜F7,G0〜G7及びH0〜H7)と、ステップS24で算出した新画素とを比較し(ステップS25)、比較した差の絶対値の最大値を検出して、後に説明する第3のヒストグラム(ヒストグラム3)に登録し(ステップS26)、ブロック数kから1を減算し(ステップS27)、ブロック数kが0であるか否か、すなわち、8×8画素のブロックの全てについて処理が終了したか否か判定する。処理が終了している場合、図6に示すようなヒストグラム1,2,3から、2×2画素のブロック用、4×4画素のブロック用及び8×8画素のブロック用のしきい値並びに2×2画素のブロック、4×4画素のブロック及び8×8画素のブロックの各頂点の3種類の量子化テーブルを決定して(ステップS29)、本ルーチンを終了する。それに対して、処理が終了していない場合には、ステップS24に戻る。
【0032】
図7は、図2のステップS3のサブルーチンの前半のフローチャートであり、図8は、図2のステップS3のサブルーチンの後半のフローチャートである。なお、このサブルーチンは、可変長符号化を行うものである。
【0033】
先ず、ステップS31において、所定の8×8画素のブロックの頂点の予測誤差を、図4のステップS29で算出した量子化テーブルに基づいて量子化する。例えば、図9Aに示すようにブロックの分割を行った場合、画素A0,A8,...I0,I8,...の予測誤差を量子化する。
【0034】
次いで、ステップS32において、量子化した予測誤差を逆量子化して誤差を算出し、元の頂点に対して加減算して補正を行い、新頂点を算出する。図9Aの場合、図9Bに示すようにA0’,A8’,I0’及びI8’が新頂点となる。
【0035】
次いで、新頂点及び双一次曲面から新画素を算出し(ステップS33)、このように算出した新画素と、ブロック内の画素(例えば、図9Aにおける64個の画素A0〜A7,B0〜B7,C0〜C7,D0〜D7,E0〜E7,F0〜F7,G0〜G7及びH0〜H7)とを比較する(ステップS34)。
【0036】
次いで、ステップS35において、比較の結果、誤差の最大値が、図4のステップS29で求めた8×8画素のブロック用のしきい値内であるか否か判定する。しきい値内である場合、次の8×8画素のブロックについての処理を行うためにこのサブルーチンを終了し、それに対して、しきい値外である場合、4×4画素のブロックの処理を行うためにステップS36に進む。
【0037】
ステップS36において4×4画素のブロックのブロック数kとして4をセットする。次いで、ステップS37において、所定の4×4画素のブロックの頂点のうち、ステップS31で量子化した頂点以外の頂点の予測誤差を、図4のステップS29で算出した量子化テーブルに基づいて量子化する。例えば、図9Aに示すようにブロックの分割を行った場合、画素A4,E0,E4,E8,I4の予測誤差を量子化する。
【0038】
次いで、ステップS38において、量子化した予測誤差を逆量子化して誤差を算出し、元の頂点に対して加減算して補正を行い、新頂点を算出する。図9Aの場合、図9Cに示すようにA0’,A4’,A8’,E0’,E4’,E8’,I0’,I4’及びI8’が新頂点となる。
【0039】
次いで、新頂点(第1ブロックでは、図9Dに示すようにA0’,A4’,E0’及びE4’)及び双一次曲面から新画素を算出し(ステップS39)、このように算出した新画素と、ブロック内の画素(例えば、図9Aにおける16個の画素A0〜A3,B0〜B3,C0〜C3及びD0〜D3)とを比較する(ステップS40)。
【0040】
次いで、ステップS41において、比較の結果、誤差の最大値が、図4のステップS29で求めた4×4画素のブロック用のしきい値内であるか否か判定する。しきい値内である場合、次の4×4画素のブロックについての処理を行うために、後に説明するステップS51に進み、それに対して、しきい値外である場合、2×2画素のブロックの処理を行うためにステップS42に進む。
【0041】
ステップS42において2×2画素のブロックのブロック数lとして4をセットする。次いで、ステップS43において、所定の2×2画素のブロックの頂点のうち、ステップS31及びステップS37で量子化した頂点以外の頂点の予測誤差を、図4のステップS29で算出した量子化テーブルに基づいて量子化する。例えば、図9Aに示すようにブロックの分割を行った場合、画素A2,C0,C2,C4及びE2の予測誤差を量子化する。
【0042】
次いで、ステップS44において、量子化した予測誤差を逆量子化して誤差を算出し、元の頂点に対して加減算して補正を行い、新頂点を算出する。図9Aの場合、図9Eに示すようにA0’,A2’,A4’,C0’,C2’,C4’,E0’,E2’及びE4’が新頂点となる。
【0043】
次いで、新頂点(第1ブロックでは図9Fに示すようにA0’,A2’,C0’及びC2’)及び双一次曲面から新画素を算出し(ステップS45)、このように算出した新画素と、ブロック内の画素(例えば、図9Aにおける4個の画素A0,A1,B0及びB1)とを比較する(ステップS46)。
【0044】
次いで、ステップS47において、比較の結果、誤差の最大値が、図4のステップS29で求めた2×2画素のブロック用のしきい値内であるか否か判定する。しきい値内である場合、次の2×2画素のブロックについての処理を行うために、後に説明するステップS49に進み、それに対して、しきい値外である場合、ブロック内の画素と新画素との差を、4画素のそれぞれについて量子化した(ステップS48)後、ステップS49に進む。
【0045】
ステップS49において、ブロック数lから1を減算し、その後、ステップS50において、2×2画素のブロックの全てについて処理が終了したか否か判定する。処理が終了した場合、ステップS51に進み、それに対して、処理が終了しない場合、ステップS43に戻る。
【0046】
ステップS51において、ブロック数kから1を減算し、その後、ステップS52において、4×4画素のブロックの全てについて処理が終了したか否か判定する。処理が終了した場合、このサブルーチンを終了し、それに対して、処理が終了しない場合、ステップS37に戻る。
【0047】
図7及び図8に示すサブルーチンは、分割された8×8画素のブロックの全てに対して行われる。
各頂点の値の量子化誤差によって、初期の段階で予測した符号化ビット発生量が変動する。したがって、8×8画素のブロックラインごとに、8×8画素のブロック、4×4画素のブロック及び2×2画素のブロックのヒストグラムを参照し、しきい値内であると予測したブロック数と、実際の処理においてしきい値内であったブロック数とを比較し、しきい値内であったブロック数が比較的少ない、すなわち、符号化ビット数が比較的多く発生した場合には、しきい値を高くして発生符号化量を減少させる。
【0048】
なお、画像監視システムの受信側における画像復号化処理については、図1のフローチャートと逆の動作を行うことによって行われる。
【0049】
図10〜13は、本発明による画像符号化方法の他の実施の形態の動作のフローチャートである。
先ず、ステップS101において、全画面を8×8画素のブロックに分割したときの全ブロック数Jを設定する。
【0050】
次いで、ステップS102において、8×8画素のブロックの4個の頂点を量子化する。例えば、図14Aの画素A0,A8,I0及びI8が4個の頂点に対応する。次いで、ステップS103において、ステップS102で量子化した頂点を逆量子化して新頂点を算出する。例えば、図14Aの画素A0,A8,I0及びI8に対応する4個の頂点の新頂点は、それぞれ画素A0’,A8’,I0’及びI8’となる。
【0051】
次いで、ステップS104において、ステップS103で算出した4個の新頂点と、双一次曲面とから、8×8画素のブロック内の新画素を算出するとともに、新画素と各画素との残差を求める。これら残差は、A0’−1,A1−1,...H7−1となる(図14B)。
【0052】
次いで、ステップS105において、新画素と各画素との間の残差の最大値(絶対値)を検出して、第1の残差テーブル(残差テーブル1)に保存し、かつ、第1のヒストグラム(ヒストグラム1)に登録する。
【0053】
次いで、全ブロック数Jから1を減算し(ステップS106)、その後、全ブロックの処理すなわち画像全体(1画面)についての処理が終了したか否かを判定する(ステップS107)。処理が終了した場合には、ステップS108に進み、それに対して、処理が終了しない場合には、ステップS102に戻る。
【0054】
ステップS108において、後段に接続される図示しないバッファメモリの前フレーム処理後の空き容量、8×8画素のブロックの頂点値データの情報ビット量、ヒストグラム1等から、8×8画素のブロック用のしきい値を算出する。
【0055】
次いで、上記残差テーブル1と、ステップS108で算出したしきい値とを比較し(ステップS109)、残差がしきい値内であるか否か判断する(ステップS110)。残差がしきい値内である場合、後に説明するステップS118までスキップする。
【0056】
残差がしきい値内でない場合、4×4画素のブロックの処理のために、ステップS111において、8×8画素のブロックを4×4画素のブロックに分割したときのブロック数kとして4を設定する。
【0057】
次いで、ステップS112において、残差テーブル1に保存されている4×4画素のブロックの4個の頂点の残差を量子化する。例えば、図14Cのように4×4画素のブロックに分割した場合、A0’−1,A4−1,E0−1及びE4−1が対象の頂点の残差となる。次いで、ステップS113において、ステップS112で量子化した頂点の残差を逆量子化して新残差を算出する。例えば、残差A0’−1,A4−1,E0−1及びE4−1の新たな残差(新残差)は、A0’’−1,A4’−1,E0’−1及びE4’−1となる(図14C)。
【0058】
次いで、ステップS114において、ステップS113で算出した4個の頂点の新残差と、双一次曲面とから、4×4画素のブロック内の新残差を算出するとともに、各画素の残差との残差を求める。これら残差は、A0’’−2,A1−2,...D3−2となる(図14D)。
【0059】
次いで、ステップS115において、新残差と各画素の残差との間の残差の最大値(絶対値)を検出して、第2の残差テーブル(残差テーブル2)に保存し、かつ、第2のヒストグラム(ヒストグラム2)に登録する。
【0060】
次いで、ブロック数kから1を減算し(ステップS116)、その後、4×4画素のブロックについての処理が終了したか否かを判定する(ステップS117)。処理が終了した場合には、ステップS118に進み、それに対して、処理が終了しない場合には、ステップS112に戻る。
【0061】
4×4画素のブロックについての処理が終了した場合又はステップS110においてしきい値が残差より大きいと判定された場合、ステップS118において、全ブロック(残差テーブル1)についての処理が終了したか否かを判定する。
【0062】
ステップS119において、バッファメモリの前フレーム処理後の空き容量、4×4画素のブロックの残差値データの情報ビット量、ヒストグラム2等から、4×4画素のブロック用のしきい値を算出する。
【0063】
次いで、上記残差テーブル2と、ステップS119で算出したしきい値とを比較し(ステップS120)、残差がしきい値内であるか否か判断する(ステップS121)。残差がしきい値内である場合、後に説明するステップS129までスキップする。
【0064】
残差がしきい値内でない場合、2×2画素のブロックの処理のために、ステップS122において、4×4画素のブロックを2×2画素のブロックに分割したときのブロック数mとして4を設定する。
【0065】
次いで、ステップS123において、残差テーブル2に保存されている2×2画素のブロックの4個の頂点の残差を量子化する。例えば、図14Eのように2×2画素のブロックに分割した場合、A0’’−2,A2−2,C0−2及びC2−2が対象の頂点の残差となる。次いで、ステップS124において、ステップS123で量子化した頂点を逆量子化して新頂点を算出する。例えば、残差A0’’−2,A2−2,C0−2及びC2−2の新たな残差(新残差)は、A0’’’−2,A2’−2,C0’−2及びC2’−2となる(図14E)。
【0066】
次いで、ステップS125において、ステップS124で算出した4個の頂点の残差と、双一次曲面とから、2×2画素のブロック内の新残差を算出するとともに、新残差と各画素の残差との残差を求める。これら残差は、A0’’’−3,A2’−3,C0’−3及びC2’−3となる(図14F)。
【0067】
次いで、ステップS126において、新残差と各画素の残差との間の差の最大値(絶対値)を検出して第3の残差テーブル(残差テーブル3)に保存し、かつ、第3のヒストグラム(ヒストグラム3)に登録する。
【0068】
次いで、ブロック数mから1を減算し(ステップS127)、その後、2×2画素のブロックについての処理が終了したか否かを判定する(ステップS128)。処理が終了した場合には、ステップS129に進み、それに対して、処理が終了しない場合には、ステップS123に戻る。
【0069】
2×2画素のブロックについての処理が終了した場合又はステップS121においてしきい値が残差より大きいと判定された場合、ステップS129において、4×4画素のブロック(残差テーブル2)の全てについての処理が終了したか否かを判定する。
【0070】
ステップS130において、バッファメモリの前フレーム処理後の空き容量、2×2画素のブロックの残差値データの情報ビット量、ヒストグラム3等から、2×2画素のブロック用のしきい値を算出する。
【0071】
次いで、上記残差テーブル3と、ステップS130で算出したしきい値とを比較し(ステップS131)、残差がしきい値内であるか否か判断する(ステップS132)。残差がしきい値内である場合、後に説明するステップS134までスキップする。
【0072】
残差がしきい値内でない場合、4画素の残差を量子化し(ステップS133)、その後、2×2画素のブロックの全てについての処理が終了したか否かを判定する(ステップS134)。処理が終了した場合には、この制御ルーチンを終了し、それに対して、処理が終了しない場合には、ステップS131に戻る。
【0073】
なお、画像監視システムの受信側における画像復号化処理については、図10〜13のフローチャートと逆の動作を行うことによって行われる。
【0074】
図15は、本発明による画像符号化装置の実施の形態のブロック図である。この画像符号化装置は、例えば、画像監視システムの送信側に適用され、入力部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とを具える。
【0075】
本実施の形態の動作を説明する。入力部1には、図示しない監視カメラからのデジタル化された画像信号が入力され、8×8ブロック入力回路2aは、その画像を8×8画素のブロックに分割し、各ブロックの頂点となる画素(以下、単に頂点という。)を検出する。
【0076】
予測誤差量子化器3aは、検出された頂点の予測誤差を求めて量子化する。この予測誤差量子化器3aによる量子化によって、データのビット数が削減される。予測誤差逆量子化器及び新頂点算出回路4aは、量子化誤差を補正するために、予測誤差量子化器3aで量子化した誤差を逆量子化して予測誤差を新たに求め、8×8ブロック入力回路2aで検出した頂点にその予測誤差を加算又は減算することによって、新頂点を算出する。
【0077】
新画素算出回路5aは、予測誤差逆量子化器及び新頂点算出回路4aで算出した新頂点と、〔数1〕で表現した双一次曲面とを用いて、ブロック内の新画素を算出する。
【0078】
誤差算出回路6aは、新画素算出回路5aで算出した新画素と、ブロック内の64画素とを比較して、誤差を算出する。誤差比較回路7aはそれぞれ、誤差算出回路6aで算出した誤差としきい値との比較を行う。誤差がしきい値内である場合、予測誤差量子化器3aで量子化した予測誤差を切替器10を通じて出力するように、制御器9を制御する。それに対して、誤差がしきい値外である場合、8×8画素のブロックを4×4ブロック入力回路2b以降で処理する。
【0079】
4×4ブロック入力回路2bは、8×8画素のブロックを更に半分に分割し、すなわち、水平方向に4画素及び垂直方向に4画素を有する4×4画素のブロックに分割し、各ブロックの頂点となる画素(以下、単に頂点という。)を検出する。
【0080】
予測誤差量子化器3bは、予測誤差量子化器3aで量子化した頂点を除く4×4ブロック入力回路2bで検出された頂点の予測誤差を求めて量子化する。この予測誤差量子化器3bによる量子化によって、データのビット数が削減される。予測誤差逆量子化器及び新頂点算出回路4bは、量子化誤差を補正するために、予測誤差量子化器3bで量子化した誤差を逆量子化して予測誤差を新たに求め、4×4ブロック入力回路2bで検出した頂点にその予測誤差を加算又は減算することによって、新頂点を算出する。
【0081】
新画素算出回路5bは、予測誤差逆量子化器及び新頂点算出回路4bで算出した新頂点と、〔数1〕で表現した双一次曲面とを用いて、ブロック内の新画素を算出する。なお、8×8画素のブロックと重なる頂点については、予測誤差逆量子化器及び新頂点算出回路4aの出力を用いる。
【0082】
誤差算出回路6bは、新画素算出回路5bで算出し又は予測誤差逆量子化器及び新頂点算出回路4aの出力である新画素と、ブロック内の16画素とを比較して、誤差を算出する。誤差比較回路7bはそれぞれ、誤差算出回路6bで算出した誤差としきい値との比較を行う。誤差がしきい値内である場合、予測誤差量子化器3bで量子化した予測誤差を切替器10を通じて出力するように、制御器9を制御する。それに対して、誤差がしきい値外である場合、4×4画素のブロックを2×2ブロック入力回路2c以降で処理する。
なお、4×4ブロック入力回路2bから誤差比較回路7bまでの処理を、4個のブロックに対して行う。
【0083】
2×2ブロック入力回路2cは、4×4画素のブロックを更に半分に分割し、すなわち、水平方向に2画素及び垂直方向に2画素を有する2×2画素のブロックに分割し、各ブロックの頂点となる画素(以下、単に頂点という。)を検出する。
【0084】
予測誤差量子化器3cは、予測誤差量子化器3bで量子化した頂点を除く2×2ブロック入力回路2cで検出された頂点の予測誤差を求めて量子化する。この予測誤差量子化器3cによる量子化によって、データのビット数が削減される。予測誤差逆量子化器及び新頂点算出回路4cは、量子化誤差を補正するために、予測誤差量子化器3cで量子化した誤差を逆量子化して予測誤差を新たに求め、2×2ブロック入力回路2cで検出した頂点にその予測誤差を加算又は減算することによって、新頂点を算出する。
【0085】
新画素算出回路5cは、予測誤差逆量子化器及び新頂点算出回路4cで算出した新頂点と、〔数1〕で表現した双一次曲面とを用いて、ブロック内の新画素を算出する。なお、4×4画素のブロックと重なる頂点については、予測誤差逆量子化器及び新頂点算出回路4bの出力を用いる。
【0086】
誤差算出回路6cは、新画素算出回路5cで算出し又は予測誤差逆量子化器及び新頂点算出回路4bの出力である新画素と、ブロック内の4画素とを比較して、誤差を算出する。誤差比較回路7cはそれぞれ、誤差算出回路6cで算出した誤差としきい値との比較を行う。誤差がしきい値内である場合、予測誤差量子化器3cで量子化した予測誤差を切替器10を通じて出力するように、制御器9を制御する。それに対して、誤差がしきい値外である場合、量子化器8は、誤差算出回路6cで算出された誤差を量子化する。
【0087】
切替器10から出力された信号は、受信側において、図15に示す素子と同様な素子によって構成された画像復号化装置に入力され、図15に示す画像符号化装置の動作と逆の動作を行うことによって、復号化され、例えばモニタに出力される。
【0088】
上記実施の形態によれば、監視カメラにおいて、道路や壁のような平坦又はなだらかな傾斜に対しては、8×8画素のブロック処理の双一次曲面を使用し、起伏の多い部分に対しては2×2画素のブロック処理を施すことによって、好適な画像監視システムを構成することができる。さらに、平坦又はなだらかな傾斜が比較的多い場合には、8×8画素のブロックより大きな16×16画素のブロックを使用することによって、更に圧縮率を高くすることができる伝送システムを構成することができる。
【0089】
本発明は、上記実施の形態に限定されるものではなく、幾多の変更及び変形が可能である。
例えば、本発明による画像符号化方法及びその装置を、任意の伝送システムの送信側で使用することができ、対応する画像復号化方法及び装置を、対応するシステムの受信側で使用することができる。
【0090】
また、8×8画素のブロック、4×4画素のブロック及び2×2画素のブロックの順に処理したが、本発明を、2n×2n画素のブロック(n:自然数)に対して適用することができ、例えば、16×16画素のブロック、8×8画素のブロック、4×4画素のブロック及び2×2画素のブロックの順に処理することもできる。
【0091】
上記実施の形態では、8×8画素のブロック、4×4画素のブロック及び2×2画素のブロックの頂点を量子化し、可変長ビットに変換する処理を行ったが、量子化を行うことなく固定長ビットで送出を行うことによって、演算量を減少させることもできる。
【0092】
さらに、フレーム内処理の場合について説明したが、フレーム間処理を組み合わせることもできる。すなわち、任意の大きさのブロックを処理するに際し、前フレームとの比較を行う処理を挿入することによって、フレーム間処理を容易に追加することができる。
【図面の簡単な説明】
【図1】分割されたブロックの頂点を示す図である。
【図2】本発明による画像符号化方法の実施の形態のフローチャートである。
【図3】図2のステップS1のサブルーチンのフローチャートの一部である。
【図4】図2のステップS1のサブルーチンのフローチャートの一部である。
【図5】新画素の算出を説明するための図である。
【図6】図2のフローチャートで作成されたヒストグラム1,2及び3を示す図である。
【図7】図2のステップS3のサブルーチンのフローチャートの一部である。
【図8】図2のステップS3のサブルーチンのフローチャートの一部である。
【図9】新頂点の算出を説明するための図である。
【図10】本発明による画像符号化方法の他の実施の形態のフローチャートの一部である。
【図11】本発明による画像符号化方法の他の実施の形態のフローチャートの一部である。
【図12】本発明による画像符号化方法の他の実施の形態のフローチャートの一部である。
【図13】本発明による画像符号化方法の他の実施の形態のフローチャートの一部である。
【図14】ブロックの頂点の残差を説明するための図である。
【図15】本発明による画像符号化装置の実施の形態のブロック図である。
【符号の説明】
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 as non-block coding in addition to block coding used in JPEG and MPEG.
[0003]
In the case of MPEG, although the compression ratio is high, mosquito noise and block distortion occur because the data is divided into blocks and the DCT coefficients are reduced.
[0004]
Predictive coding is coding in which the pixel value is predicted from pixels adjacent to each other and the prediction error is quantized. In this case, although mosquito noise and block distortion do not occur, quantization distortion increases as the compression ratio increases. The deterioration of the image quality due to the above becomes remarkable.
[0005]
Vector quantization is a method of replacing a plurality of pixel values with a predetermined representative vector, and can increase the compression ratio as compared with the case of predictive coding. In such a case, it is difficult to generate a codebook (encoded data, that is, a table). If the type of the codebook is reduced, block distortion is likely to occur.
[0006]
[Problems to be solved by the invention]
An object of the present invention is to significantly reduce block distortion and quantization distortion between pixels adjacent to each other, and perform high-quality and high-compression-rate image encoding without requiring special data. An object of the present invention is to provide an image encoding method and an apparatus therefor.
[0007]
[Means for Solving the Problems]
The image encoding method according to the present invention comprises:
The entire screen is divided into predetermined pixel units,
Using the vertices and bilinear surfaces of the pixels in the block, calculate a new pixel value,
Calculate the difference between the pixel value in the block and the new pixel value,
Based on whether or not these differences are within a predetermined range, 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.
[0008]
According to the present invention, a decision as to whether to encode a block divided in a predetermined pixel unit or to further divide a block is made using a new pixel value, and an appropriate pixel according to the result of the decision is made. By performing the encoding process on the unit block, problems unique to MPEG, predictive encoding, and vector quantization do not occur. As a result, block distortion and quantization distortion between pixels adjacent to each other are significantly reduced, and high-quality and high-compression-rate images can be encoded without requiring special data.
[0009]
Preferably, a histogram in which the maximum value of the absolute value of the difference is obtained for each block is created, and the predetermined value is calculated from the histogram.
[0010]
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,
New pixel value calculation means for calculating a new pixel value using the vertices and bilinear surfaces of the pixels in the block,
A pixel value in the block, and a difference calculation unit for calculating a difference between the new pixel value,
A determination unit configured to determine whether to encode the block or to further divide the block, based on whether these differences are within a predetermined range;
Encoding means for performing an encoding process on an appropriate pixel unit block according to the result of the determination.
[0011]
ADVANTAGE OF THE INVENTION According to this invention, block distortion and quantization distortion between mutually adjacent pixels are significantly reduced, and high-quality and high-compression-rate images can be encoded without requiring special data. .
[0012]
BEST MODE FOR CARRYING OUT THE INVENTION
To facilitate understanding of the present invention, first, the basic principle of the present invention will be described.
Image compression methods fall into two categories with respect to the use of correlation.
The first method is a method using the correlation between mutually adjacent pixels. Specifically, the first method is to reduce the number of quantization bits by using the difference between mutually adjacent pixels as in predictive coding. For example, a method of performing spatial processing or a method of performing frequency processing such as DCT or wavelet transform using a transform system to reduce high-frequency coefficients.
However, in the first method, there is a possibility that the quantization distortion becomes remarkable or the block distortion or mosquito noise occurs as the compression ratio is increased.
[0013]
The second method is a method of calculating a correlation between a predetermined pattern and an image and approximating the image to a pattern having a high correlation. Specific examples include fractal coding and surface approximation. The pattern is obtained by extracting from the image or calculating from an appropriate relational expression.
However, even if a coefficient is obtained by calculation or a method such as matching or correlation is used, it is actually difficult to detect an optimum pattern.
[0014]
The present invention uses curved surface approximation. However, for a high-order curved surface, it is not easy to determine the shape, order, coefficient, and the like of the curved surface approximating the image by a simple method. Therefore, although an image is approximated using a bilinear surface, an image region is divided for an image having a complex order. Specifically, a relatively large rectangular area is calculated using four vertices of the rectangular area, and an internal point is approximated. However, if the error from the calculated value is large, the rectangular area is divided and the calculation is performed using the four vertices of the divided rectangular area. Such division is repeated up to the minimum rectangular area, and if the division cannot be made even if the division is made up to the minimum rectangular area, the error from each pixel is quantized.
[0015]
According to the present invention, the bilinear surface is calculated based on a predetermined formula using the pixel values of the image, so that it is not necessary to use a table of the surface. Further, by forming the rectangular area with blocks and vertices as described later, it is possible to simplify the calculation of the internal points and to prevent the distortion of the block boundary.
[0016]
The process using the bilinear curved surface will be described in more detail. First, the entire screen is divided into blocks of a predetermined pixel unit. Each of these blocks can be, for example, a block of 8 × 8 pixels having 8 pixels in the horizontal direction and 8 pixels in the vertical direction, but the size of each block can be set arbitrarily.
[0017]
The block is further divided, for example, when divided into 8 × 8 pixel blocks, the blocks are sequentially divided into 4 × 4 pixel blocks and 2 × 2 pixel blocks. Here, when the vertex of the block is divided into blocks of, for example, 8 × 8 pixels, it corresponds to the pixel a at the upper left as shown in FIG. 1, but other pixels can be selected as the vertex. The same applies to a block of 4 × 4 pixels and a block of 2 × 2 pixels.
[0018]
That is, in the divided block of the largest unit, the strength of the correlation between the value calculated using the equation of the bilinear surface and the pixel value of the image is obtained, and if there is a correlation, the vertex of the block is determined. Use a representative value. If there is no correlation, the block is further divided, and the strength of the correlation is similarly obtained in the divided blocks. The block division is repeated until there is a correlation, but if it is determined that there is no correlation even if it is divided into the smallest block that can be divided, in addition to the vertices of the block, from the vertices and the bilinear surface, The error between the calculated new pixel and each pixel is quantized.
[0019]
The coordinates of the four corners of the bilinear curved surface Q (u, w) are defined as P (0,0), P (0,1), P (1,0), and P (1,1), respectively. The case is represented by the following equation.
[Equation 1]
Q (u, w) = P (0,0) (1-u) (1-w) + P (0,1) (1-u) w + P (1,0) u (1-w) + P (1, 1) uw
[0020]
According to the present invention, the pixels at the vertices of three adjacent blocks (right, lower, and diagonally lower right) are defined as P coordinates, and the value corresponding to u, w of the bilinear curved surface Q (u, w) is set to 1. By using a value that can be expressed by a power of 2 such as / 2, 1/4, 1/8, only addition / subtraction and shift operations are performed. For example, when 1/8 = 0.125, 3 bits are used. All you have to do is shift right.
[0021]
Next, 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.
FIG. 2 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 8 × 8 pixel blocks, and the thus divided 8 × 8 pixel blocks are used as a reference.
[0022]
The control routine illustrated in FIG. 2 is executed, for example, on the transmission side of the image monitoring system. First, in step S1, a threshold value for a determination process is calculated as preprocessing for encoding. Step S1 will be described later in detail with reference to FIGS.
[0023]
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 a block of 8 × 8 pixels, which will be described later in detail with reference to FIGS. 7 and 8, is performed.
[0024]
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.
[0025]
FIG. 3 is a flowchart of the first half of the subroutine of step S1 in FIG. 2, and FIG. 4 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 of FIGS. 3 and 4 calculates 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.
[0026]
First, in step S11, the number m of blocks when the entire screen is divided into blocks of 2 × 2 pixels is set. Next, in step S12, a new pixel (new pixel) is calculated from the vertex of the block of 2 × 2 pixels and the vertices of three blocks adjacent thereto. For example, as shown in FIG. 5, from the pixels A0, A2, C0 and C2, a new pixel in a block having the pixel A0 as a vertex is calculated by a bilinear curved surface.
[0027]
Next, each pixel in the block (pixels A0, A1, B0, and B1 in FIG. 5) is compared with the new pixel calculated in step S12 (step S13), and the maximum absolute value of the compared difference is detected. Then, it is registered in a first histogram (histogram 1) described later (step S14), 1 is subtracted from the number m of blocks (step S15), and whether or not the number m of blocks is 0, that is, 2 × 2 It is determined whether the processing has been completed for all of the pixel blocks. If the process has been completed, the process proceeds to the next step S17 to perform the process on the block of 4 × 4 pixels, whereas if the process has not been completed, the process returns to step S12.
[0028]
Next, in step S17, the number of
[0029]
Next, each pixel in the block (pixels A0 to A3, B0 to B3, C0 to C3, and D0 to D3 in FIG. 5) is compared with the new pixel calculated in step S18 (step S19), and the difference of the compared difference is determined. The maximum value of the absolute value is detected and registered in a second histogram (histogram 2) described later (step S20), and 1 is subtracted from the number l of blocks (step S21). No, that is, whether or not the processing has been completed for all of the 4 × 4 pixel blocks. If the process has been completed, the process proceeds to the next step S23 to perform the process on the block of 8 × 8 pixels, whereas if the process has not been completed, the process returns to step S18.
[0030]
Next, in step S23, the number k of blocks when the entire screen is divided into blocks of 8 × 8 pixels is set. Next, in step S24, a new pixel (new pixel) is calculated from the vertex of the block of 8 × 8 pixels and the vertices of three blocks adjacent thereto. For example, as shown in FIG. 5, a new pixel in a block having the pixel A0 as a vertex is calculated from the pixels A0, A8, I0, and I8 by a bilinear curved surface.
[0031]
Next, each pixel in the block (pixels A0 to A7, B0 to B7, C0 to C7, D0 to D7, E0 to E7, F0 to F7, G0 to G7, and H0 to H7 in FIG. 5) is calculated in step S24. (Step S25), and the maximum absolute value of the compared difference is detected and registered in a third histogram (histogram 3) described later (Step S26). Is subtracted (step S27), and it is determined whether or not the number of blocks k is 0, that is, whether or not the processing has been completed for all the blocks of 8 × 8 pixels. When the processing is completed, the threshold values for the block of 2 × 2 pixels, the block for the block of 4 × 4 pixels, and the block for the block of 8 × 8 pixels and the
[0032]
FIG. 7 is a flowchart of the first half of the subroutine of step S3 in FIG. 2, and FIG. 8 is a flowchart of the second half of the subroutine of step S3 in FIG. This subroutine performs variable length coding.
[0033]
First, in step S31, a prediction error of a vertex of a predetermined block of 8 × 8 pixels is quantized based on the quantization table calculated in step S29 of FIG. For example, when a block is divided as shown in FIG. 9A, pixels A0, A8,. . . I0, I8,. . . Is quantized.
[0034]
Next, in step S32, the quantized prediction error is inversely quantized to calculate the error, and the original vertex is corrected by adding and subtracting it to calculate a new vertex. In the case of FIG. 9A, as shown in FIG. 9B, A0 ′, A8 ′, I0 ′ and I8 ′ are new vertices.
[0035]
Next, a new pixel is calculated from the new vertex and the bilinear curved surface (step S33), and the new pixel calculated in this way and pixels in the block (for example, 64 pixels A0 to A7, B0 to B7, 64 pixels in FIG. 9A). C0 to C7, D0 to D7, E0 to E7, F0 to F7, G0 to G7, and H0 to H7) (step S34).
[0036]
Next, in step S35, as a result of the comparison, it is determined whether or not the maximum value of the error is within the threshold value for the block of 8 × 8 pixels obtained in step S29 of FIG. If the value is within the threshold value, the subroutine ends to perform the processing for the next block of 8 × 8 pixels, whereas if the value is outside the threshold value, the processing of the block of 4 × 4 pixels is performed. Proceed to step S36 to perform.
[0037]
In step S36, 4 is set as the number k of blocks of 4 × 4 pixels. Next, in step S37, among the vertices of the predetermined 4 × 4 pixel block, the prediction errors of vertices other than the vertices quantized in step S31 are quantized based on the quantization table calculated in step S29 in FIG. I do. For example, when the block is divided as shown in FIG. 9A, the prediction errors of the pixels A4, E0, E4, E8, and I4 are quantized.
[0038]
Next, in step S38, the quantized prediction error is inversely quantized to calculate the error, and correction is performed by adding and subtracting the original vertex to calculate a new vertex. In the case of FIG. 9A, as shown in FIG. 9C, A0 ', A4', A8 ', E0', E4 ', E8', I0 ', I4' and I8 'are new vertices.
[0039]
Next, a new pixel is calculated from the new vertex (in the first block, A0 ′, A4 ′, E0 ′ and E4 ′ as shown in FIG. 9D) and the bilinear surface (step S39), and the new pixel thus calculated is calculated. And the pixels in the block (for example, 16 pixels A0 to A3, B0 to B3, C0 to C3, and D0 to D3 in FIG. 9A) (Step S40).
[0040]
Next, in step S41, as a result of the comparison, it is determined whether or not the maximum value of the error is within the threshold value for the block of 4 × 4 pixels obtained in step S29 of FIG. If it is within the threshold value, the process proceeds to step S51 described below to perform processing on the next block of 4 × 4 pixels, whereas if it is outside the threshold value, the block of 2 × 2 pixels is processed. The process proceeds to step S42 to perform the process of.
[0041]
In step S42, 4 is set as the
[0042]
Next, in step S44, the quantized prediction error is inversely quantized to calculate the error, and the original vertex is corrected by adding and subtracting it to calculate a new vertex. In the case of FIG. 9A, as shown in FIG. 9E, A0 ', A2', A4 ', C0', C2 ', C4', E0 ', E2', and E4 'are new vertices.
[0043]
Next, a new pixel is calculated from the new vertex (A0 ′, A2 ′, C0 ′ and C2 ′ as shown in FIG. 9F in the first block) and the bilinear surface (step S45). And the pixels in the block (for example, four pixels A0, A1, B0 and B1 in FIG. 9A) are compared (step S46).
[0044]
Next, in step S47, as a result of the comparison, it is determined whether or not the maximum value of the error is within the threshold value for the block of 2 × 2 pixels obtained in step S29 of FIG. If it is within the threshold value, the process proceeds to step S49 to be described later in order to perform processing on the next block of 2 × 2 pixels. After quantizing the difference from the pixel for each of the four pixels (step S48), the process proceeds to step S49.
[0045]
In step S49, 1 is subtracted from the number l of blocks. Thereafter, in step S50, it is determined whether or not the processing has been completed for all the blocks of 2 × 2 pixels. When the process is completed, the process proceeds to a step S51, whereas when the process is not completed, the process returns to the step S43.
[0046]
In step S51, 1 is subtracted from the number k of blocks. Thereafter, in step S52, it is determined whether or not the processing has been completed for all the blocks of 4 × 4 pixels. When the processing is completed, this subroutine is completed. On the other hand, when the processing is not completed, the processing returns to step S37.
[0047]
The subroutine shown in FIG. 7 and FIG. 8 is performed for all of the divided blocks of 8 × 8 pixels.
Due to the quantization error of the value of each vertex, the coded bit generation amount predicted in the initial stage fluctuates. Therefore, for each block line of 8 × 8 pixels, referring to the histograms of the block of 8 × 8 pixels, the block of 4 × 4 pixels, and the block of 2 × 2 pixels, the number of blocks predicted to be within the threshold value and When the number of blocks within the threshold is relatively small, that is, when the number of encoded bits is relatively large, the comparison is performed with the number of blocks within the threshold in the actual processing. Increase the threshold to reduce the amount of generated coding.
[0048]
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.
[0049]
10 to 13 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.
[0050]
Next, in step S102, four vertices of the block of 8 × 8 pixels are quantized. For example, pixels A0, A8, I0 and I8 in FIG. 14A correspond to four vertices. Next, in step S103, the vertex quantized in step S102 is inversely quantized to calculate a new vertex. For example, new vertices of four vertices corresponding to pixels A0, A8, I0, and I8 in FIG. 14A are pixels A0 ', A8', I0 ', and I8', respectively.
[0051]
Next, in step S104, a new pixel in a block of 8 × 8 pixels is calculated from the four new vertices calculated in step S103 and the bilinear surface, and a residual between the new pixel and each pixel is obtained. . These residuals are represented by A0'-1, A1-1,. . . H7-1 (FIG. 14B).
[0052]
Next, in step S105, the maximum value (absolute value) of the residual between the new pixel and each pixel is detected and stored in the first residual table (residual table 1). Register in the histogram (Histogram 1).
[0053]
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.
[0054]
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 vertex value data of the block of 8 × 8 pixels, the
[0055]
Next, the residual table 1 is compared with the threshold calculated in step S108 (step S109), and it is determined whether the residual is within the threshold (step S110). If the residual is within the threshold, the process skips to step S118 described later.
[0056]
When the residual is not within the threshold value, in order to process a block of 4 × 4 pixels, in step S111, 4 is set as the number k of blocks when the block of 8 × 8 pixels is divided into blocks of 4 × 4 pixels. Set.
[0057]
Next, in step S112, the residuals of the four vertices of the 4 × 4 pixel block stored in the residual table 1 are quantized. For example, when the image is divided into blocks of 4 × 4 pixels as shown in FIG. 14C, A0′-1, A4-1, E0-1, and E4-1 become residuals of the target vertices. Next, in step S113, the residual of the vertex quantized in step S112 is inversely quantized to calculate a new residual. For example, new residuals (new residuals) of the residuals A0'-1, A4-1, E0-1 and E4-1 are A0 "-1, A4'-1, E0'-1 and E4 '. -1 (FIG. 14C).
[0058]
Next, in step S114, a new residual in a block of 4 × 4 pixels is calculated from the new residual of the four vertices calculated in step S113 and the bilinear surface, and the residual of each pixel is calculated. Find the residual. These residuals are represented by A0 ″ -2, A1-2,. . . D3-2 (FIG. 14D).
[0059]
Next, in step S115, the maximum value (absolute value) of the residual between the new residual and the residual of each pixel is detected, stored in the second residual table (residual table 2), and , In the second histogram (histogram 2).
[0060]
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.
[0061]
If the processing for the block of 4 × 4 pixels has been completed, or if it is determined in step S110 that the threshold value is larger than the residual, whether the processing for all blocks (residual table 1) has been completed in step S118 Determine whether or not.
[0062]
In step S119, a threshold value for the block of 4 × 4 pixels is calculated from the free space after the previous frame processing in the buffer memory, the information bit amount of the residual value data of the block of 4 × 4 pixels, the
[0063]
Next, the residual table 2 is compared with the threshold calculated in step S119 (step S120), and it is determined whether the residual is within the threshold (step S121). If the residual is within the threshold, the process skips to step S129 described later.
[0064]
When the residual is not within the threshold value, in order to process a block of 2 × 2 pixels, in step S122, 4 is set as the number m of blocks when the block of 4 × 4 pixels is divided into blocks of 2 × 2 pixels. Set.
[0065]
Next, in step S123, the residuals of the four vertices of the 2 × 2 pixel block stored in the residual table 2 are quantized. For example, when the image is divided into 2 × 2 pixel blocks as shown in FIG. 14E, A0 ″ −2, A2-2, C0−2, and C2-2 become residuals of the target vertices. Next, in step S124, the vertex quantized in step S123 is inversely quantized to calculate a new vertex. For example, new residuals (new residuals) of the residuals A0 ″ -2, A2-2, C0-2, and C2-2 are A0 ′ ″-2, A2′-2, C0′-2 and C2′-2 (FIG. 14E).
[0066]
Next, in step S125, a new residual in a block of 2 × 2 pixels is calculated from the residual of the four vertices calculated in step S124 and the bilinear surface, and the new residual and the residual of each pixel are calculated. Find the residual with the difference. These residuals are A0 '''-3,A2'-3,C0'-3, and C2'-3 (FIG. 14F).
[0067]
Next, in step S126, the maximum value (absolute value) of the difference between the new residual and the residual of each pixel is detected and stored in a third residual table (residual table 3). No. 3 (histogram 3).
[0068]
Next, 1 is subtracted from the number m of blocks (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.
[0069]
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 residual, in step S129, all the blocks of 4 × 4 pixels (residual table 2) are processed. It is determined whether or not the process has been completed.
[0070]
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 residual value data of the 2 × 2 pixel block, the
[0071]
Next, the residual table 3 is compared with the threshold calculated in step S130 (step S131), and it is determined whether the residual is within the threshold (step S132). If the residual is within the threshold, the process skips to step S134 described later.
[0072]
If the residual is not within the threshold, the residual of four pixels is quantized (step S133), and thereafter, it is determined whether or not the processing for all the blocks of 2 × 2 pixels has been completed (step S134). When the process is completed, the control routine is terminated. When the process is not completed, the process returns to step S131.
[0073]
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.
[0074]
FIG. 15 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
[0075]
The operation of the present embodiment will be described. A digitized image signal from a surveillance camera (not shown) is input to the
[0076]
The prediction error quantizer 3a calculates and quantizes the prediction error of the detected vertex. The quantization by the prediction error quantizer 3a reduces the number of data bits. The prediction error inverse quantizer and new
[0077]
The new pixel calculation circuit 5a calculates a new pixel in the block using the new vertex calculated by the prediction error dequantizer and the new
[0078]
The error calculation circuit 6a compares the new pixel calculated by the new pixel calculation circuit 5a with 64 pixels in the block to calculate an error. Each of the error comparison circuits 7a compares the error calculated by the error calculation circuit 6a with a threshold value. When the error is within the threshold value, the
[0079]
The 4 × 4
[0080]
The
[0081]
The new
[0082]
The
The processing from the 4 × 4
[0083]
The 2 × 2
[0084]
The prediction error quantizer 3c calculates and quantizes the prediction error of the vertex detected by the 2 × 2
[0085]
The new pixel calculation circuit 5c calculates a new pixel in the block using the new vertex calculated by the prediction error dequantizer and the new vertex calculation circuit 4c and the bilinear surface expressed by [Equation 1]. For the vertices that overlap the block of 4 × 4 pixels, the outputs of the prediction error inverse quantizer and the new
[0086]
The
[0087]
The signal output from the
[0088]
According to the above embodiment, the surveillance camera uses a bilinear surface of block processing of 8 × 8 pixels for a flat or gentle slope such as a road or a wall, and uses a bi-linear surface for undulating parts. By performing block processing of 2 × 2 pixels, a suitable image monitoring system can be configured. Furthermore, when the flat or gentle slope is relatively large, a transmission system capable of further increasing the compression ratio by using a block of 16 × 16 pixels larger than a block of 8 × 8 pixels is to be constructed. Can be.
[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 vertices of the block of 8 × 8 pixels, the block of 4 × 4 pixels, and the block of 2 × 2 pixels and converting them into variable-length bits was performed. By performing transmission using fixed-length bits, 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 diagram showing vertices of a divided block.
FIG. 2 is a flowchart of an embodiment of an image encoding method according to the present invention.
FIG. 3 is a part of a flowchart of a subroutine of step S1 in FIG. 2;
FIG. 4 is a part of a flowchart of a subroutine of step S1 in FIG. 2;
FIG. 5 is a diagram for explaining calculation of a new pixel.
6 is a
FIG. 7 is a part of a flowchart of a subroutine of step S3 in FIG. 2;
FIG. 8 is a part of a flowchart of a subroutine of step S3 in FIG. 2;
FIG. 9 is a diagram for explaining calculation of a new vertex.
FIG. 10 is a part of a flowchart of another embodiment of the image encoding method according to the present invention.
FIG. 11 is a part of a flowchart of another embodiment of the image encoding method according to the present invention.
FIG. 12 is a part of a flowchart of another embodiment of the image encoding method according to the present invention.
FIG. 13 is a part of a flowchart of another embodiment of the image encoding method according to the present invention.
FIG. 14 is a diagram for explaining a residual of a vertex of a block.
FIG. 15 is a block diagram of an embodiment of an image encoding device according to the present invention.
[Explanation of symbols]
1 Input section
3a, 3b, 3c prediction error quantizer
4a, 4b, 4c prediction error inverse quantizer and new vertex calculation circuit
5a, 5b, 5c New pixel 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,
Using the vertices and bilinear surfaces of the pixels in the block, calculate a new pixel value,
Calculate the difference between the pixel value in the block and the new pixel value,
Based on whether or not these differences are within a predetermined range, 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.
全画面を、所定の画素単位のブロックに分割するブロック分割手段と、
前記ブロック内の画素の頂点及び双一次曲面を用いて、新たな画素値を算出する新画素値算出手段と、
前記ブロック内の画素値と、前記新たな画素値との差をそれぞれ算出する差算出手段と、
これらの差が所定の範囲内であるか否かに基づいて、前記ブロックの符号化を行うか前記ブロックを更に分割するかの判定を行う判定手段と、
その判定の結果に応じた適切な画素単位のブロックで符号化処理を行う符号化手段とを具えることを特徴とする画像符号化装置。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,
New pixel value calculation means for calculating a new pixel value using the vertices and bilinear surfaces of the pixels in the block,
A pixel value in the block, and a difference calculation unit for calculating a difference between the new pixel value,
A determination unit configured to determine whether to encode the block or to further divide the block, based on whether these differences are within a predetermined range;
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.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2002174307A JP2004023370A (en) | 2002-06-14 | 2002-06-14 | Image encoding method and apparatus |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2002174307A JP2004023370A (en) | 2002-06-14 | 2002-06-14 | Image encoding method and apparatus |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2004023370A true JP2004023370A (en) | 2004-01-22 |
Family
ID=31173308
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2002174307A Pending JP2004023370A (en) | 2002-06-14 | 2002-06-14 | Image encoding method and apparatus |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2004023370A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2012114386A1 (en) * | 2011-02-25 | 2012-08-30 | 三菱電機株式会社 | Image vectorization device, image vectorization method, and image vectorization program |
JP2013509086A (en) * | 2009-10-22 | 2013-03-07 | トムソン ライセンシング | Method and apparatus for DC intra prediction mode for video encoding and decoding |
CN116074530A (en) * | 2022-01-19 | 2023-05-05 | 杭州海康威视数字技术股份有限公司 | Image decoding method, encoding method and device |
-
2002
- 2002-06-14 JP JP2002174307A patent/JP2004023370A/en active Pending
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2013509086A (en) * | 2009-10-22 | 2013-03-07 | トムソン ライセンシング | Method and apparatus for DC intra prediction mode for video encoding and decoding |
JP2016015752A (en) * | 2009-10-22 | 2016-01-28 | トムソン ライセンシングThomson Licensing | Method and apparatus for dc intra prediction mode for video encoding and decoding |
US9277227B2 (en) | 2009-10-22 | 2016-03-01 | Thomas Licensing | Methods and apparatus for DC intra prediction mode for video encoding and decoding |
JP2018110428A (en) * | 2009-10-22 | 2018-07-12 | トムソン ライセンシングThomson Licensing | Method and apparatus for DC intra prediction mode for video encoding and decoding |
WO2012114386A1 (en) * | 2011-02-25 | 2012-08-30 | 三菱電機株式会社 | Image vectorization device, image vectorization method, and image vectorization program |
CN116074530A (en) * | 2022-01-19 | 2023-05-05 | 杭州海康威视数字技术股份有限公司 | Image decoding method, encoding method and device |
CN116668705A (en) * | 2022-01-19 | 2023-08-29 | 杭州海康威视数字技术股份有限公司 | An image decoding method, encoding method and device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP5290325B2 (en) | Quantization based on rate distortion modeling for CABAC coder | |
US5867221A (en) | Method and system for the fractal compression of data using an integrated circuit for discrete cosine transform compression/decompression | |
TWI492634B (en) | Two pass quantization for cabac coders | |
KR100578682B1 (en) | Hierarchical Motion Estimation Apparatus and Method Using Variable Block Size | |
US5610659A (en) | MPEG encoder that concurrently determines video data encoding format and rate control | |
JP2000511366A (en) | Apparatus and method for variable block size motion estimation based on quadrant tree | |
JPH09307904A (en) | Quantizer for video signal coding system | |
JP2000511366A6 (en) | Apparatus and method for variable block size motion estimation based on quadrant tree | |
KR20010033797A (en) | Apparatus and method for performing scalable hierarchical motion estimation | |
KR20050061762A (en) | Method of encoding mode determination and motion estimation, and encoding apparatus | |
JP2006157910A (en) | Filtering method and apparatus for removing blocking effect | |
EP0768008B1 (en) | Device and method for coding video pictures | |
US6252905B1 (en) | Real-time evaluation of compressed picture quality within a digital video encoder | |
JP2001045489A (en) | Image prediction decoding method and apparatus | |
US7145953B2 (en) | Filtering method and apparatus for removing blocking artifacts and/or ringing noise | |
KR100961760B1 (en) | Motion estimation method and apparatus referencing discrete cosine transform coefficients | |
CN104320657A (en) | Method for selecting prediction mode of HEVC lossless video coding and corresponding coding method | |
JP2010534015A (en) | Image processing method and corresponding electronic device | |
EP1516493B1 (en) | A method and system for optimizing image sharpness during coding | |
GB2308768A (en) | Video encoding based on inter block redundancy | |
US5724096A (en) | Video signal encoding method and apparatus employing inter-block redundancies | |
JP2004023370A (en) | Image encoding method and apparatus | |
WO2006134525A1 (en) | Coding and decoding method and device for improving video error concealment | |
EP0784407B1 (en) | Transform coefficient select method and apparatus for transform coding system | |
JP2004023372A (en) | Image encoding method and apparatus |
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 |