JP3632995B2 - Image encoding / decoding device - Google Patents

Image encoding / decoding device Download PDF

Info

Publication number
JP3632995B2
JP3632995B2 JP20842694A JP20842694A JP3632995B2 JP 3632995 B2 JP3632995 B2 JP 3632995B2 JP 20842694 A JP20842694 A JP 20842694A JP 20842694 A JP20842694 A JP 20842694A JP 3632995 B2 JP3632995 B2 JP 3632995B2
Authority
JP
Japan
Prior art keywords
code amount
circuit
scale factor
encoding
block
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP20842694A
Other languages
Japanese (ja)
Other versions
JPH0879762A (en
Inventor
康弘 菊池
孝介 久保田
和史 水澤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Panasonic Corp
Panasonic Holdings Corp
Original Assignee
Panasonic Corp
Matsushita Electric Industrial 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 Panasonic Corp, Matsushita Electric Industrial Co Ltd filed Critical Panasonic Corp
Priority to JP20842694A priority Critical patent/JP3632995B2/en
Publication of JPH0879762A publication Critical patent/JPH0879762A/en
Application granted granted Critical
Publication of JP3632995B2 publication Critical patent/JP3632995B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

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

Description

【0001】
【産業上の利用分野】
本発明は、動画像の蓄積や伝送などに使用する画像符号化復号装置に関するものである。
【0002】
【従来の技術】
動画像の蓄積や伝送を行う場合、各フレームの発生符号量が一定になることが望まれる。符号量制御可能な画像符号化復号装置は、例えば特開平5−63994号公報に記載されている方式で実現することができる。図11はこの方式のブロック結線図であり、画像アクティビティとDCT係数により算出した各ブロックの符号量配分値(符号量配分値)、及び画像アクティビティにより算出した量子化テーブルを用いて符号化し、量子化テーブルを更新するパス1の処理、符号量配分値とパス1で更新した量子化テーブルを用いて符号化するパス2の処理を行う。
【0003】
以下、パス1を説明する。前処理回路114は入力端子110から入力した画像データの差分により画像アクティビティを算出する。閾値設定回路124は画像アクティビティにより閾値Yを設定する。DCT回路120はフレームメモリ118に蓄積された画像データをDCT(離散コサイン変換)し、絶対値回路134はDCT回路120が出力するDCT係数の絶対値を求め、比較回路146に入力する。比較回路146は絶対値回路134が出力するDCT係数の絶対値Xが閾値Yを越えると有意にする。カウンタ154は比較回路146の出力が有意になった回数を計数する。レジスタ158は1フレーム分のカウンタの計数値(総ブロックアクティビティ)を格納する。ビット配分回路162は、端子166から与えられた目標符号量、ブロック単位のカウンタ164の計数値(ブロックアクティビティ)、及びレジスタ158に格納された総ブロックアクティビティにより各ブロックの符号量配分値Bを算出する。量子化テーブル回路126は前処理回路114が算出した画像アクティビティにより量子化テーブルを設定する。量子化回路132は量子化テーブル回路126で設定された量子化テーブルによりDCT回路120が出力するDCT係数を量子化し、ハフマン符号化回路138は量子化回路132で量子化されたDCT係数をハフマン符号化する。符号量カウンタ172はハフマン符号化回路138が出力する符号を計数し、ブロック毎に計数値Aを求める。比較回路170は、符号量カウンタが出力する計数値Aが符号量配分値Bに達すると符号化停止信号を出力し、ハフマン符号化回路138の符号化動作を停止させる。1フレーム分の符号化が終了した時点で、符号量カウンタ172が出力する1フレーム分の符号量、端子166から与えられる目標符号量、及び前処理回路114で算出された画像アクティビティにより量子化テーブル回路126は量子化テーブルを更新する。以上がパス1の処理である。
【0004】
パス2ではパス1で更新した量子化テーブルを用いてパス1と同様に符号化する。以上の処理によって符号量が制御できる。
【0005】
【発明が解決しようとする課題】
しかしながら、上記のような構成では発生符号量を用いて量子化テーブルを更新するため、1フレーム当たり2回符号化しなければならない。また、符号量配分値を算出するためにDCTしなければならないし、その結果得られるDCT係数によって符号量配分値を算出するための周辺回路、すなわち閾値設定回路124、絶対値回路134、比較回路146、カウンタ154、レジスタ158が必要となる。したがって、符号化に時間がかかり、回路構成が複雑である。
【0006】
本発明は上記従来の課題を解決するもので、高精度な符号量制御を高速に簡単な回路構成で実現できる画像符号化復号装置を提供することを目的とする。
【0007】
【課題を解決するための手段】
上記の目的を達成するために本発明の画像符号化復号装置は第1に、画像データを蓄積し、M×N画素(M、Nは自然数)のブロック毎に出力するメモリと、前記メモリが出力する画像データを離散コサイン変換して離散コサイン変換係数を出力する離散コサイン変換回路と、前記メモリが出力する画像データによりエッジ強度を表すパラメータE[n](nはブロックの番号)をブロック毎に求めて出力するエッジ強度算出回路と、前記パラメータE[n]と量子化テーブルを設定するスケールファクタSの対数の関係と、前記スケールファクタSとブロック毎の発生符号量B [n] の対数の関係が直線近似できることを利用し、予め設定した目標符号量と前記パラメータE[n]からスケールファクタSを算出して出力するスケールファクタ算出回路と、予め設定した基本量子化テーブルと前記スケールファクタSとの積から量子化テーブルを設定して出力する量子化テーブル設定回路と、前記量子化テーブルを用いて前記離散コサイン変換係数を量子化して出力する量子化回路と、前記量子化回路で量子化された離散コサイン変換係数を可変長符号化して出力する符号化回路とを具備するものである。
【0008】
第2に、請求項1記載の画像符号化復号装置において、前記目標符号量と前記パラメータE [n] によりブロック毎に符号量配分値A [n] を割り当てる符号量配分回路と、前記符号化回路が出力する符号の符号長を計数し、ブロック毎の前記発生符号量B [n] を出力する計数回路と、前記発生符号量B [n] を前記符号量配分値A [n] とブロック毎に比較し、前記B [n] が前記A [n] に達するとともに当該ブロックの符号化動作を停止させる比較回路とをさらに具備するとを具備するものである。
【0009】
第3に、請求項1又は2記載の画像符号化復号装置において、前記スケールファクタ算出回路は、前記パラメータE [n] と量子化テーブルを設定するスケールファクタSの対数の関係と、前記スケールファクタSと発生符号量B [n] の対数の関係がそれぞれ直線近似できることを利用し、予め設定した目標符号量と前記パラメータE [n] から算出したスケールファクタSと、前フレームの発生符号量G [i-1] (iはフレームの番号)と前フレームのスケールファクタS [i-1] により算出した修正された前フレームのスケールファクタRlとを、フレーム間の相関を示すパラメータkにより選択して現フレームのスケールファクタS [i] として量子化テーブル設定回路に出力することを特徴とするものである。
【0010】
第4に、画像データを蓄積し、M×N画素(M、Nは自然数)のブロック毎に出力するメモリと、前記メモリが出力する画像データを離散コサイン変換して離散コサイン変換係数を出力する離散コサイン変換回路と、前記メモリが出力する画像データによりエッジ強度を表すパラメータE[n](nはブロックの番号)をブロック毎に求めて出力するエッジ強度算出回路と、前記パラメータE[n]と量子化テーブルを設定するスケールファクタSの対数の関係と、前記スケールファクタSと発生符号量B [n] の対数の関係がそれぞれ直線近似できることを利用し、予め設定した目標符号量と前記パラメータE [n] から算出したスケールファクタSと、前フレームの1回目の符号化におけるスケールファクタS [i-1][1] を発生符号量G [i-1][1] (iはフレームの番号)と目標符号量との比で補正されたスケールファクタと、前フレームの2回目の符号化におけるスケールファクタS [i-1][2] を発生符号量G [i-1][2] と目標符号量との比で補正されたスケールファクタとを、前フレームの発生符号量G [i-1][1] と発生符号量G [i-1][2] との目標符号量との差の大きさにより補正されたスケールファクタR2を選択し、前記スケールファクタSと前記補正されたスケールファクタR2をフレーム間の相関を示すパラメータkにより現フレームの1回目の符号化のスケールファクタS[i][1]を算出して、さらに前記現フレームの1回目の符号化のスケールファクタS[i][1]に発生符号量G [i][1] と目標符号量Tとの比を乗ずることによって現フレームの2回目の符号化のスケールファクタS[i][2]を算出して出力するスケールファクタ算出回路と、予め設定した基本量子化テーブルと前記現フレームの1回目の符号化のスケールファクタS [i][1] 、あるいは前記現フレームの2回目の符号化のスケールファクタS [i][2] との積からそれぞれ現フレームの1回目と2回目の符号化に用いる量子化テーブルを設定して出力する量子化テーブル設定回路と、前記量子化テーブルを用いて前記離散コサイン変換係数を量子化して出力する量子化回路と、前記量子化回路で量子化された離散コサイン変換係数を可変長符号化して出力する符号化回路と、前記目標符号量、現フレームの1回目の符号化における各ブロックの前記発生符号量B[n]、及び現フレームの1回目の符号化の発生符号量G[i][1]により各ブロックの符号量配分値A[n]を算出する符号量配分回路と、前記符号化回路が出力する符号の符号長を計数し、ブロック毎の前記発生符号量B[n]と現フレーム内の発生符号量G[i][m](mは符号化回数)を出力する計数回路と、各フレームの2回目の符号化時に前記発生符号量B[n]を前記符号量配分値A[n]とブロック毎に比較し、前記B[n]が前記A[n]に達するとともに当該ブロックの符号化動作を停止させる比較回路とを具備するものである。
【0011】
第5に、請求項1〜4のいずれかに記載の画像符号化復号装置において、エッジ強度を表すパラメータE [n] は、画像データを二値化し、二値化した画像データのエッジのカウント数によって求めることを特徴とするものである。
【0012】
【作用】
これらの構成により本発明は、第1にエッジ強度を表すパラメータとスケールファクタと発生符号量の関係を利用して1フレーム当たり1回の符号化で高精度な符号量制御ができる。また、符号量制御のためにDCTする必要もなく、DCT係数によって符号量配分値を算出するための周辺回路も不要である。したがって高精度な符号量制御を高速に簡単な回路構成で実現できる。
【0013】
第2に、エッジ強度を表すパラメータとスケールファクタと発生符号量の関係を利用して1フレーム当たり1回の符号化で高精度な符号量制御ができ、さらにエッジ強度を表すパラメータを用いて各ブロックの符号量配分値を算出することにより、発生符号量が目標符号量を越えないように符号量を制御することができ、DCT係数を用いずに簡単な演算で符号量制御の精度を向上させることができる。
【0014】
第3に、エッジ強度を表すパラメータとスケールファクタと発生符号量の関係を利用して1フレーム当たり1回の符号化で高精度な符号量制御ができ、さらに計数回路でフレーム内の発生符号量を計数することにより、エッジ強度を表すパラメータとスケールファクタとブロック内の発生符号量の関係だけでなく前フレームの発生符号量とスケールファクタも用いて、より最適なスケールファクタが算出できる。
【0015】
第4に、1回目の符号化で算出されたスケールファクタと符号量配分値を用いて2回目の符号化をすることにより、簡単な回路構成で非常に高精度な符号量制御ができる。
【0016】
第5に、エッジ強度を表すパラメータE [n] は、画像データを二値化し、二値化した画像データのエッジのカウント数によって求めることを特徴とする。したがって、非常に簡単な回路構成で符号量が制御できる。
【0017】
【実施例】
(実施例1)
図1は、本発明第1の実施例における画像符号化復号装置符号化部のブロック結線図である。11はメモリであり、画像データを蓄積し、8×8画素のブロック毎に出力する。12はDCT回路であり、画像データをDCT(離散コサイン変換)し、DCT係数を出力する。13は量子化回路であり、DCT係数を量子化して出力する。14は符号化回路であり、量子化されたDCT係数をハフマン符号化して出力する。15はエッジ強度算出回路であり、エッジ強度を表すパラメータをブロック毎に算出し、出力する。16はスケールファクタ算出回路であり、量子化テーブルを設定するためのスケールファクタを算出する。17は量子化テーブル設定回路であり、量子化テーブルを設定して出力する。
【0018】
以下、図1を用いて本発明第1の実施例における画像符号化復号装置符号化部の動作を説明する。メモリ11は、端子1から入力した画像データを蓄積し、8×8画素のブロック毎に出力する。DCT回路12は、メモリ11がブロック毎に出力する画像データをDCTし、DCT係数を出力する。量子化回路13は、量子化テーブル設定回路17が設定した量子化テーブルを用いてDCT回路12が出力するDCT係数を量子化し、出力する。符号化回路14は、量子化回路13で量子化されたDCT係数をハフマン符号化し、符号を出力する。エッジ強度算出回路15は、メモリ11が出力する画像データにより、(数1)を用いてエッジ強度を表すパラメータE[n]をブロック毎に算出し、出力する。nはブロックの番号、Pは各画素の画像データ、hは水平方向の画素の番号、vは垂直方向の画素の番号を示す。
【0019】
【数1】

Figure 0003632995
【0020】
パラメータE[n]の対数とブロック内の発生符号量B[n]の対数の関係を調べると、実験的に図2の直線関係が得られた。また、量子化テーブルを設定するためのスケールファクタSの対数とB[n]の対数も、実験的に図3の直線関係が得られた。したがって、E[n]の対数とSの対数とB[n]の対数の関係は、(数2)のように平面で近似することができる。(数2)において、a,b,c,dは定数である。
【0021】
【数2】
Figure 0003632995
【0022】
B[n]を1フレーム分加算すればフレーム内の発生符号量Gになり、さらにGを予め設定した目標符号量Tで置き換えれば、(数3)が得られる。(数3)のγは(数4)であり、βは(数5)である。Nはフレーム内のブロック数であり、(数4)のα[n]は(数6)である。
【0023】
【数3】
Figure 0003632995
【0024】
【数4】
Figure 0003632995
【0025】
【数5】
Figure 0003632995
【0026】
【数6】
Figure 0003632995
【0027】
したがって、(数3)によりG=Tを満たすSが算出できるので、高い精度で符号量が制御できる。スケールファクタ算出回路16は、エッジ強度算出回路15が出力するパラメータE[n]と端子3から入力した目標符号量Tにより、(数3)を用いてスケールファクタSを算出する。量子化テーブル設定回路17は、予め設定した基本量子化テーブルを端子4から入力し、基本量子化テーブルにスケールファクタ算出回路16が出力するSをかけて量子化テーブルを設定し、量子化回路13に出力する。以上が本発明第1の実施例における画像符号化復号装置符号化部の動作である。
【0028】
復号部は、符号化部と逆の動作を行う。すなわち、符号化回路が出力した符号の復号、逆量子化、逆DCTを行い、画像データを出力する。
【0029】
以上のように、エッジ強度を表すパラメータとスケールファクタと発生符号量の関係を利用すれば、1フレーム当たり1回の符号化で高精度な符号量制御ができる。また、符号量制御のためにDCTする必要もなく、DCT係数によって符号量配分値を算出するための周辺回路も不要である。したがって、本実施例により、高精度な符号量制御を高速に簡単な回路構成で実現できる。
【0030】
なお、本実施例では(数1)すなわち1次微分によりエッジ強度を表すパラメータE[n]を算出したが、2次微分など他のエッジ検出オペレータを用いても良い。(数2)に示した平面は、輝度成分と色差成分で別々に求めても良い。この場合、輝度成分の発生符号量と色差成分の発生符号量のフレーム内の和を目標符号量で置き換えることにより、スケールファクタが算出できる。(数2)の発生符号量B[n]は直流成分によるものと交流成分によるものが含まれているが、B[n]の代わりに交流成分のみの発生符号量Bac[n]を用いても良い。この場合、フレーム内の交流成分の発生符号量Gacを目標符号量Tで置き換え、交流成分によるスケールファクタSacを算出し、Sacを用いてフレーム内の直流成分の発生符号量Gdcを求める。さらに、目標符号量Tに対するGdcの割合によってSacを補正し、スケールファクタを決定する。直流成分はブロック内の画素値を平均することによって求められ、Gdcは直流成分のみハフマン符号化することによって求められる。GdcはGacと比較して非常に小さいことが多いので、Sacを補正しなくても良い。以上、ブロックを単位としてスケールファクタを算出する実施例を述べたが、ブロックの代わりに輝度成分のブロックと色差成分のブロックから構成されるMDU(minimum data unit)を単位としても良い。
【0031】
また、(数3)では、予め設定した目標符号量Tを用いたが、符号化回路14が出力する符号の符号長を加算してフレーム内の発生符号量Gを求め、(数7)によりフレーム毎に目標符号量を更新してもよい。(数7)において、iはフレーム番号、Tは予め設定した目標符号量、Tvは各フレームの目標符号量を示す。
【0032】
【数7】
Figure 0003632995
【0033】
(実施例2)
図4は、本発明第2の実施例における画像符号化復号装置符号化部のブロック結線図である。図4において、メモリ11、DCT回路12、量子化回路13、符号化回路14、エッジ強度算出回路15、スケールファクタ算出回路16、量子化テーブル設定回路17は実施例1と同じである。21は符号量配分回路であり、各ブロックの符号量配分値を算出する。22は計数回路であり、符号化回路14が出力する符号の符号長を計数する。比較回路23は、ブロック毎に符号量と符号量配分値を比較し、符号量が符号量配分値に達した時点で当該ブロックの符号化動作を停止させる。
【0034】
以下、図4を用いて本発明第2の実施例における画像符号化復号装置符号化部の動作を説明する。メモリ11、DCT回路12、量子化回路13、符号化回路14、エッジ強度算出回路15、スケールファクタ算出回路16、量子化テーブル設定回路17の動作は、実施例1と同じでなので説明は省略する。各ブロックの発生符号量B[n]は、(数2)よりパラメータE[n]を用いて算出することができる。B[n]を1フレーム分加算すればフレーム内の発生符号量Gが得られ、Gに対するB[n]の割合によって目標符号量Tを各ブロックに配分することができる。したがって、符号量配分回路21は、エッジ強度を表すパラメータE[n]を用いて各ブロックの符号量配分値A[n]を算出する。すなわち、エッジ強度算出回路15が出力するパラメータE[n]と端子3から入力した目標符号量Tにより、(数8)を用いてA[n]を算出する。(数8)において、γは(数4)であり、α[n]は(数6)である。
【0035】
【数8】
Figure 0003632995
【0036】
計数回路22は、符号化回路14が出力する符号の符号長を計数し、ブロック毎に発生符号量B[n]を出力する。比較回路23は、計数回路22が出力する発生符号量B[n]を符号量配分回路21が出力する符号量配分値A[n]とブロック毎に比較し、B[n]がA[n]に達した時点で当該ブロックの符号化動作を停止させる。すなわち、符号化回路14に符号化データの終了を示すEOB(end ofblock)を出力させ、次のブロックに対してDCT回路12、量子化回路13、符号化回路14を動作させる。したがって、発生符号量が目標符号量を越えないようにすることができる。以上が本発明第2の実施例における画像符号化復号装置符号化部の動作である。復号部は、実施例1と同様に、符号化部と逆の動作を行う。
【0037】
以上のように、エッジ強度を表すパラメータを用いて各ブロックの符号量配分値を算出すれば、発生符号量が目標符号量を越えないように符号量を制御することができる。すなわち、DCT係数を用いずに簡単な演算で符号量制御の精度を向上させることができる。本実施例は、画像の蓄積や伝送の際にわずかでも目標符号量を越えることが許されない場合に有効である。また、実施例1と同様に、1フレーム当たり1回の符号化で符号量制御できるので、高速処理が可能である。
【0038】
(実施例3)
図5は、本発明第3の実施例における画像符号化復号装置符号化部のブロック結線図である。図5において、メモリ11、DCT回路12、量子化回路13、符号化回路14、エッジ強度算出回路15、量子化テーブル設定回路17、符号量配分回路21、比較回路23は実施例2と同じである。31は計数回路であり、符号化回路14が出力する符号の符号長を計数する。32はスケールファクタ算出回路であり、量子化テーブルを設定するためのスケールファクタを算出する。
【0039】
以下、図5を用いて本発明第3の実施例における画像符号化復号装置符号化部の動作を説明する。メモリ11、DCT回路12、量子化回路13、符号化回路14、エッジ強度算出回路15、量子化テーブル設定回路17、符号量配分回路21、比較回路23の動作は、実施例2と同じなので説明は省略する。計数回路31は、符号化回路14が出力する符号の符号長を計数し、ブロック毎に発生符号量B[n]を比較回路23に出力すると共にフレーム内の発生符号量をスケールファクタ算出回路32に出力する。スケールファクタ算出回路32は、エッジ強度を表すパラメータとスケールファクタとブロック内の発生符号量の関係、さらに前フレームの発生符号量とスケールファクタを用いて現フレームのスケールファクタを算出する。すなわち、エッジ強度算出回路15が出力するパラメータE[n]、端子3から与えられる目標符号量T、計数回路31が出力した前フレームの発生符号量G[i-1]、スケールファクタ算出回路32で算出した前フレームのスケールファクタS1[i-1]により、(数9)を用いて現フレームのスケールファクタS1[i]を算出する。(数9)において、kは(数10)で求め、R1は(数11)で求める。iはフレーム番号を示す。(数9)のxは予め定められた閾値である。(数10)のγは(数4)で求める。
【0040】
【数9】
Figure 0003632995
【0041】
【数10】
Figure 0003632995
【0042】
【数11】
Figure 0003632995
【0043】
このように前フレームの発生符号量とスケールファクタを用いることによって、より最適なスケールファクタが算出できるので、符号量制御の精度を向上させることができる。
【0044】
比較回路23は、実施例2と同様に、計数回路31が出力する発生符号量B[n]を符号量配分回路21が出力する符号量配分値A[n]とブロック毎に比較し、B[n]がA[n]に達した時点で当該ブロックの符号化動作を停止させる。以上が本発明第3の実施例における画像符号化復号装置符号化部の動作である。復号部は、実施例1と同様に、符号化部と逆の動作を行う。
【0045】
以上のように、計数回路31でフレーム内の発生符号量を計数すれば、エッジ強度を表すパラメータとスケールファクタとブロック内の発生符号量の関係だけでなく前フレームの発生符号量とスケールファクタも用いてより最適なスケールファクタが算出できる。したがって、実施例2と同じ回路規模でさらに符号量制御の精度を向上させることができる。また、実施例2と同様に、1フレーム当たり1回の符号化で符号量制御できるので、高速処理が可能である。
【0046】
なお、(数10)ではエッジ強度を表すパラメータE[n]から算出したγ[i]を用いてkを求めたが、フレーム間差分などフレーム間の相関を示すパラメータをkとしても良い。また、前フレームの発生符号量とスケールファクタを用いることによって精度が向上するので、符号量配分回路21と比較回路23を省き、符号量配分値による符号量制御を行わなくても良い。このようにすれば、回路構成が簡単になる。
【0047】
(実施例4)
図6は、本発明第4の実施例における画像符号化復号装置符号化部のブロック結線図である。図6において、メモリ11、DCT回路12、量子化回路13、符号化回路14、エッジ強度算出回路15、量子化テーブル設定回路17、比較回路23、計数回路31は実施例3と同じである。41はスケールファクタ算出回路であり、量子化テーブルを設定するためのスケールファクタを算出する。42は符号量配分回路であり、各ブロックの符号量配分値を算出する。この構成により、1回目の符号化(パス1)のスケールファクタを算出し、パス1のスケールファクタを用いて符号化した結果得られた発生符号量によって2回目の符号化(パス2)のスケールファクタを算出すると共に、各ブロックの符号量配分値を算出するパス1の処理を行う。さらに、パス1で算出されたパス2のスケールファクタと符号量配分値を用いて符号化するパス2の処理を行う。
【0048】
以下、図6を用いて本発明第4の実施例における画像符号化復号装置符号化部のパス1の動作を説明する。メモリ11、DCT回路12、量子化回路13、符号化回路14、エッジ強度算出回路15、量子化テーブル設定回路17、計数回路31の動作は、実施例3と同じなので説明は省略する。スケールファクタ算出回路41は、エッジ強度を表すパラメータE[n]とスケールファクタSとブロック内の発生符号量B[n]の関係、前フレームのパス1におけるフレーム内の発生符号量G[i-1][1]とスケールファクタS2[i-1][1]、前フレームのパス2における発生符号量G[i-1][2]とスケールファクタS2[i-1][2]を用いて現フレームのパス1のスケールファクタS2[i][1]を算出する。すなわち、エッジ強度算出回路15が出力するパラメータE[n]、端子3から与えられる目標符号量T、計数回路31が出力した前フレームのパス1の発生符号量G[i-1][1]とパス2の発生符号量G[i-1][2]、スケールファクタ算出回路41が算出した前フレームのパス1のスケールファクタS2[i-1][1]とパス2のスケールファクタS2[i-1][2]により、(数12)を用いて現フレームのパス1のスケールファクタS2[i][1]を算出する。(数12)において、kは(数10)で求め、Sは(数3)で求め、R2は(数13)で求める。(数12)のxは予め定められた閾値である。
【0049】
【数12】
Figure 0003632995
【0050】
【数13】
Figure 0003632995
【0051】
さらに、パス1のスケールファクタS 2[i][1]を用いて符号化した結果計数回路31が出力した発生符号量G[i][1]、端子3から与えられる目標符号量Tにより、(数14)を用いてパス2のスケールファクタS2[i][2]を算出する。
【0052】
【数14】
Figure 0003632995
【0053】
符号量配分回路42は、計数回路31が出力するフレーム内の発生符号量G[i][1]、及び各ブロックの発生符号量B[n][1]、端子3から与えられる目標符号量Tにより、(数15)を用いて各ブロックの符号量配分値A[n]を算出する
【0054】
【数15】
Figure 0003632995
【0055】
以上が画像符号化復号装置符号化部のパス1の動作である。
次に、本発明第4の実施例における画像符号化復号装置符号化部のパス2の動作を説明する。パス2では、パス1で算出したスケールファクタS2[i][1]と符号量配分値A[n]を用いて符号化する。メモリ11、DCT回路12、量子化回路13、符号化回路14、量子化テーブル設定回路17、計数回路31は、パス1と同じ動作を行うので説明は省略する。比較回路23は、実施例3と同様に、計数回路31が出力する発生符号量B[n][2]を符号量配分回路42が出力する符号量配分値A[n]とブロック毎に比較し、B[n][2]がA[n]に達した時点で当該ブロックの符号化動作を停止させる。以上が画像符号化復号装置符号化部のパス2の動作である。復号部は、実施例1と同様に、符号化部と逆の動作を行う。
【0056】
以上のように、パス1で算出されたスケールファクタと符号量配分値を用いてパス2の符号化をすることにより、実施例3と同じ回路規模で非常に高精度な符号量制御ができる。
【0057】
なお、フレーム内の発生符号量Gの対数とスケールファクタR3の対数の関係は(数16)のように直線で近似できる。そこで、前フレームのパス1の発生符号量G[i−1][1]とスケールファクタS2[i−1][1]、及び前フレームのパス2の発生符号量G[i−1][2]とスケールファクタS2[i−1][2]から(数16)のa、bを求め、Gに目標符号量Tを代入してR3を算出し、R2の代わりにR3を用いて(数12)のS2[i][1]を求めても良い。あるいは、(数13)で求めたR2と(数16)で求めたR3の平均値などを用いても良いし、R2とR3の一方を適応的に選択しても良い。
【0058】
【数16】
Figure 0003632995
【0059】
(実施例5)
図7は、本発明第5の実施例における画像符号化復号装置符号化部のブロック結線図である。図7において、メモリ11、DCT回路12、量子化回路13、符号化回路14は実施例1と同じである。51は量子化テーブル選択回路であり、量子化テーブルを選択する。
【0060】
以下、図7を用いて本発明第5の実施例における画像符号化復号装置符号化部の動作を説明する。メモリ11、DCT回路12、量子化回路13、符号化回路14の動作は、実施例1と同じなので説明は省略する。量子化テーブル選択回路51は、端子1から入力した画像データにより、量子化テーブルを選択して量子化回路13に出力する。量子化テーブル選択回路51の構成を図8に示す。61はカウンタであり、画像データの1ビットを入力し、立ち上がりをカウントする。62はROMであり、量子化テーブルを出力する。
【0061】
以下、図8を用いて本発明第5の実施例における画像符号化復号装置符号化部の要部である量子化テーブル選択回路の動作を説明する。カウンタ61は、端子1から入力される画像データの1ビットのみを用いることにより二値化し、エッジ強度を表すパラメータEfを求めてROM62に出力する。例えば、画像データが8ビットの場合、2の6乗ビットのみを入力することにより二値化する。エッジ強度を表すパラメータEfは、二値化された画像データの立ち上がりを1フレーム分カウントすることによって求める。
【0062】
ROM62は、カウンタ61が出力するパラメータEfにより、量子化テーブルを選択して出力する。ROM62には、予め複数の量子化テーブルが設定されており、パラメータEfによって1つの量子化テーブルが選択される。以上が本発明第5の実施例における画像符号化復号装置符号化部の動作である。復号部は、実施例1と同様に、符号化部と逆の動作を行う。
以上のように、二値化した画像データの立ち上がりをカウントして量子化テーブルを選択すれば、エッジ強度算出回路15とスケールファクタ算出回路16と量子化テーブル設定回路17の機能を量子化テーブル選択回路51のみで実現できる。また、量子化テーブル選択回路51は、カウンタ61とROM62で構成することができる。したがって、非常に簡単な回路構成で符号量が制御できる。
【0063】
なお、本実施例では、量子化テーブル選択回路51を実施例1に適用した例を述べたが、実施例2〜4に適用することも可能である。二値化は、画像データの1ビットのみを用いる代わりに、ROMを使用して行っても良い。
【0064】
エッジ強度を表すパラメータEfは、図8のカウンタで水平方向の差分の和を求めたが、その代わりに図9の回路構成で水平方向と垂直方向の差分の和を求めても良い。また、二値化した画像データのパターンによって決定されるパラメータyをm×m画素(mは正の整数)の領域(サブブロック)毎に求め、yの和をEfとしても良い。例えば、図10を用いて説明すると、メモリ81が二値化した画像データを蓄積してサブブロック毎に出力し、メモリ81が出力する画像データのサブブロック内の和xをカウンタ82で求める。加算器84は、xの値によってROM83で決定されるパラメータyを加算し、エッジ強度を表すパラメータEfを算出する。ROM83には、予め(数17)で表されるようなテーブルを設定しておく。
【0065】
【数17】
Figure 0003632995
【0066】
【発明の効果】
以上のように本発明は、第1にエッジ強度を表すパラメータとスケールファクタと発生符号量の関係を利用して1フレーム当たり1回の符号化で高精度な符号量制御ができる。また、符号量制御のためにDCTする必要もなく、DCT係数によって符号量配分値を算出するための周辺回路も不要である。したがって簡単な回路構成で高速かつ高精度に符号量制御することができる画像符号化復号装置を実現できるものである。
【0067】
第2に、エッジ強度を表すパラメータとスケールファクタと発生符号量の関係を利用して1フレーム当たり1回の符号化で高精度な符号量制御ができ、さらにエッジ強度を表すパラメータを用いて各ブロックの符号量配分値を算出することにより、発生符号量が目標符号量を越えないように符号量を制御することができ、DCTよりも簡単な演算で符号量制御の精度を向上させることができる画像符号化復号装置を実現できるものである。
【0068】
第3に、エッジ強度を表すパラメータとスケールファクタと発生符号量の関係を利用して1フレーム当たり1回の符号化で高精度な符号量制御ができ、さらに計数回路でフレーム内の発生符号量を計数することにより、エッジ強度を表すパラメータとスケールファクタとブロック内の発生符号量の関係だけでなく前フレームの発生符号量とスケールファクタも用いてより最適なスケールファクタが算出できる画像符号化復号装置を実現できるものである。
【0069】
第4に、1回目の符号化で算出されたスケールファクタと符号量配分値を用いて2回目の符号化をすることにより、簡単な回路構成で非常に高精度な符号量制御ができる画像符号化復号装置を実現できるものである。
【0070】
第5に、エッジ強度を表すパラメータE [n] は、画像データを二値化し、二値化した画像データのエッジのカウント数によって求めることができる。したがって、非常に簡単な回路構成で符号量が制御できる画像符号化復号装置を実現できるものである。
【図面の簡単な説明】
【図1】本発明第1の実施例における画像符号化復号装置符号化部のブロック結線図
【図2】同エッジ強度を表すパラメータE[n]の対数と各ブロックの発生符号量の対数の関係図
【図3】同スケールファクタSの対数と各ブロックの発生符号量の対数の関係図
【図4】本発明の第2の実施例における画像符号化復号装置符号化部のブロック結線図
【図5】本発明の第3の実施例における画像符号化復号装置符号化部のブロック結線図
【図6】本発明の第4の実施例における画像符号化復号装置符号化部のブロック結線図
【図7】本発明の第5の実施例における画像符号化復号装置符号化部のブロック結線図
【図8】本発明の第5の実施例における画像符号化復号装置符号化部の要部である量子化テーブル選択回路のブロック結線図
【図9】本発明の第5の実施例における画像符号化復号装置符号化部の要部である量子化テーブル選択回路エッジ強度算出部のブロック結線図
【図10】本発明の第5の実施例における画像符号化復号装置符号化部の要部である量子化テーブル選択回路エッジ強度算出部のブロック結線図
【図11】従来の画像符号化復号装置符号化部のブロック結線図
【符号の説明】
1〜4 端子
11、81 メモリ
12 DCT回路
13 量子化回路
14 符号化回路
15 エッジ強度算出回路
16、32、41 スケールファクタ算出回路
17 量子化テーブル設定回路
21 符号量配分回路
22、31 計数回路
23 比較回路
42 符号量配分回路
51 量子化テーブル選択回路
61、71、74、82 カウンタ
62、83 ROM
72 ラインメモリ
73 EOR
75、84 加算器
114 前処理回路
120 DCT回路
124 閾値設定回路
126 量子化テーブル回路
132 量子化回路
134 絶対値回路
138 ハフマン符号化回路
142 ゲート
146 比較回路
154 カウンタ
158 レジスタ
162 ビット配分回路
170 比較回路
172 符号量カウンタ[0001]
[Industrial application fields]
The present invention relates to an image encoding / decoding device used for storing and transmitting moving images.
[0002]
[Prior art]
When moving images are stored and transmitted, it is desirable that the generated code amount of each frame be constant. An image encoding / decoding device capable of controlling the amount of code can be realized, for example, by the method described in Japanese Patent Laid-Open No. 5-63994. FIG. 11 is a block connection diagram of this method, which is coded using the code amount distribution value (code amount distribution value) of each block calculated by the image activity and the DCT coefficient, and the quantization table calculated by the image activity. The process of pass 1 for updating the encoding table and the process of pass 2 for encoding using the code amount distribution value and the quantization table updated in pass 1 are performed.
[0003]
Hereinafter, path 1 will be described. The preprocessing circuit 114 calculates an image activity based on the difference between the image data input from the input terminal 110. The threshold setting circuit 124 sets the threshold Y according to the image activity. The DCT circuit 120 performs DCT (discrete cosine transform) on the image data stored in the frame memory 118, and the absolute value circuit 134 obtains the absolute value of the DCT coefficient output from the DCT circuit 120 and inputs it to the comparison circuit 146. The comparison circuit 146 makes significant when the absolute value X of the DCT coefficient output from the absolute value circuit 134 exceeds the threshold value Y. The counter 154 counts the number of times that the output of the comparison circuit 146 becomes significant. The register 158 stores the counter value (total block activity) for one frame. The bit distribution circuit 162 calculates the code amount distribution value B of each block based on the target code amount given from the terminal 166, the count value (block activity) of the counter 164 in block units, and the total block activity stored in the register 158. To do. The quantization table circuit 126 sets a quantization table based on the image activity calculated by the preprocessing circuit 114. The quantization circuit 132 quantizes the DCT coefficient output from the DCT circuit 120 based on the quantization table set by the quantization table circuit 126, and the Huffman encoding circuit 138 converts the DCT coefficient quantized by the quantization circuit 132 into the Huffman code. Turn into. The code amount counter 172 counts the code output from the Huffman coding circuit 138 and obtains the count value A for each block. When the count value A output from the code amount counter reaches the code amount distribution value B, the comparison circuit 170 outputs an encoding stop signal and stops the encoding operation of the Huffman encoding circuit 138. When the encoding for one frame is completed, the quantization table is determined by the code amount for one frame output from the code amount counter 172, the target code amount given from the terminal 166, and the image activity calculated by the preprocessing circuit 114. Circuit 126 updates the quantization table. The above is the processing of pass 1.
[0004]
In pass 2, encoding is performed in the same manner as in pass 1 using the quantization table updated in pass 1. The code amount can be controlled by the above processing.
[0005]
[Problems to be solved by the invention]
However, in the above configuration, since the quantization table is updated using the generated code amount, encoding must be performed twice per frame. Also, DCT must be performed to calculate the code amount distribution value, and peripheral circuits for calculating the code amount distribution value based on the DCT coefficient obtained as a result, that is, a threshold setting circuit 124, an absolute value circuit 134, and a comparison circuit 146, a counter 154, and a register 158 are required. Therefore, encoding takes time and the circuit configuration is complicated.
[0006]
SUMMARY OF THE INVENTION The present invention solves the above-described conventional problems, and an object thereof is to provide an image encoding / decoding device capable of realizing high-accuracy code amount control at high speed with a simple circuit configuration.
[0007]
[Means for Solving the Problems]
In order to achieve the above object, an image encoding / decoding apparatus according to the present invention firstly stores a memory, outputs image data for each block of M × N pixels (M and N are natural numbers), and the memory includes A discrete cosine transform circuit that outputs discrete cosine transform coefficients by performing discrete cosine transform on image data to be output, and a parameter E [n] (n is a block number) representing edge strength by the image data output from the memory for each block Edge strength calculation circuit for obtaining and outputting the above, and the scale factor S for setting the parameter E [n] and the quantization tableLogarithmic relationship, the scale factor S and the generated code amount B for each block [n] The logarithmic relationship of can be approximated by a straight line, The target code amount set in advance and the parameter E [n]FromA scale factor calculating circuit for calculating and outputting a scale factor S; a quantization table setting circuit for setting and outputting a quantization table from a product of a preset basic quantization table and the scale factor S; and the quantization A quantization circuit that quantizes and outputs the discrete cosine transform coefficient using a table; and an encoding circuit that performs variable-length coding on the discrete cosine transform coefficient quantized by the quantization circuit and outputs the result. is there.
[0008]
Second,The image encoding / decoding device according to claim 1, wherein the target code amount and the parameter E [n] The code amount distribution value A for each block by [n] The code amount distribution circuit for assigning the code and the code length of the code output from the encoding circuit are counted, and the generated code amount B for each block is counted. [n] And a generated code amount B [n] Code amount distribution value A [n] And for each block, the B [n] Is said A [n] And a comparison circuit that stops the encoding operation of the block at the same timeIt comprises.
[0009]
Third,3. The image encoding / decoding apparatus according to claim 1, wherein the scale factor calculation circuit includes the parameter E. [n] And the logarithmic relationship of the scale factor S for setting the quantization table, the scale factor S and the generated code amount B [n] Using the fact that each logarithmic relationship can be linearly approximated, the target code amount set in advance and the parameter E [n] The scale factor S calculated from the above and the generated code amount G of the previous frame [i-1] (I is the frame number) and the scale factor S of the previous frame [i-1] The scale factor Rl of the previous frame calculated in accordance with the above is selected by the parameter k indicating the correlation between frames, and the scale factor S of the current frame [i] Output to the quantization table setting circuitIt is what.
[0010]
Fourthly, the image data is accumulated and output for each block of M × N pixels (M and N are natural numbers), and the image data output from the memory is subjected to discrete cosine transform to output discrete cosine transform coefficients. A discrete cosine transform circuit; an edge intensity calculating circuit for obtaining and outputting a parameter E [n] (n is a block number) representing edge intensity from image data output from the memory; and the parameter E [n] And scale factor S to set quantization tableLogarithmic relationship, scale factor S and generated code amount B [n] Using the fact that each logarithmic relationship can be linearly approximated, the target code amount set in advance and the parameter E [n] And the scale factor S in the first encoding of the previous frame. [i-1] [1] Generated code amount G [i-1] [1] The scale factor corrected by the ratio between (i is the frame number) and the target code amount, and the scale factor S in the second encoding of the previous frame [i-1] [2] Generated code amount G [i-1] [2] And the scale factor corrected by the ratio of the target code amount to the generated code amount G of the previous frame. [i-1] [1] And generated code amount G [i-1] [2] The scale factor R2 corrected by the magnitude of the difference from the target code amount is selected, and the scale factor S and the corrected scale factor R2 are used as a parameter k indicating the correlation between frames.Then, the first encoding scale factor S [i] [1] of the current frame is calculated, and the first encoding scale factor S [i] [1] of the current frame is calculated.Generated code amount G [i] [1] Multiply by the ratio of the target code amount TA scale factor calculation circuit for calculating and outputting a scale factor S [i] [2] for the second encoding of the current frame, and a preset basic quantization table,Scale factor S of the first encoding of the current frame [i] [1] Or scale factor S of the second encoding of the current frame [i] [2] Quantization table used for the first and second encoding of the current frame from the product ofA quantization table setting circuit for setting and outputting, a quantization circuit for quantizing and outputting the discrete cosine transform coefficient using the quantization table, and a discrete cosine transform coefficient quantized by the quantization circuit An encoding circuit that performs variable length encoding and outputs; the target code amount; the generated code amount B [n] of each block in the first encoding of the current frame; and the generated code of the first encoding of the current frame A code amount distribution circuit for calculating a code amount distribution value A [n] of each block based on the amount G [i] [1], a code length of a code output from the encoding circuit, and the generated code for each block A counting circuit for outputting an amount B [n] and a generated code amount G [i] [m] (m is the number of times of encoding) in the current frame;During the second encoding of each frameA comparison circuit that compares the generated code amount B [n] with the code amount distribution value A [n] for each block, and stops the encoding operation of the block when the B [n] reaches the A [n]. It comprises.
[0011]
Fifth,The image encoding / decoding device according to any one of claims 1 to 4, wherein a parameter E representing edge strength is used. [n] Is characterized in that the image data is binarized and obtained by the number of edge counts of the binarized image data.To do.
[0012]
[Action]
With these configurations, according to the present invention, first, high-accuracy code amount control can be performed by encoding once per frame using the relationship between a parameter representing edge strength, a scale factor, and a generated code amount. Further, it is not necessary to perform DCT for code amount control, and a peripheral circuit for calculating a code amount distribution value using DCT coefficients is also unnecessary. Therefore, highly accurate code amount control can be realized at high speed with a simple circuit configuration.
[0013]
Second, by using the relationship between the edge strength parameter, the scale factor, and the generated code amount, high-accuracy code amount control can be performed by encoding once per frame, and each parameter can be expressed using the parameter indicating edge strength. By calculating the code amount distribution value of the block, the code amount can be controlled so that the generated code amount does not exceed the target code amount,Simple calculations without using DCT coefficientsThe accuracy of code amount control can be improved.
[0014]
Third, using the relationship between the parameter representing the edge strength, the scale factor, and the generated code amount, high-accuracy code amount control can be performed by encoding once per frame, and the generated code amount in the frame can be controlled by the counting circuit. Thus, a more optimal scale factor can be calculated using not only the relationship between the parameter representing the edge strength, the scale factor, and the generated code amount in the block, but also the generated code amount and scale factor of the previous frame.
[0015]
Fourth, by performing the second encoding using the scale factor and code amount distribution value calculated in the first encoding, it is possible to control the code amount with a very high accuracy with a simple circuit configuration.
[0016]
Fifth,Parameter E representing edge strength [n] Is characterized in that the image data is binarized and obtained by the edge count of the binarized image data.. Therefore, the code amount can be controlled with a very simple circuit configuration.
[0017]
【Example】
Example 1
FIG. 1 is a block connection diagram of an image encoding / decoding device encoding unit according to the first embodiment of the present invention. Reference numeral 11 denotes a memory which stores image data and outputs it for each block of 8 × 8 pixels. A DCT circuit 12 performs DCT (Discrete Cosine Transform) on the image data and outputs DCT coefficients. A quantization circuit 13 quantizes the DCT coefficient and outputs it. Reference numeral 14 denotes an encoding circuit which outputs the quantized DCT coefficient after Huffman encoding. Reference numeral 15 denotes an edge strength calculation circuit which calculates and outputs a parameter representing the edge strength for each block. Reference numeral 16 denotes a scale factor calculation circuit, which calculates a scale factor for setting a quantization table. Reference numeral 17 denotes a quantization table setting circuit which sets and outputs a quantization table.
[0018]
Hereinafter, the operation of the image coding / decoding device coding unit in the first embodiment of the present invention will be described with reference to FIG. The memory 11 accumulates the image data input from the terminal 1 and outputs it for each 8 × 8 pixel block. The DCT circuit 12 DCTs image data output from the memory 11 for each block, and outputs DCT coefficients. The quantization circuit 13 quantizes the DCT coefficient output from the DCT circuit 12 using the quantization table set by the quantization table setting circuit 17 and outputs the result. The encoding circuit 14 performs Huffman encoding on the DCT coefficient quantized by the quantization circuit 13 and outputs a code. The edge strength calculation circuit 15 calculates and outputs a parameter E [n] representing the edge strength for each block using (Equation 1) based on the image data output from the memory 11. n is a block number, P is image data of each pixel, h is a pixel number in the horizontal direction, and v is a pixel number in the vertical direction.
[0019]
[Expression 1]
Figure 0003632995
[0020]
When the relationship between the logarithm of the parameter E [n] and the logarithm of the generated code amount B [n] in the block was examined, the linear relationship of FIG. 2 was experimentally obtained. Further, the logarithm of the scale factor S and the logarithm of B [n] for setting the quantization table also experimentally obtained the linear relationship of FIG. Therefore, the relationship between the logarithm of E [n], the logarithm of S, and the logarithm of B [n] can be approximated by a plane as shown in (Expression 2). In (Expression 2), a, b, c, and d are constants.
[0021]
[Expression 2]
Figure 0003632995
[0022]
If B [n] is added for one frame, the generated code amount G in the frame is obtained, and if G is replaced with a preset target code amount T, (Equation 3) is obtained. Γ in (Equation 3) is (Equation 4), and β is (Equation 5). N is the number of blocks in the frame, and α [n] in (Equation 4) is (Equation 6).
[0023]
[Equation 3]
Figure 0003632995
[0024]
[Expression 4]
Figure 0003632995
[0025]
[Equation 5]
Figure 0003632995
[0026]
[Formula 6]
Figure 0003632995
[0027]
Therefore, since S satisfying G = T can be calculated from (Equation 3), the code amount can be controlled with high accuracy. The scale factor calculation circuit 16 calculates the scale factor S using (Equation 3) based on the parameter E [n] output from the edge strength calculation circuit 15 and the target code amount T input from the terminal 3. The quantization table setting circuit 17 inputs a preset basic quantization table from the terminal 4, sets the quantization table by multiplying the basic quantization table by S output from the scale factor calculation circuit 16, and the quantization circuit 13. Output to. The above is the operation of the image coding / decoding device coding unit in the first embodiment of the present invention.
[0028]
The decoding unit performs the reverse operation of the encoding unit. That is, decoding of the code output from the encoding circuit, inverse quantization, and inverse DCT are performed, and image data is output.
[0029]
As described above, by using the relationship between the parameter representing the edge strength, the scale factor, and the generated code amount, high-accuracy code amount control can be performed with one encoding per frame. Further, it is not necessary to perform DCT for code amount control, and a peripheral circuit for calculating a code amount distribution value using DCT coefficients is also unnecessary. Therefore, according to the present embodiment, highly accurate code amount control can be realized at high speed with a simple circuit configuration.
[0030]
In the present embodiment, (Equation 1), that is, the parameter E [n] representing the edge strength is calculated by the primary differentiation, but other edge detection operators such as the secondary differentiation may be used. The plane shown in (Equation 2) may be obtained separately for the luminance component and the color difference component. In this case, the scale factor can be calculated by replacing the sum of the generated code amount of the luminance component and the generated code amount of the color difference component in the frame with the target code amount. Although the generated code amount B [n] of (Equation 2) includes a DC component and an AC component, the generated code amount Bac [n] of only the AC component is used instead of B [n]. Also good. In this case, the generated code amount Gac of the AC component in the frame is replaced with the target code amount T, the scale factor Sac based on the AC component is calculated, and the generated code amount Gdc of the DC component in the frame is obtained using Sac. Further, Sac is corrected by the ratio of Gdc to the target code amount T, and the scale factor is determined. The DC component is obtained by averaging the pixel values in the block, and Gdc is obtained by Huffman encoding only the DC component. Since Gdc is often much smaller than Gac, Sac need not be corrected. As described above, the scale factor is calculated in units of blocks. However, instead of the blocks, MDUs (minimum data units) composed of luminance component blocks and color difference component blocks may be used as units.
[0031]
In (Equation 3), the target code amount T set in advance is used, but the code length of the code output from the encoding circuit 14 is added to obtain the generated code amount G in the frame. The target code amount may be updated for each frame. In (Expression 7), i is a frame number, T is a preset target code amount, and Tv is a target code amount of each frame.
[0032]
[Expression 7]
Figure 0003632995
[0033]
(Example 2)
FIG. 4 is a block connection diagram of an image coding / decoding device coding unit according to the second embodiment of the present invention. In FIG. 4, the memory 11, the DCT circuit 12, the quantization circuit 13, the encoding circuit 14, the edge strength calculation circuit 15, the scale factor calculation circuit 16, and the quantization table setting circuit 17 are the same as those in the first embodiment. A code amount distribution circuit 21 calculates a code amount distribution value of each block. A counting circuit 22 counts the code length of the code output from the encoding circuit 14. The comparison circuit 23 compares the code amount with the code amount distribution value for each block, and stops the encoding operation of the block when the code amount reaches the code amount distribution value.
[0034]
Hereinafter, the operation of the image encoding / decoding device encoding unit according to the second embodiment of the present invention will be described with reference to FIG. The operations of the memory 11, the DCT circuit 12, the quantization circuit 13, the encoding circuit 14, the edge strength calculation circuit 15, the scale factor calculation circuit 16, and the quantization table setting circuit 17 are the same as those in the first embodiment, and thus description thereof is omitted. . The generated code amount B [n] of each block can be calculated using the parameter E [n] from (Equation 2). If B [n] is added for one frame, the generated code amount G in the frame is obtained, and the target code amount T can be distributed to each block according to the ratio of B [n] to G. Therefore, the code amount distribution circuit 21 calculates the code amount distribution value A [n] of each block using the parameter E [n] representing the edge strength. That is, A [n] is calculated using (Equation 8) from the parameter E [n] output from the edge strength calculation circuit 15 and the target code amount T input from the terminal 3. In (Equation 8), γ is (Equation 4), and α [n] is (Equation 6).
[0035]
[Equation 8]
Figure 0003632995
[0036]
The counting circuit 22 counts the code length of the code output from the encoding circuit 14 and outputs the generated code amount B [n] for each block. The comparison circuit 23 compares the generated code amount B [n] output from the counting circuit 22 with the code amount distribution value A [n] output from the code amount distribution circuit 21 for each block, and B [n] is A [n]. ] Is reached, the encoding operation of the block is stopped. That is, the encoding circuit 14 outputs EOB (end of block) indicating the end of the encoded data, and the DCT circuit 12, the quantization circuit 13, and the encoding circuit 14 are operated for the next block. Therefore, the generated code amount can be prevented from exceeding the target code amount. The above is the operation of the image encoding / decoding device encoding unit in the second embodiment of the present invention. The decoding unit performs the reverse operation of the encoding unit, as in the first embodiment.
[0037]
As described above, if the code amount distribution value of each block is calculated using the parameter representing the edge strength, the code amount can be controlled so that the generated code amount does not exceed the target code amount. That is,Without using DCT coefficientThe accuracy of code amount control can be improved with a simple calculation. This embodiment is effective in the case where it is not allowed to exceed the target code amount even at the time of image storage or transmission. In addition, since the code amount can be controlled by encoding once per frame as in the first embodiment, high-speed processing is possible.
[0038]
(Example 3)
FIG. 5 is a block connection diagram of an image encoding / decoding device encoding unit according to the third embodiment of the present invention. In FIG. 5, the memory 11, the DCT circuit 12, the quantization circuit 13, the encoding circuit 14, the edge strength calculation circuit 15, the quantization table setting circuit 17, the code amount distribution circuit 21, and the comparison circuit 23 are the same as those in the second embodiment. is there. A counting circuit 31 counts the code length of the code output from the encoding circuit 14. A scale factor calculation circuit 32 calculates a scale factor for setting a quantization table.
[0039]
Hereinafter, the operation of the image encoding / decoding device encoding unit according to the third embodiment of the present invention will be described with reference to FIG. Since the operations of the memory 11, the DCT circuit 12, the quantization circuit 13, the encoding circuit 14, the edge strength calculation circuit 15, the quantization table setting circuit 17, the code amount distribution circuit 21, and the comparison circuit 23 are the same as those in the second embodiment, they will be described. Is omitted. The counting circuit 31 counts the code length of the code output from the encoding circuit 14, outputs the generated code amount B [n] for each block to the comparison circuit 23, and calculates the generated code amount in the frame to the scale factor calculation circuit 32. Output to. The scale factor calculation circuit 32 calculates the scale factor of the current frame using the relationship between the parameter representing the edge strength, the scale factor, and the generated code amount in the block, and the generated code amount and scale factor of the previous frame. That is, the parameter E [n] output from the edge strength calculation circuit 15, the target code amount T given from the terminal 3, the generated code amount G [i−1] of the previous frame output from the counting circuit 31, and the scale factor calculation circuit 32 The scale factor S1 [i] of the current frame is calculated using (Equation 9) by the scale factor S1 [i-1] of the previous frame calculated in step (5). In (Equation 9), k is obtained from (Equation 10), and R1 is obtained from (Equation 11). i indicates a frame number.X in (Equation 9) is a predetermined threshold value.Γ in (Equation 10) is obtained by (Equation 4).
[0040]
[Equation 9]
Figure 0003632995
[0041]
[Expression 10]
Figure 0003632995
[0042]
## EQU11 ##
Figure 0003632995
[0043]
In this way, by using the generated code amount and the scale factor of the previous frame, a more optimal scale factor can be calculated, so that the accuracy of code amount control can be improved.
[0044]
As in the second embodiment, the comparison circuit 23 compares the generated code amount B [n] output from the counting circuit 31 with the code amount distribution value A [n] output from the code amount distribution circuit 21 for each block. When [n] reaches A [n], the encoding operation of the block is stopped. The above is the operation of the image encoding / decoding device encoding unit in the third embodiment of the present invention. The decoding unit performs the reverse operation of the encoding unit, as in the first embodiment.
[0045]
As described above, if the generated code amount in the frame is counted by the counting circuit 31, not only the relationship between the parameter representing the edge strength, the scale factor, and the generated code amount in the block, but also the generated code amount and the scale factor of the previous frame are also obtained. By using it, a more optimal scale factor can be calculated. Therefore, the accuracy of code amount control can be further improved with the same circuit scale as in the second embodiment. Further, since the code amount can be controlled by encoding once per frame as in the second embodiment, high-speed processing is possible.
[0046]
In (Equation 10), k is obtained using γ [i] calculated from the parameter E [n] representing edge strength, but a parameter indicating correlation between frames such as interframe difference may be used as k. Further, since the accuracy is improved by using the generated code amount and the scale factor of the previous frame, the code amount distribution circuit 21 and the comparison circuit 23 may be omitted, and the code amount control by the code amount distribution value may not be performed. In this way, the circuit configuration is simplified.
[0047]
Example 4
FIG. 6 is a block connection diagram of an image coding / decoding device coding unit according to the fourth embodiment of the present invention. In FIG. 6, the memory 11, the DCT circuit 12, the quantization circuit 13, the encoding circuit 14, the edge strength calculation circuit 15, the quantization table setting circuit 17, the comparison circuit 23, and the counting circuit 31 are the same as those in the third embodiment. Reference numeral 41 denotes a scale factor calculation circuit that calculates a scale factor for setting a quantization table. A code amount distribution circuit 42 calculates a code amount distribution value of each block. With this configuration, the scale factor of the first encoding (pass 1) is calculated, and the scale of the second encoding (pass 2) is calculated based on the generated code amount obtained by encoding using the scale factor of pass 1. In addition to calculating the factor, the processing of pass 1 for calculating the code amount distribution value of each block is performed. Further, the processing of pass 2 is performed using the scale factor and code amount distribution value calculated in pass 1.
[0048]
The operation of pass 1 of the image encoding / decoding device encoding unit in the fourth embodiment of the present invention will be described below with reference to FIG. Since the operations of the memory 11, the DCT circuit 12, the quantization circuit 13, the encoding circuit 14, the edge strength calculation circuit 15, the quantization table setting circuit 17, and the counting circuit 31 are the same as those in the third embodiment, the description thereof is omitted. The scale factor calculation circuit 41 includes the relationship between the parameter E [n] representing the edge strength, the scale factor S, and the generated code amount B [n] in the block, and the generated code amount G [i− in the frame 1 in pass 1 of the previous frame. 1] [1], scale factor S2 [i-1] [1], generated code amount G [i-1] [2] and scale factor S2 [i-1] [2] in pass 2 of the previous frame Then, the scale factor S2 [i] [1] of pass 1 of the current frame is calculated. That is, the parameter E [n] output from the edge strength calculation circuit 15, the target code amount T given from the terminal 3, and the generated code amount G [i−1] [1] of pass 1 of the previous frame output from the counting circuit 31. And the generated code amount G [i-1] [2] of pass 2, the scale factor S2 [i-1] [1] of pass 1 of the previous frame calculated by the scale factor calculation circuit 41, and the scale factor S2 [2] of pass 2 From i-1] [2], the scale factor S2 [i] [1] of path 1 of the current frame is calculated using (Equation 12). In (Equation 12), k is obtained from (Equation 10), S is obtained from (Equation 3), and R2 is obtained from (Equation 13).X in (Expression 12) is a predetermined threshold value.
[0049]
[Expression 12]
Figure 0003632995
[0050]
[Formula 13]
Figure 0003632995
[0051]
further,Scale factor S for pass 1 2 [i] [1]As a result of encoding using the equation (2), the generated code amount G [i] [1] output from the counting circuit 31 and the target code amount T given from the terminal 3 are used to calculate the scale factor S2 [i ] [2] is calculated.
[0052]
[Expression 14]
Figure 0003632995
[0053]
The code amount distribution circuit 42 generates the generated code amount G [i] [1] in the frame output by the counting circuit 31, the generated code amount B [n] [1] of each block, and the target code amount given from the terminal 3 Based on T, the code amount distribution value A [n] of each block is calculated using (Equation 15).
[0054]
[Expression 15]
Figure 0003632995
[0055]
The above is the operation of pass 1 of the image encoding / decoding device encoding unit.
Next, the operation of pass 2 of the image coding / decoding device coding unit according to the fourth embodiment of the present invention will be described. In pass 2, encoding is performed using the scale factor S2 [i] [1] calculated in pass 1 and the code amount distribution value A [n]. Since the memory 11, the DCT circuit 12, the quantization circuit 13, the encoding circuit 14, the quantization table setting circuit 17, and the counting circuit 31 perform the same operations as in the pass 1, description thereof is omitted. As in the third embodiment, the comparison circuit 23 compares the generated code amount B [n] [2] output from the counting circuit 31 with the code amount distribution value A [n] output from the code amount distribution circuit 42 for each block. Then, when B [n] [2] reaches A [n], the encoding operation of the block is stopped. The above is the operation of pass 2 of the image encoding / decoding device encoding unit. The decoding unit performs the reverse operation of the encoding unit, as in the first embodiment.
[0056]
As described above, encoding of pass 2 using the scale factor and code amount distribution value calculated in pass 1 enables very high-accuracy code amount control with the same circuit scale as in the third embodiment.
[0057]
The relationship between the logarithm of the generated code amount G in the frame and the logarithm of the scale factor R3 can be approximated by a straight line as shown in (Equation 16). Therefore, the generated code amount G [i−1] [1] and the scale factor S2 [i−1] [1] of pass 1 of the previous frame, and the generated code amount G [i−1] [1] of pass 2 of the previous frame. 2] and scale factor S2 [i-1] [2], a and b of (Equation 16) are obtained, R3 is calculated by substituting target code amount T for G, and R3 is used instead of R2 ( S2 [i] [1] in Equation 12) may be obtained. Alternatively, the average value of R2 obtained by (Equation 13) and R3 obtained by (Equation 16) may be used, or one of R2 and R3 may be selected adaptively.
[0058]
[Expression 16]
Figure 0003632995
[0059]
(Example 5)
FIG. 7 is a block connection diagram of an image coding / decoding device coding unit according to the fifth embodiment of the present invention. In FIG. 7, the memory 11, the DCT circuit 12, the quantization circuit 13, and the encoding circuit 14 are the same as those in the first embodiment. A quantization table selection circuit 51 selects a quantization table.
[0060]
Hereinafter, the operation of the image encoding / decoding device encoding unit according to the fifth embodiment of the present invention will be described with reference to FIG. Since the operations of the memory 11, the DCT circuit 12, the quantization circuit 13, and the encoding circuit 14 are the same as those in the first embodiment, the description thereof is omitted. The quantization table selection circuit 51 selects a quantization table based on the image data input from the terminal 1 and outputs it to the quantization circuit 13. The configuration of the quantization table selection circuit 51 is shown in FIG. Reference numeral 61 denotes a counter which inputs 1 bit of image data and counts rising edges. A ROM 62 outputs a quantization table.
[0061]
Hereinafter, the operation of the quantization table selection circuit, which is the main part of the image encoding / decoding device encoding unit according to the fifth embodiment of the present invention, will be described with reference to FIG. The counter 61 binarizes by using only one bit of the image data input from the terminal 1, obtains a parameter Ef representing the edge strength, and outputs it to the ROM 62. For example, when the image data is 8 bits, the image data is binarized by inputting only 2 6 bits. The parameter Ef representing the edge strength is obtained by counting the rising edge of the binarized image data for one frame.
[0062]
The ROM 62 selects and outputs the quantization table based on the parameter Ef output from the counter 61. A plurality of quantization tables are set in advance in the ROM 62, and one quantization table is selected by the parameter Ef. The above is the operation of the image coding / decoding device coding unit in the fifth embodiment of the present invention. The decoding unit performs the reverse operation of the encoding unit, as in the first embodiment.
As described above, if the quantization table is selected by counting the rising edges of the binarized image data, the functions of the edge strength calculation circuit 15, the scale factor calculation circuit 16, and the quantization table setting circuit 17 can be selected. This can be realized only by the circuit 51. Further, the quantization table selection circuit 51 can be configured by a counter 61 and a ROM 62. Therefore, the code amount can be controlled with a very simple circuit configuration.
[0063]
In the present embodiment, the example in which the quantization table selection circuit 51 is applied to the first embodiment has been described. However, the present invention can also be applied to the second to fourth embodiments. Binarization may be performed using a ROM instead of using only one bit of image data.
[0064]
For the parameter Ef representing the edge strength, the sum of the differences in the horizontal direction is obtained by the counter of FIG. 8, but instead, the sum of the differences in the horizontal direction and the vertical direction may be obtained by the circuit configuration of FIG. The parameter y determined by the binarized image data pattern may be obtained for each area (subblock) of m × m pixels (m is a positive integer), and the sum of y may be Ef. For example, referring to FIG. 10, the memory 81 stores the binarized image data and outputs it for each sub-block, and the counter 82 calculates the sum x of the image data output from the memory 81 in the sub-block. The adder 84 adds the parameter y determined by the ROM 83 based on the value of x, and calculates a parameter Ef representing the edge strength. In the ROM 83, a table represented by (Expression 17) is set in advance.
[0065]
[Expression 17]
Figure 0003632995
[0066]
【The invention's effect】
As described above, according to the present invention, first, high-accuracy code amount control can be performed by encoding once per frame using the relationship between the parameter representing the edge strength, the scale factor, and the generated code amount. Further, it is not necessary to perform DCT for code amount control, and a peripheral circuit for calculating a code amount distribution value using DCT coefficients is also unnecessary. Therefore, it is possible to realize an image encoding / decoding device capable of controlling the code amount with high speed and high accuracy with a simple circuit configuration.
[0067]
Second, by using the relationship between the edge strength parameter, the scale factor, and the generated code amount, high-accuracy code amount control can be performed by encoding once per frame, and each parameter can be expressed using the parameter indicating edge strength. By calculating the code amount distribution value of the block, the code amount can be controlled so that the generated code amount does not exceed the target code amount, and the accuracy of code amount control can be improved by simpler calculation than DCT. An image encoding / decoding device that can be realized is realized.
[0068]
Third, using the relationship between the parameter representing the edge strength, the scale factor, and the generated code amount, high-accuracy code amount control can be performed by encoding once per frame, and the generated code amount in the frame can be controlled by the counting circuit. Image coding and decoding that can calculate a more optimal scale factor using not only the relationship between the parameters representing edge strength, the scale factor, and the generated code amount in the block, but also the generated code amount and scale factor of the previous frame. A device can be realized.
[0069]
Fourth, an image code capable of controlling the amount of code with a very high accuracy with a simple circuit configuration by performing the second encoding using the scale factor and code amount distribution value calculated in the first encoding. An encoding / decoding device can be realized.
[0070]
Fifth,Parameter E representing edge strength [n] Is obtained by binarizing the image data and obtaining the number of edge counts of the binarized image data.be able to. Therefore, it is possible to realize an image encoding / decoding device capable of controlling the code amount with a very simple circuit configuration.
[Brief description of the drawings]
FIG. 1 is a block connection diagram of an image encoding / decoding device encoding unit according to a first embodiment of the present invention.
FIG. 2 is a relationship diagram of a logarithm of a parameter E [n] representing the edge strength and a logarithm of a generated code amount of each block.
FIG. 3 is a relationship diagram of the logarithm of the same scale factor S and the logarithm of the generated code amount of each block.
FIG. 4 is a block connection diagram of an image encoding / decoding device encoding unit according to the second embodiment of the present invention;
FIG. 5 is a block connection diagram of an image encoding / decoding device encoding unit according to a third embodiment of the present invention;
FIG. 6 is a block connection diagram of an image encoding / decoding device encoding unit according to the fourth embodiment of the present invention;
FIG. 7 is a block connection diagram of an image encoding / decoding device encoding unit according to a fifth embodiment of the present invention;
FIG. 8 is a block connection diagram of a quantization table selection circuit that is a main part of an image encoding / decoding device encoding unit according to a fifth embodiment of the present invention;
FIG. 9 is a block connection diagram of a quantization table selection circuit edge strength calculation unit that is a main part of an image encoding / decoding device encoding unit according to a fifth embodiment of the present invention;
FIG. 10 is a block connection diagram of a quantization table selection circuit edge strength calculation unit that is a main part of an image encoding / decoding device encoding unit according to a fifth embodiment of the present invention;
FIG. 11 is a block connection diagram of a conventional image encoding / decoding device encoding unit.
[Explanation of symbols]
1-4 terminals
11, 81 memory
12 DCT circuit
13 Quantization circuit
14 Coding circuit
15 Edge strength calculation circuit
16, 32, 41 Scale factor calculation circuit
17 Quantization table setting circuit
21 Code amount distribution circuit
22, 31 Counting circuit
23 Comparison circuit
42 Code amount distribution circuit
51 Quantization table selection circuit
61, 71, 74, 82 Counter
62, 83 ROM
72 line memory
73 EOR
75, 84 Adder
114 Pre-processing circuit
120 DCT circuit
124 threshold setting circuit
126 Quantization table circuit
132 Quantization circuit
134 Absolute value circuit
138 Huffman coding circuit
142 Gate
146 Comparison circuit
154 counter
158 registers
162 bit distribution circuit
170 Comparison circuit
172 Code amount counter

Claims (5)

画像データを蓄積し、M×N画素(M、Nは自然数)のブロック毎に出力するメモリと、前記メモリが出力する画像データを離散コサイン変換して離散コサイン変換係数を出力する離散コサイン変換回路と、前記メモリが出力する画像データによりエッジ強度を表すパラメータE[n](nはブロックの番号)をブロック毎に求めて出力するエッジ強度算出回路と、前記パラメータE[n]と量子化テーブルを設定するスケールファクタSの対数の関係と、前記スケールファクタSとブロック毎の発生符号量B [n] の対数の関係がそれぞれ直線近似できることを利用し、予め設定した目標符号量と前記パラメータE[n]からスケールファクタSを算出するスケールファクタ算出回路と、予め設定した基本量子化テーブルと前記スケールファクタSとの積から量子化テーブルを設定して出力する量子化テーブル設定回路と、前記量子化テーブルを用いて前記離散コサイン変換係数を量子化して出力する量子化回路と、前記量子化回路で量子化された離散コサイン変換係数を可変長符号化して出力する符号化回路とを具備する画像符号化復号装置。A memory that stores image data and outputs each block of M × N pixels (M and N are natural numbers), and a discrete cosine transform circuit that performs discrete cosine transform on the image data output from the memory and outputs discrete cosine transform coefficients An edge intensity calculation circuit for obtaining and outputting a parameter E [n] (n is a block number) representing edge intensity from the image data output from the memory for each block, and the parameter E [n] and quantization table Using the fact that the logarithmic relationship of the scale factor S for setting the logarithm and the logarithmic relationship of the scale factor S and the logarithm of the generated code amount B [n] for each block can be linearly approximated, respectively. a scale factor calculating circuit from the [n] to calculate the scale factor S, or the product of the basic quantization table set in advance as the scale factor S A quantization table setting circuit that sets and outputs a quantization table, a quantization circuit that quantizes and outputs the discrete cosine transform coefficient using the quantization table, and a discrete cosine quantized by the quantization circuit An image encoding / decoding device comprising: an encoding circuit that performs variable-length encoding on transform coefficients and outputs the converted coefficients. 前記目標符号量と前記パラメータE [n] によりブロック毎に符号量配分値A [n] を割り当てる符号量配分回路と、前記符号化回路が出力する符号の符号長を計数し、ブロック毎の前記発生符号量B [n] を出力する計数回路と、前記発生符号量B [n] を前記符号量配分値A [n] とブロック毎に比較し、前記B [n] が前記A [n] に達するとともに当該ブロックの符号化動作を停止させる比較回路とをさらに具備する請求項1記載の画像符号化復号装置。 A code amount distribution circuit that assigns a code amount distribution value A [n] for each block according to the target code amount and the parameter E [n], and a code length of a code output from the encoding circuit is counted, and a counting circuit for outputting a generated code amount B [n], the generated code amount comparing B [n] and the bit allocation value a [n] of each block, the B [n] is the a [n] The image encoding / decoding device according to claim 1, further comprising: a comparison circuit that stops the encoding operation of the block while reaching . 前記スケールファクタ算出回路は、前記パラメータE [n] と量子化テーブルを設定するスケールファクタSの対数の関係と、前記スケールファクタSと発生符号量B [n] の対数の関係がそれぞれ直線近似できることを利用し、予め設定した目標符号量と前記パラメータE [n] から算出したスケールファクタSと、前フレームの発生符号量G [i-1] (iはフレームの番号)と前フレームのスケールファクタS [i-1] により算出した修正された前フレームのスケールファクタRlとを、フレーム間の相関を示すパラメータkにより選択して現フレームのスケールファクタS [i] として量子化テーブル設定回路に出力することを特徴とする請求項1又は2記載の画像符号化復号装置。 The scale factor calculation circuit can linearly approximate the logarithmic relationship between the parameter E [n] and the scale factor S for setting the quantization table, and the logarithmic relationship between the scale factor S and the generated code amount B [n]. , The scale factor S calculated from the target code amount set in advance and the parameter E [n] , the generated code amount G [i-1] (i is the frame number) of the previous frame, and the scale factor of the previous frame The modified scale factor Rl of the previous frame calculated by S [i-1] is selected by the parameter k indicating the correlation between the frames, and is output to the quantization table setting circuit as the scale factor S [i] of the current frame. The image encoding / decoding apparatus according to claim 1 or 2, wherein 画像データを蓄積し、M×N画素(M、Nは自然数)のブロック毎に出力するメモリと、前記メモリが出力する画像データを離散コサイン変換して離散コサイン変換係数を出力する離散コサイン変換回路と、前記メモリが出力する画像データによりエッジ強度を表すパラメータE[n](nはブロックの番号)をブロック毎に求めて出力するエッジ強度算出回路と、前記パラメータE[n]と量子化テーブルを設定するスケールファクタSの対数の関係と、前記スケールファクタSと発生符号量B [n] の対数の関係がそれぞれ直線近似できることを利用し、予め設定した目標符号量と前記パラメータE [n] から算出したスケールファクタSと
前フレームの1回目の符号化におけるスケールファクタS[i-1][1]発生符号量G[i-1][1](iはフレームの番号)と目標符号量との比で補正されたスケールファクタと、前フレームの2回目の符号化におけるスケールファクタS [i-1][2] を発生符号量G [i-1][2] と目標符号量との比で補正されたスケールファクタとを、前フレームの発生符号量G [i-1][1] と発生符号量G [i-1][2] との目標符号量との差の大きさにより補正されたスケールファクタR2を選択し、
前記スケールファクタSと前記補正されたスケールファクタR2をフレーム間の相関を示すパラメータkにより現フレームの1回目の符号化のスケールファクタS [i][1] を算出して
さらに前記現フレームの1回目の符号化のスケールファクタS[i][1]発生符号量G[i][1]と目標符号量Tとの比を乗ずることによって現フレームの2回目の符号化のスケールファクタS[i][2]を算出して出力するスケールファクタ算出回路と、予め設定した基本量子化テーブルと前記現フレームの1回目の符号化のスケールファクタS [i][1] 、あるいは前記現フレームの2回目の符号化のスケールファクタS [i][2] との積からそれぞれ現フレームの1回目と2回目の符号化に用いる量子化テーブルを設定して出力する量子化テーブル設定回路と、前記量子化テーブルを用いて前記離散コサイン変換係数を量子化して出力する量子化回路と、前記量子化回路で量子化された離散コサイン変換係数を可変長符号化して出力する符号化回路と、前記目標符号量、現フレームの1回目の符号化における各ブロックの前記発生符号量B[n]、及び現フレームの1回目の符号化の発生符号量G[i][1]により各ブロックの符号量配分値A[n]を算出する符号量配分回路と、前記符号化回路が出力する符号の符号長を計数し、ブロック毎の前記発生符号量B[n]と現フレーム内の発生符号量G[i][m](mは符号化回数)を出力する計数回路と、各フレームの2回目の符号化時に前記発生符号量B[n]を前記符号量配分値A[n]とブロック毎に比較し、前記B[n]が前記A[n]に達するとともに当該ブロックの符号化動作を停止させる比較回路とを具備する画像符号化復号装置。
A memory that stores image data and outputs each block of M × N pixels (M and N are natural numbers), and a discrete cosine transform circuit that performs discrete cosine transform on the image data output from the memory and outputs discrete cosine transform coefficients An edge intensity calculation circuit for obtaining and outputting a parameter E [n] (n is a block number) representing edge intensity from the image data output from the memory for each block, and the parameter E [n] and quantization table logarithmic relationship of the scale factor S for setting the logarithm of the relationship between the scale factor S and the generated code amount B [n] is utilized can be linearly approximated, respectively, the target code amount set in advance as the parameter E [n] The scale factor S calculated from
The scale factor S [i-1] [1] in the first encoding of the previous frame is corrected by the ratio between the generated code amount G [i-1] [1] (i is the frame number) and the target code amount. The scale factor and the scale factor S [i-1] [2] in the second encoding of the previous frame corrected by the ratio of the generated code amount G [i-1] [2] and the target code amount Scale factor R2 corrected by the magnitude of the difference between the generated code amount G [i-1] [1] and the generated code amount G [i-1] [2] of the previous frame. Select
The scale factor S [i] [1] for the first encoding of the current frame is calculated from the scale factor S and the corrected scale factor R2 by the parameter k indicating the correlation between frames .
Further, by multiplying the scale factor S [i] [1] of the first encoding of the current frame by the ratio of the generated code amount G [i] [1] and the target code amount T, the second encoding of the current frame is performed. Scale factor calculation circuit for calculating and outputting a conversion scale factor S [i] [2], a preset basic quantization table, and a scale factor S [i] [1] for the first encoding of the current frame Alternatively, a quantization table used for the first and second encoding of the current frame is set and output from the product of the second encoding scale factor S [i] [2] of the current frame . A table setting circuit; a quantization circuit that quantizes and outputs the discrete cosine transform coefficient using the quantization table; and a code that outputs the discrete cosine transform coefficient quantized by the quantization circuit by variable length encoding Circuit and the target mark Code amount distribution of each block according to the amount, the generated code amount B [n] of each block in the first encoding of the current frame, and the generated code amount G [i] [1] of the first encoding of the current frame The code amount distribution circuit for calculating the value A [n], the code length of the code output from the encoding circuit, is counted, and the generated code amount B [n] for each block and the generated code amount G [ i] [m] (m is the number of times of encoding), and the generated code amount B [n] for each block and the generated code amount B [n] at the second encoding of each frame A comparison circuit that compares and stops the encoding operation of the block when B [n] reaches A [n].
エッジ強度を表すパラメータE [n] は、画像データを二値化し、二値化した画像データのエッジのカウント数によって求めることを特徴とする請求項1〜4のいずれかに記載の画像符号化復号装置。The image encoding according to any one of claims 1 to 4, wherein the parameter E [n] representing the edge strength is obtained by binarizing the image data and obtaining the number of edges of the binarized image data . Decoding device.
JP20842694A 1994-09-01 1994-09-01 Image encoding / decoding device Expired - Fee Related JP3632995B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP20842694A JP3632995B2 (en) 1994-09-01 1994-09-01 Image encoding / decoding device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP20842694A JP3632995B2 (en) 1994-09-01 1994-09-01 Image encoding / decoding device

Publications (2)

Publication Number Publication Date
JPH0879762A JPH0879762A (en) 1996-03-22
JP3632995B2 true JP3632995B2 (en) 2005-03-30

Family

ID=16556028

Family Applications (1)

Application Number Title Priority Date Filing Date
JP20842694A Expired - Fee Related JP3632995B2 (en) 1994-09-01 1994-09-01 Image encoding / decoding device

Country Status (1)

Country Link
JP (1) JP3632995B2 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3432392B2 (en) * 1997-04-07 2003-08-04 三菱電機株式会社 Image encoding device, image encoding method, and image storage / transmission device
JP3625211B2 (en) * 2003-03-13 2005-03-02 三菱電機株式会社 JPEG compressed file generation method, JPEG compressed file generation apparatus, and image processing apparatus
US7567722B2 (en) * 2005-03-22 2009-07-28 Qualcomm Incorporated Dynamically scaled file encoding
JP5031419B2 (en) * 2007-03-26 2012-09-19 三菱電機株式会社 Encoder

Also Published As

Publication number Publication date
JPH0879762A (en) 1996-03-22

Similar Documents

Publication Publication Date Title
KR930009872B1 (en) Changing coding apparatus
US4922273A (en) Compression method of halftone image data
US9532079B2 (en) Filtering method for removing block artifacts and/or ringing noise and apparatus therefor
US8509556B2 (en) Image coding apparatus and image coding method to generate a targeted amount of code
US6449395B1 (en) Image encoding apparatus, image encoding method, and recording medium in which image encoding program is recorded
KR100846774B1 (en) Filtering method for removing block artifacts and/or ringing noise and apparatus therefor
JPH08172626A (en) Image compression coder
KR0141082B1 (en) Apparatus for coding image signal with adaptive edge part
JPH07123269A (en) Corder for picture signal
JP3632995B2 (en) Image encoding / decoding device
JP2830855B2 (en) Adaptive quantization controller
JP2000270323A (en) Coding controller for image signal
JPH04323965A (en) Picture coding method
KR100230839B1 (en) Block cancelation method and apparatus in moving picture decoder
JP2574572B2 (en) Image encoding method and image encoding device
JPH04180356A (en) Image encoding method
JP2000333175A (en) Image coder
JPH06105297A (en) Encoder
JP2843396B2 (en) Compressed data amount control method
JPH0449778A (en) Method of encoding picture
JPH0583560A (en) Image data encoder
JPH07212757A (en) Picture compression coder
JPH11275579A (en) Image coding method, image decoding method, image coder and image decoder
JPH09172638A (en) Image coding method and device therefor
JPH04196765A (en) Picture data compression device

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20040420

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20040427

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20040614

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20041207

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20041220

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

Free format text: PAYMENT UNTIL: 20080107

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20090107

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20100107

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20110107

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20110107

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20120107

Year of fee payment: 7

LAPS Cancellation because of no payment of annual fees