JP2821496B2 - Method of compressing gradation image data - Google Patents

Method of compressing gradation image data

Info

Publication number
JP2821496B2
JP2821496B2 JP7977687A JP7977687A JP2821496B2 JP 2821496 B2 JP2821496 B2 JP 2821496B2 JP 7977687 A JP7977687 A JP 7977687A JP 7977687 A JP7977687 A JP 7977687A JP 2821496 B2 JP2821496 B2 JP 2821496B2
Authority
JP
Japan
Prior art keywords
code
counter
zero
quantization
coefficient
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 - Lifetime
Application number
JP7977687A
Other languages
Japanese (ja)
Other versions
JPS63246978A (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.)
Konica Minolta Inc
Original Assignee
Konica Minolta Inc
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 Konica Minolta Inc filed Critical Konica Minolta Inc
Priority to JP7977687A priority Critical patent/JP2821496B2/en
Publication of JPS63246978A publication Critical patent/JPS63246978A/en
Application granted granted Critical
Publication of JP2821496B2 publication Critical patent/JP2821496B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Apparatus For Radiation Diagnosis (AREA)
  • Image Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Image Analysis (AREA)

Description

【発明の詳細な説明】 (産業上の利用分野) 本発明はX線写真やCT画像など医用画像のような階調
画像のデータを圧縮する階調画像データの圧縮方法に関
する。 (発明の背景) デジタル技術の進歩に伴ない、階調画像をデジタル化
して保存、伝送したり、種々のデジタル画像処理を施し
たりすることが頻繁に行なわれるようになった。しかし
ながら、階調画像は2値画像に比べて情報量が多く、従
って階調画像をデジタル化したときのデータ量の多さが
問題となっている。特に医用画像では、デジタル化する
ときの画素数および各画素に要するビット数が、たとえ
ば胸部X線写真では400万画素、8〜10ビットと膨大で
あり、データの保存や転送を行なう上で効率が悪い。 そこで今日、医用画像を含む階調画像の膨大なデータ
を圧縮してコンパクト化するデータ圧縮技術が脚光を浴
びている。 データ圧縮技術は大きく分けて可逆圧縮と非可逆圧縮
とに分類されるが、可逆圧縮では1/2〜1/3程度の低い圧
縮率しか望めないため、1/5以上の高い圧縮率が得られ
る非可逆圧縮方式、特に変換符号可方式が注目されてい
る。 変換符号可とは、画像全体を小さなブロックに分割し
ブロック単位に直交変換を施し、これにより得られた変
換係数を量子化し、符号化する非可逆圧縮方式の1つで
あり、階調画像を圧縮するのに最も適した圧縮方法であ
る。 変換符号化において、変換係数の交流成分の分布は、
ゼロにピークを持つガウス分布に近似されることが知ら
れており、このような分布を持つ変換係数の量子化を量
子化判定レベルにゼロを含むMid−Riser型量子化と、量
子化出力レベルにゼロを含むMid−trace型量子化とに分
類した場合、Mid−trace型量子化の方がブロック内のラ
ンダムノイズが少なくてより好ましいことが報告されて
いる。しかしながら、Mid−trace型の量子化器を用いた
場合、圧縮率を高くすると成分固有のパターン画像が出
現するという欠点があり、拡大、階調、周波数処理など
の画像処理をしたとき不自然な画像が現われて復元画像
の忠実度が低くなるという問題がある。 ところで、Mid−trace型量子化を行う場合の復元画像
の画質は、圧縮時の量子化段階でゼロに量子化された変
換係数交流成分の最大ラン長(最大ゼロラン長)と強い
相互関係があることがわかる。すなわち、復元画像の各
ブロックの画像は、量子化時にゼロ以外に量子化された
変換係数交流成分の成分固有のパターンの加重和となっ
ているため、最大ゼロラン長の長いブロックでは成分固
有のパターン画像が復元画像内に出現する。そこで成分
固有のパターン画像の出現を抑制するには、量子化出力
レベルがゼロとなる量子化判定レベルの量子化幅を狭め
て各ブロックの最大ゼロラン長を短くすればよいが、そ
うすると符号化時の平均符号長が増加するため圧縮率が
低下してしまう。 従って、最大ゼロラン長を各ブロックごとに調べるこ
とにより成分固有のパターン画像が現れやすいブロック
を検出し検出されたブロックのみ量子化幅を狭めること
によりパターン画像の出現を抑制した復元画像を得るこ
とができることに気がついた。 (発明の目的および構成) 本発明は上記の点にかんがみてなされたもので、Mid
−trace型の量子化を行う変換符号化方式を用いて医用
画像を含む階調画像のデータを圧縮するに当り、成分固
有のパターン画像の発生を防ぎ、高圧縮率で高画質な復
元画像を得ることを目的とし、この目的を達成するため
に、デジタル化された階調画像データに直交変換を行っ
て得られる変換係数を量子化し符号化する階調画像デー
タの圧縮方法において、前記変換係数のうちゼロに量子
化される変換係数の最大ラン長に基づいて量子化幅を決
定し、前記決定された量子化幅で前記変換係数の量子化
を行うようにしたものである。 (実施例) 以下本発明を図面に基づいて説明する。 第1図は本発明による階調画像データ圧縮方法の一実
施例を示すブロック図である。 図においてフレームメモリ1には、圧縮対象となる階
調画像データ(本例では1画素当りのビット数を8ビッ
トとする)が格納されており、まず読み出し装置2がフ
レームメモリ1から画像データをブロック単位に読み出
す(本例では、ブロックサイズをライン方向、カラム方
向にそれぞれ16画素とする)。読み出されたブロックデ
ータは、2次元ディスクリートコサイン変換(2D−DC
T)装置3によりコサイン変換され1ブロック分256個の
変換係数を得る。 次に、こうして得られた256個の変換係数のうち1個
の直流成分を除く255個の変換係数交流成分は、量子化
装置4により基本量子化幅woで一様量子化され、各変換
係数ごとに固定長符号である係数番号と極性番号のペア
を得る。係数番号と極性番号のペアは、ブロックバッフ
ァメモリ6に一時的に格納されるとともに、係数番号は
クラス分け装置5へ送られる。 クラス分け装置5では、量子化装置4から送られてく
る1ブロックの分の係数番号と、端子52から入力される
圧縮率パラメータによりクラス分け処理を行ない、符号
化装置7へクラス番号を出力する。符号装置7はクラス
分け装置5から送られてくるクラス番号を読み込むと、
ブロックバッファメモリ6より1ブロック分の係数番号
と極性番号のペアを読み出し、変換係数交流成分の固定
長符号(番号)を可変長符号に変換して端子8へ出力す
る。符号データは端子8から送信されるかメモリへ格納
される。 第2図は量子化装置4の一例である。 まず端子41から1ブロック分の変換係数のうち直流成
分を除く255個の変換係数交流成分が入力される。255個
の変換係数は、絶対値回路42により絶対値がとられると
同時に、極性判定回路43により変換係数の正負の判定が
行なわれる。極性判定回路43は判定結果を極性番号とし
て端子47に出力する。ここでは、極性番号を1ビット符
号で表わし、変換係数が負の場合は“1"、正の場合は
“0"とする。 一方、絶対値回路42から出力された変換係数の絶対値
は除算回路44により基本量子化幅woで割り算される。割
り算結果は切り捨て回路45によって小数点以下の切り捨
てが行なわれ(この結果を係数番号と呼ぶ)、端子46お
よび端子47に出力される。端子46はクラス分け装置5に
接続されており、端子47はブロックバッファメモリ6に
接続されている。端子41から入力された1つの変換係数
に対して得られる極性番号と係数番号は2つで1組のペ
アをなし、端子47よりブロックバッファメモリ6へ一時
的に格納される。 一方、各ブロックの直流成分は充分小さい量子化幅w
dcで一様量子化されるか、もしくは量子化を行なわずに
他の255子の変換係数交流成分と同様にブロックバッフ
ァメモリ6へ一時的に格納される。 第3図に直流成分を除いた変換係数交流成分の量子化
の様子を示す。 横軸が変換係数の値であり、縦軸は変換係数の発生頻
度である。第3図(a)により示される番号列は切り捨
て回路45から出力される係数番号(k)列であり、第3
図(b)により示される番号列は極性判定回路43から出
力される極性番号(j)列である。 次に第4図はクラス数を4とした場合のクラス分け装
置5の一例である。 端子51は第2図の端子46と接続されており、量子化装
置4から出力される係数番号がここから入力される。こ
こで係数番号をk(k=0,1,2,3,4…)で表わすと、端
子51から入力された係数番号kはカウンタ制御LUT53に
より4ビットの第1次カウンタ制御コードCi(i=0,1,
2,3)に変換される。 第5図(イ)にカウンタ制御LUT53の一例を示す。 一方、端子52からは、ユーザーが端末(図示せず)か
ら入力した圧縮率パラメータPが入力される。本例の場
合圧縮率は2通り用意されており(P=0,1)、Pが大
きいほど圧縮率が高くなることを意味する。端子52から
入力された圧縮率パラメータPは、圧縮率制御LUT54に
より、4ビットの圧縮率制御コードepに変換される。第
5図(ロ)には圧縮制御LUT54の一例を示す。 次にOR回路55は第1次カウンタ制御コードciと圧縮率
制御コードepとを取り込み、両者の論理和である4ビッ
トの第2次カウンタ制御コードdiを求める。 di←ciUep 次にカウンタ制御回路56は第2次カウンタ制御コード
diを取り込み、カウンタ回路57内のカウンタ0からカウ
ンタ3までの4個のカウンタをdiの各ビットのon/off状
態によって制御する。第2次カウンタ制御コードdiの各
ビットは、下位ビットから順にカウンタ0、カウンタ
1、カウンタ2、カウンタ3に対応づけされており、ビ
ットon(=1)の場合はカウンタ制御回路56が対応する
カウンタを+1カンウントアップし、ビットがoff(=
0)の場合は対応するカウンタのカウントアップを行な
わずに、カウンタ内に設けられたカウンタバッファ(図
示せず)の値とそのときのカウント値を比較し、カウン
ト値がカウンタバッファ値より大きい場合に限り、カウ
ンタバッファ値をカウント値で置き換える。従って1ブ
ロック分のカウント作業が終了した時点でカウンタバッ
ファにはそのブロックにおける最大ゼロラン長が格納さ
れている。第5図(ハ)にdiの各ビットと各カウンタと
の対応関係を示す。なお、ci,epについても各カウンタ
と同様の対応関係が成立する。 第6図は、圧縮率パラメータPもしくは圧縮率制御コ
ードepと各カンウンタの動作範囲の関係を示す図であ
る。各圧縮率パラメータP(各ep)に対して、各カウン
タは第6図の矢印で示される範囲の関係番号kについて
のみ動作する。ただし、本例では、カウンタ3はPの値
にかかわらず、すべての係数番号kに対して動作するた
め、1ブロック分のクラス分け作業の終了をカウンタ3
により知ることができる。従って他にカウンタ3と同様
のカウンタを所有する場合はカウンタ3を省略してもよ
い。 次に、比較回路58の比較処理手順を第7図のフローチ
ャートに示す。 比較回路58は常にカウンタ3のカウント値をチェック
しており(F−1)、カウント値が255に満たないとき
は比較回路58は待機状態にある。カウンタ3のカウント
値が255になると、比較回路58はラン長閾値LUT59から出
力されるラン長閾値Spを読み込む。第5図(ニ)にラン
長閾値LUT59の一例を示す。ラン長閾値Spとは、各カウ
ンタバッファ内に格納されている各ブロックの最大ゼロ
ラン長に対する閾値である。比較回路58がラン長閾値Sp
を読み込むと、このSpとカウンタ2のカウンタバッファ
値の比較を行なう(F−2)。その結果、 (1)もしラン長閾値Spがカウンタ2のカウンタバッフ
ァ値以上であればクラス番号mを3にセットし(F−
3)、Spがカウンタ2のカウンタバッファ値より小さけ
ればSpとカウンタ1のカウンタバッファ値とを比較する
(F−4)。 (2)ラン長閾値Spとカウンタ1のカウンタバッファ値
との比較において、Spがカウンタ1のカウンタバッファ
値以上であれば、クラス番号mを2にセットし(F−
5)、Spがカウンタ1のカウンタバッファ値より小さけ
ればSpとカウンタ0のカウンタバッファ値を比較する
(F−6)。 (3)ラン長閾値Spとカウンタ0のカウンタバッファ値
との比較において、Spがカウンタバッファ値以上であれ
ば、クラス番号mを1にセットし(F−7)、Spがカウ
ンタ0のカウンタバッファ値より小さければ、クラス番
号mを0にセットする(F−8)。 (4)クラス番号mがセットされると、端子510よりク
ラス番号mを出力して(F−9)、1ブロック分のクラ
ス分け作業を終了し、カウンタ0からカウンタ3までの
各カウンタのカウント値と各カウンタバッファ値とをゼ
ロクリアする(F−10)。比較回路58から出力されるク
ラス番号mは、符号化時にランレングス符号化される変
換係数の範囲を示すパラメータとなっている。すなわ
ち、クラス番号がmであるブロックの255個の交流成分
に対して、変換係数の絶対値が0以上Am以下の領域内に
存在する変換係数はランレングス符号化されることを意
味する(第6図参照)。 第8図は符号化装置7の一例である。 クラス分け装置5が1ブロック分のクラス分け作業を
終了すると、符号化装置7は端子79(端子79は第4図の
端子510と接続されている)からクラス番号mを読み込
み、量子化LUT73に格納されている4つの量子化テーブ
ルから量子化に用いるテーブルを1つ選択すると同時に
データ読み出し回路72にブロックバッファメモリ6から
のデータ読み出し指令を送る。データ読み出し回路72は
ブロックバッファメモリ6と接続されている端子71から
直流成分データと、255組の係数番号kと極性番号j
(j=0or1)のペアとを読み込む。読み込まれたデータ
が直流成分であれば、端子78からデータを出力し、読み
込まれたデータが係数番号kと極性番号jのペアであれ
ばクラス番号mにより選択された量子化LUT73内の量子
化テーブルによって係数番号kおよび極性番号jを符号
番号lに変換する。 第9図には量子化LUT73内の量子化テーブルの一例を
示す。 本例は最終的量子化状態が第10図に示す一様量子化と
なるように、係数番号kを均等に区分けした例である
が、このほかに係数番号kを不均等に区分けすることも
可能であり、基本量子化幅Woの整数倍の最終的量子化幅
で一様でない量子化を行なうことができる。 次に交流成分の符号化手順の一例を第11図のフローチ
ャートに示す。 まず量子化LUT73より出力される符号番号lが内部に
符号通過カンウンタ74aを有するゼロ判定回路74に送ら
れる(P−1)。符号通過カウンタ74aは符号番号lを
受信すると、符号通過カウント値yを+1カウントアッ
プし(P−2)、ゼロ判定回路74が符号番号lのゼロ判
定を行なう(P−3)。もしlがゼロであればゼロカウ
ンタ75のゼロカウント値zを+1カウントアップした後
(P−4)、符号通過カウント値yが255になったかど
うかを判定する(P−11)。一方、lがゼロでなけれ
ば、ゼロカウント値zがゼロかどうかを判定し(P−
5)、ゼロであれば符号lを符号番号LUT76によって可
変長符号hlに変換して(P−6)端子78からhlを出力し
た後(P−7)符号通過カウント値yが255になったか
どうかを判定する(P−11)。もしゼロカウント値zが
ゼロでなければゼロカウント値zを符号LUT77によって
可変長符号rzに変換し(P−8)、ゼロカウント値zを
ゼロクリアした後(P−9)、rzを端子78から出力し
(P−10)、符号通過カウント値yが255になったかど
うかを判定する(P−11)。 符号通過カウント値yの判定において、もしカウント
値yが255でなければ符号番号lを読み込むステップ
(P−1)にもどって上記の処理を繰り返し行なう。も
し符号通過カウント値yが255であれば(P−11)、ゼ
ロカンウント値zがゼロであるかどうかを判定し(P−
12)、ゼロであれば符号通過カウント値yをゼロクリア
して(P−13)、1ブロック分の変換係数の符号化作業
を終了する。ゼロカンウント値zがゼロでなければ符号
変換ステップ(P−8)と、ゼロカウント値zのゼロク
リアステップ(P−9)と、端子78への可変長符号rz
力ステップ(P−10)を経た後符号通過カウント値yを
ゼロクリアし(P−13)1ブロック分の変換係数の符号
化作業を終了する。 第12図(イ)は符号LUT76の一例を示す。 本例は各クラスに共通のハフマン符号hlを用いた例で
ある。本実施例のように一様量子化を行なう場合は各ク
ラスごとに最適なハフマン符号hlを用いたときと各クラ
スに共通のハフマン符号hlを用いたときとで、圧縮率に
大きな違いがないため、各クラスに共通のハフマン符号
hlを用いることによりよりシンプルな装置化が可能とな
る。 第12図(ロ)は符号LUT77の一例を示す。 本例はゼロカウント値zに対して割り当てられるラン
レングス符号に各クラス共通のB1符号を用いた例であ
る。階調画像データを本方式で圧縮する場合の各ゼロラ
ン長の頻度分布はB1符号に適した指数関数的分布となる
ため、B1符号を用いることにより高い圧縮率を得ること
が可能となる。なお第12図(イ)および(ロ)において
Cおよびは0か1の値をとり、≠Cを満足する1ビ
ットの符号である。 第13図は第8図におけるデータ読み出し回路72のデー
タ読み出し順序を示す。 階調画像の変換係数は高周波成分ほど振幅が小さくな
る傾向が強いため、ゼロに量子化される成分の発生する
確率も高周波成分ほど高くなる。従って、第13図(イ)
もしくは(ロ)に示すように、低周波側から高周波方向
に向かって符号化すれば長いゼロランが発生する確率が
高まり、有効なランレングス符号化を行なうことができ
る。 第14図に符号構成の一例を示す。 第14図(イ)は1フレームの画像全体を圧縮した結果
の符号例であり、ヘッダ部とそれに続く各ブロックの符
号と、データ終了符号から成る。 第14図(ロ)はヘッダ部構成の一例であり、ブロック
サイズ(本例では16)、画像ライン方向のブロック数、
画像カラム方向のブロック数および圧縮率パラメータP
が格納されている。 第14図(ハ)は各ブロックの符号構成の一例であり、
クラス番号m(本例では2ビットの固定長符号)、直流
成分符号(固定長符号)、それに続く交流成分符号列
(可変長符号列)より成る。交流成分符号列は同図
(ニ)に示すようなq個(1≦q≦255)の符号より成
る係数符号列(可変長符号列hl1,hl2,…hlg)と同図
(ホ)に示すようなラン長符号(可変長符号rz)とが交
互に並ぶ構成となる。 以下に本実施例に用いた各種パラメータの一例を示
す。 基本量子化幅wo=0.5 A0=0.5,A1=1.0 A2=1.5,A3=2.0 S0=128,S2=50 なお上記パラメータは原画像の画素当りの情報量がn
ビット(本例ではn=8)でブロックサイズがN×N
(本例ではN=16)のとき、ブロック画像をf(x,
y)、変換係数行列をF(u,v)で表わした2次元ディス
クリートコサイン変換式(次式に示す)をフローティン
グポイントで計算した場合の値である。 また本発明においては、2次元ディスクリートコサイ
ン変換装置3の代りに、他の直交変換装置、たとえば2
次元でディスクリートなアダマール変換装置、スラント
変換装置などを用いてもよい。また本発明ではブロック
サイズを16×16のサイズに限定するものではなく、8×
8、32×32、64×64などのサイズでも適応可能であり、
また原画像の1画素当りのビット数も8ビットに限定す
るものではない。またクラス分け装置5において、特定
区間内の係数番号kをカウントする際、特定区間を多数
設けず、1つの特定区間内における最大ラン長の長短に
基づいてクラス分けを行なうことも可能である。また最
大ゼロラン長の代りに各ブロック内における平均ゼロラ
ン長をパラメータとしてクラス分けを行うことも可能で
ある。また、本発明におけるクラス分けパラメータを他
のクラス分けパラメータと組合せてクラス分けを行うこ
とも可能である。 (発明の効果) 以上のように、本発明においては、ゼロに量子化され
る変換係数の最大ラン長を用いることにより、復元画像
の画質、特にMid−trace型量子化の欠点である成分固有
のパターン画像の発生度合に基づいた量子化が可能とな
り、たとえば最大ラン長の長いブロックは最大ラン長を
短くするように量子化幅を決めることにより、パターン
画像の発生を抑制し高画質の復元画像を得ることができ
る。
Description: TECHNICAL FIELD The present invention relates to a method of compressing gradation image data for compressing gradation image data such as medical images such as X-ray photographs and CT images. BACKGROUND OF THE INVENTION With the advancement of digital technology, digitized gradation images are frequently stored, transmitted, and subjected to various digital image processings. However, a tone image has a larger amount of information than a binary image, and thus has a problem of a large amount of data when the tone image is digitized. In particular, in the case of medical images, the number of pixels and the number of bits required for each pixel when digitizing are enormous, for example, 4 million pixels and 8 to 10 bits in a chest radiograph, which is an efficient method for storing and transferring data. Is bad. Therefore, today, a data compression technique for compressing enormous data of a gradation image including a medical image to make it compact has been spotlighted. Data compression technologies can be broadly classified into lossless compression and irreversible compression.However, lossless compression can only achieve a low compression ratio of about 1/2 to 1/3, so a high compression rate of 1/5 or more can be obtained. Irreversible compression schemes, in particular, transform coding schemes, are attracting attention. Transformable code is an irreversible compression method in which the entire image is divided into small blocks, orthogonal transformation is performed in block units, and the obtained transform coefficients are quantized and encoded. This is the most suitable compression method for compression. In transform coding, the distribution of the AC component of the transform coefficient is
It is known that it is approximated to a Gaussian distribution having a peak at zero, and the quantization of the transform coefficient having such a distribution is performed by a Mid-Riser type quantization including zero in a quantization determination level, and a quantization output level. It has been reported that when classified into Mid-trace type quantization that includes zero, the Mid-trace type quantization has less random noise in the block and is more preferable. However, when a Mid-trace type quantizer is used, there is a drawback that when the compression ratio is increased, a component-specific pattern image appears, which is unnatural when performing image processing such as enlargement, gradation, and frequency processing. There is a problem that the image appears and the fidelity of the restored image is reduced. By the way, the image quality of the restored image when performing the Mid-trace type quantization has a strong correlation with the maximum run length (maximum zero run length) of the transform coefficient AC component quantized to zero in the quantization stage at the time of compression. You can see that. That is, since the image of each block of the restored image is a weighted sum of the component-specific pattern of the transform coefficient AC component quantized to a value other than zero at the time of quantization, the component-specific pattern is used for a block having a long maximum zero run length. The image appears in the restored image. Therefore, in order to suppress the appearance of a component-specific pattern image, it is only necessary to narrow the quantization width of the quantization determination level at which the quantization output level becomes zero to shorten the maximum zero run length of each block. , The compression rate decreases because the average code length increases. Therefore, by examining the maximum zero run length for each block, it is possible to detect a block in which a component-specific pattern image is likely to appear, and obtain a restored image in which the appearance of the pattern image is suppressed by narrowing the quantization width of only the detected block. I realized I could do it. (Object and Configuration of the Invention) The present invention has been made in view of the above points, and
When compressing the data of a gradation image including a medical image using a transform coding method that performs trace-type quantization, the generation of a component-specific pattern image is prevented, and a high-compression rate and high-quality restored image is generated. In order to achieve this object, in order to achieve this object, in a method of compressing gradation image data for quantizing and encoding a transformation coefficient obtained by performing orthogonal transformation on digitized gradation image data, the conversion coefficient The quantization width is determined based on the maximum run length of the conversion coefficient quantized to zero among the above, and the conversion coefficient is quantized with the determined quantization width. (Example) Hereinafter, the present invention will be described with reference to the drawings. FIG. 1 is a block diagram showing an embodiment of a gradation image data compression method according to the present invention. In the figure, a frame memory 1 stores gradation image data to be compressed (the number of bits per pixel is 8 bits in this example). Reading is performed in block units (in this example, the block size is 16 pixels in each of the line direction and the column direction). The read block data is converted into a two-dimensional discrete cosine transform (2D-DC
T) The cosine transform is performed by the device 3 to obtain 256 transform coefficients for one block. Next, of the 256 transform coefficients thus obtained, 255 transform coefficient AC components excluding one DC component are uniformly quantized by the quantizer 4 with a basic quantization width w o , and each transform is performed. A pair of a coefficient number and a polarity number, which are fixed-length codes, is obtained for each coefficient. The pair of the coefficient number and the polarity number is temporarily stored in the block buffer memory 6, and the coefficient number is sent to the classification device 5. The classifying device 5 performs a classifying process based on the coefficient number of one block sent from the quantizing device 4 and the compression ratio parameter input from the terminal 52, and outputs the class number to the encoding device 7. . When the encoding device 7 reads the class number sent from the classification device 5,
A pair of a coefficient number and a polarity number for one block is read from the block buffer memory 6, the fixed-length code (number) of the conversion coefficient AC component is converted into a variable-length code, and output to the terminal 8. The code data is transmitted from the terminal 8 or stored in the memory. FIG. 2 shows an example of the quantization device 4. First, 255 transform coefficient AC components excluding the DC component among the transform coefficients for one block are input from the terminal 41. The absolute values of the 255 conversion coefficients are determined by the absolute value circuit 42, and at the same time, the polarity determination circuit 43 determines whether the conversion coefficients are positive or negative. The polarity determination circuit 43 outputs the determination result to the terminal 47 as a polarity number. Here, the polarity number is represented by a 1-bit code, and is “1” when the conversion coefficient is negative and “0” when the conversion coefficient is positive. On the other hand, the absolute value of the transform coefficient output from the absolute value circuit 42 is divided by the basic quantization width w o by the division circuit 44. The division result is truncated to the decimal point by a truncation circuit 45 (this result is referred to as a coefficient number) and output to terminals 46 and 47. The terminal 46 is connected to the classification device 5, and the terminal 47 is connected to the block buffer memory 6. The polarity number and coefficient number obtained for one transform coefficient input from the terminal 41 form a pair of two, and are temporarily stored in the block buffer memory 6 from the terminal 47. On the other hand, the DC component of each block has a sufficiently small quantization width w.
It is uniformly quantized by dc , or temporarily stored in the block buffer memory 6 in the same manner as the other 255 conversion coefficient AC components without performing quantization. FIG. 3 shows the state of quantization of the AC component of the transform coefficient excluding the DC component. The horizontal axis is the value of the conversion coefficient, and the vertical axis is the frequency of occurrence of the conversion coefficient. The number sequence shown in FIG. 3 (a) is the sequence of coefficient numbers (k) output from the truncation circuit 45.
The number sequence shown by (b) is the polarity number (j) sequence output from the polarity determination circuit 43. Next, FIG. 4 shows an example of the classification device 5 when the number of classes is four. The terminal 51 is connected to the terminal 46 in FIG. 2, from which the coefficient number output from the quantization device 4 is input. When the coefficient number is represented by k (k = 0, 1, 2, 3, 4,...), The coefficient number k input from the terminal 51 is converted into a 4-bit primary counter control code C i ( i = 0,1,
Is converted to 2,3). FIG. 5 (a) shows an example of the counter control LUT 53. On the other hand, a compression ratio parameter P input by the user from a terminal (not shown) is input from the terminal 52. In the case of this example, two types of compression ratios are prepared (P = 0, 1), and the larger the P, the higher the compression ratio. Compression rate parameter P input from the terminal 52, the compression ratio control LUT 54, is converted into 4-bit compression rate control code e p. FIG. 5 (b) shows an example of the compression control LUT 54. Next OR circuit 55 takes in the compression ratio control code e p a primary counter control code c i, obtaining the second-order counter control code d i of 4 bits is a logical sum of both. d i ← c i Ue p Next, the counter control circuit 56 executes the second counter control code.
d i is fetched, and four counters from counter 0 to counter 3 in the counter circuit 57 are controlled by the on / off state of each bit of d i . Each bit of the second-order counter control code d i is the counter from the lower bit are sequentially 0, the counter 1, counter 2 are correspondence to the counter 3, when the bit on (= 1) corresponding counter control circuit 56 Counter is incremented by +1 and the bit is turned off (=
In the case of 0), the value of a counter buffer (not shown) provided in the counter is compared with the count value at that time without counting up the corresponding counter, and when the count value is larger than the counter buffer value. Only for, replace the counter buffer value with the count value. Therefore, when the counting operation for one block is completed, the maximum zero run length in that block is stored in the counter buffer. In FIG. 5 (c) shows the correspondence between the bits and the counters d i. Incidentally, c i, is a similar relationship with each counter holds for e p. FIG. 6 is a diagram showing the relationship between the compression ratio parameter P or the compression ratio control code ep and the operation range of each counter. For each compression rate parameter P (each e p), each counter operates only relationship number k of the range indicated by arrows in FIG. 6. However, in this example, the counter 3 operates for all coefficient numbers k regardless of the value of P.
You can know by. Therefore, if another counter similar to the counter 3 is possessed, the counter 3 may be omitted. Next, the comparison processing procedure of the comparison circuit 58 is shown in the flowchart of FIG. The comparison circuit 58 always checks the count value of the counter 3 (F-1). When the count value is less than 255, the comparison circuit 58 is in a standby state. When the count value of the counter 3 is 255, the comparison circuit 58 reads the run length threshold S p which is output from the run length threshold LUT 59. FIG. 5D shows an example of the run length threshold LUT59. The run length threshold S p, is a threshold for the maximum zero run length of each block is stored in each counter buffer. The comparison circuit 58 sets the run length threshold value Sp.
When read, and compares the counter buffer value of the S p and counter 2 (F-2). As a result, (1) If the run length threshold Sp is equal to or larger than the counter buffer value of the counter 2, the class number m is set to 3 (F−
3), S p is smaller than the counter buffer value of the counter 2 is compared with the counter buffer value of S p and counter 1 (F-4). (2) in comparison to the counter buffer value of the run length threshold S p and counter 1, if S p is the counter 1 counter buffer value or sets the class number m to 2 (F-
5), S p is smaller than the counter buffer value of the counter 1 compares the counter buffer value of S p and the counter 0 (F-6). (3) In comparison with the counter buffer value of the run length threshold S p and the counter 0, if S p is counter buffer values or sets the class number m to 1 (F-7), S p counter 0 If it is smaller than the counter buffer value, the class number m is set to 0 (F-8). (4) When the class number m is set, the class number m is output from the terminal 510 (F-9), the classification of one block is completed, and the counts of the counters 0 to 3 are counted. The value and each counter buffer value are cleared to zero (F-10). The class number m output from the comparison circuit 58 is a parameter indicating the range of the transform coefficient to be run-length encoded at the time of encoding. That is, the class number is relative to 255 of the AC component of the block is m, the transform coefficient whose absolute value is present within the following ranges 0 or A m of transform coefficients means that the run-length encoding ( (See FIG. 6). FIG. 8 is an example of the encoding device 7. When the classifying device 5 completes the classifying operation for one block, the encoding device 7 reads the class number m from the terminal 79 (the terminal 79 is connected to the terminal 510 in FIG. 4) and stores the class number m in the quantization LUT 73. One of the tables used for quantization is selected from the four stored quantization tables, and at the same time, a data read command from the block buffer memory 6 is sent to the data read circuit 72. The data reading circuit 72 receives the DC component data from the terminal 71 connected to the block buffer memory 6 and the 255 sets of coefficient numbers k and polarity numbers j.
(J = 0 or 1) is read. If the read data is a DC component, the data is output from the terminal 78. If the read data is a pair of the coefficient number k and the polarity number j, the quantization in the quantization LUT 73 selected by the class number m is performed. The coefficient number k and the polarity number j are converted into the code number 1 by the table. FIG. 9 shows an example of the quantization table in the quantization LUT 73. This example is an example in which the coefficient number k is uniformly divided so that the final quantization state is the uniform quantization shown in FIG. 10, but the coefficient number k may be unequally divided. It is possible, and non-uniform quantization can be performed with a final quantization width that is an integral multiple of the basic quantization width Wo . Next, an example of the coding procedure of the AC component is shown in the flowchart of FIG. First, the code number 1 output from the quantization LUT 73 is sent to a zero determination circuit 74 having a code passing counter 74a inside (P-1). When the code passage counter 74a receives the code number 1, the code passage count value y is incremented by one (P-2), and the zero determination circuit 74 performs the zero determination of the code number 1 (P-3). If 1 is zero, after incrementing the zero count value z of the zero counter 75 by +1 (P-4), it is determined whether or not the code passage count value y has reached 255 (P-11). On the other hand, if 1 is not zero, it is determined whether the zero count value z is zero (P−
5) If zero, the code 1 is converted into a variable length code hl by the code number LUT76 (P-6) and hl is output from the terminal 78 (P-7) Is the code passage count y equal to 255? It is determined whether it is (P-11). If the zero count value z is not zero the zero count value z is converted by the code LUT77 the variable length code r z (P-8), was cleared to zero zero count value z (P-9), terminals r z It is output from 78 (P-10), and it is determined whether or not the code passage count value y has reached 255 (P-11). In the determination of the code passage count value y, if the count value y is not 255, the process returns to the step (P-1) of reading the code number 1 and repeats the above processing. If the code passage count value y is 255 (P-11), it is determined whether the zero count value z is zero (P-
12) If it is zero, the code passage count value y is cleared to zero (P-13), and the encoding operation of the transform coefficient for one block is completed. If Zerokan'unto value z is not zero and code conversion step (P-8), was subjected to zero clear step of zero count value z (P-9), a variable length code r z output step to the terminal 78 (P-10) The post code passing count value y is cleared to zero (P-13), and the encoding operation of the transform coefficient for one block is completed. FIG. 12 (a) shows an example of the code LUT76. This example is an example using a common Huffman code hl for each class. In the case of performing uniform quantization as in the present embodiment, there is no significant difference in the compression ratio between when the optimal Huffman code hl is used for each class and when the common Huffman code hl is used for each class. Huffman code common to each class
By using hl, a simpler device can be realized. FIG. 12 (b) shows an example of the code LUT77. This example is an example in which a B1 code common to each class is used as a run length code assigned to the zero count value z. When the gradation image data is compressed by the present method, the frequency distribution of each zero run length becomes an exponential function distribution suitable for the B1 code. Therefore, a high compression ratio can be obtained by using the B1 code. In FIGS. 12 (A) and 12 (B), C and 1 take a value of 0 or 1, and are 1-bit codes satisfying ΔC. FIG. 13 shows the data reading order of the data reading circuit 72 in FIG. Since the conversion coefficient of the gradation image tends to have a smaller amplitude as the frequency component increases, the probability of occurrence of a component quantized to zero also increases as the frequency component increases. Therefore, Fig. 13 (a)
Alternatively, as shown in (b), if encoding is performed from the low frequency side toward the high frequency side, the probability of occurrence of a long zero run increases, and effective run length encoding can be performed. FIG. 14 shows an example of a code configuration. FIG. 14 (a) shows a code example of the result of compressing the entire image of one frame, which is composed of a header part, a code of each subsequent block, and a data end code. FIG. 14 (b) shows an example of the header section configuration, which includes the block size (16 in this example), the number of blocks in the image line direction,
Number of blocks in image column direction and compression ratio parameter P
Is stored. FIG. 14 (c) shows an example of the code configuration of each block.
It is composed of a class number m (in this example, a 2-bit fixed-length code), a DC component code (fixed-length code), and a subsequent AC component code sequence (variable-length code sequence). The AC component code string is a coefficient code string (variable length code strings hl 1 , hl 2 ,... Hl g ) composed of q (1 ≦ q ≦ 255) codes as shown in FIG. ) And run length codes (variable length codes r z ) are alternately arranged. Hereinafter, examples of various parameters used in this embodiment will be described. Basic quantization width w o = 0.5 A 0 = 0.5, A 1 = 1.0 A 2 = 1.5, A 3 = 2.0 S 0 = 128, S 2 = 50 Note that the above parameter is the information amount per pixel of the original image is n.
The block size is N × N with bits (n = 8 in this example)
When (N = 16 in this example), the block image is represented by f (x,
y), a value obtained by calculating a two-dimensional discrete cosine transform equation (shown in the following equation) representing a transform coefficient matrix by F (u, v) at a floating point. In the present invention, instead of the two-dimensional discrete cosine transform device 3, another orthogonal transform device, for example, 2
A dimensional and discrete Hadamard transform device, slant transform device, or the like may be used. Also, in the present invention, the block size is not limited to the size of 16 × 16, but is 8 ×.
Sizes such as 8, 32 x 32, 64 x 64 are also applicable,
Further, the number of bits per pixel of the original image is not limited to 8 bits. When counting the coefficient number k in a specific section in the classifying apparatus 5, it is also possible to classify based on the length of the maximum run length in one specific section without providing a large number of specific sections. It is also possible to perform classification using the average zero run length in each block as a parameter instead of the maximum zero run length. Further, the classification can be performed by combining the classification parameter in the present invention with other classification parameters. (Effects of the Invention) As described above, in the present invention, by using the maximum run length of the transform coefficient quantized to zero, the image quality of the restored image, particularly the component-specific Quantization based on the degree of occurrence of pattern images becomes possible.For example, for blocks with a long maximum run length, the quantization width is determined so as to shorten the maximum run length, thereby suppressing the occurrence of pattern images and restoring high image quality. Images can be obtained.

【図面の簡単な説明】 第1図は本発明による階調画像データ圧縮方法の一実施
例のブロック線図、第2図は第1図に示した量子化装置
の一例のブロック線図、第3図は変換係数交流成分を量
子化して得られる係数番号と極性番号とを変換係数の発
生頻度との関係で示す図、第4図は第1図に示したクラ
ス分け装置の一例のブロック線図、第5図(イ)はカウ
ンタ制御LUT、(ロ)は圧縮率制御LUT、(ハ)は第2次
カウンタ制御コードと各カウンタの対応関係、(ニ)は
ラン長閾値LUTをそれぞれ示す図、第6図(イ)および
(ロ)はカウンタ回路内の各カウンタの動作範囲を示す
図、第7図は比較回路の比較手順を示すフローチャー
ト、第8図は第1図に示した符号化装置の一例のブロッ
ク線図、第9図は第8図に示した量子化LUTの一例、第1
0図は最終的量子化状態の一例、第11図は第1図に示し
た符号化装置による交流成分符号化手順を示すフローチ
ャート、第12図(イ)および(ロ)はそれぞれ第8図の
2つの符号LUTの一例、第13図(イ)および(ロ)は第
8図のデータ読出し回路におけるデータ読出し順序を示
す図、第14図(イ)、(ロ)、(ハ)、(ニ)、(ホ)
は符号構成の内容の一例を示す図である。 1……フレームメモリ、2……読み出し装置、3……2
次元ディスクリートコサイン変換装置、4……量子化装
置、5……クラス分け装置、6……ブロックバッファメ
モリ、7……符号化装置
BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is a block diagram of an embodiment of a gradation image data compression method according to the present invention, FIG. 2 is a block diagram of an example of a quantization device shown in FIG. FIG. 3 is a diagram showing a coefficient number and a polarity number obtained by quantizing the transform coefficient AC component in relation to the frequency of occurrence of the transform coefficient. FIG. 4 is a block diagram of an example of the classification device shown in FIG. Fig. 5 (a) shows the counter control LUT, (b) shows the compression ratio control LUT, (c) shows the correspondence between the secondary counter control code and each counter, and (d) shows the run length threshold LUT. FIGS. 6 (a) and 6 (b) show the operation range of each counter in the counter circuit, FIG. 7 is a flowchart showing the comparison procedure of the comparison circuit, and FIG. 8 is the symbol shown in FIG. FIG. 9 is a block diagram of an example of the quantization LUT shown in FIG.
FIG. 0 is an example of a final quantization state, FIG. 11 is a flowchart showing an AC component encoding procedure by the encoding apparatus shown in FIG. 1, and FIGS. FIGS. 13 (a) and (b) show an example of two code LUTs showing the data reading order in the data reading circuit of FIG. 8, and FIGS. 14 (a), (b), (c) and (d). ), (E)
Is a diagram illustrating an example of the contents of a code configuration. 1 ... frame memory, 2 ... readout device, 3 ... 2
Dimensional discrete cosine transform device, 4... Quantizer, 5... Classifier, 6... Block buffer memory, 7.

───────────────────────────────────────────────────── フロントページの続き (56)参考文献 特開 昭63−246977(JP,A) IEEE TRANSACTIONS ON COMMUNICATIONS VOL.COM−23[7](1975) p.785−786   ────────────────────────────────────────────────── ─── Continuation of front page       (56) References JP-A-63-246977 (JP, A)                 IEEE TRANSACTIONS                 ON COMMUNICATIONS                 VOL. COM-23 [7] (1975)               p. 785-786

Claims (1)

(57)【特許請求の範囲】 1.デジタル化された階調画像データに直交変換を行っ
て得られる変換係数を量子化し符号化する階調画像デー
タの圧縮方法において、 前記変換係数のうちゼロに量子化される変換係数の最大
ラン長に基づいて量子化幅を決定し、前記決定された量
子化幅で前記変換係数の量子化を行うことを特徴とする
階調画像データの圧縮方法。
(57) [Claims] In a gradation image data compression method for quantizing and encoding a transform coefficient obtained by performing orthogonal transform on digitized tone image data, a maximum run length of a transform coefficient quantized to zero among the transform coefficients. Wherein the quantization coefficient is determined based on the quantization width, and the transform coefficient is quantized using the determined quantization width.
JP7977687A 1987-04-02 1987-04-02 Method of compressing gradation image data Expired - Lifetime JP2821496B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP7977687A JP2821496B2 (en) 1987-04-02 1987-04-02 Method of compressing gradation image data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP7977687A JP2821496B2 (en) 1987-04-02 1987-04-02 Method of compressing gradation image data

Publications (2)

Publication Number Publication Date
JPS63246978A JPS63246978A (en) 1988-10-13
JP2821496B2 true JP2821496B2 (en) 1998-11-05

Family

ID=13699606

Family Applications (1)

Application Number Title Priority Date Filing Date
JP7977687A Expired - Lifetime JP2821496B2 (en) 1987-04-02 1987-04-02 Method of compressing gradation image data

Country Status (1)

Country Link
JP (1) JP2821496B2 (en)

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
IEEE TRANSACTIONS ON COMMUNICATIONS VOL.COM−23[7](1975)p.785−786

Also Published As

Publication number Publication date
JPS63246978A (en) 1988-10-13

Similar Documents

Publication Publication Date Title
JP4113114B2 (en) DCT compression using GOLOMB-RICE coding
KR100914160B1 (en) Lossless intraframe encoding using golomb-rice
US4922273A (en) Compression method of halftone image data
JP3699425B2 (en) Image compression method and system with adaptive block size
JP2004531995A5 (en)
AU2002316546A1 (en) Lossless intraframe encoding using golomb-rice
JPH08116447A (en) Coder for image signal
KR20020008133A (en) Lossless adaptive encoding of finite alphabet data
JPH07170517A (en) Picture compression coder
JP2811304B2 (en) Method of compressing gradation image data
JP2821496B2 (en) Method of compressing gradation image data
JP2841197B2 (en) Method of compressing gradation image data
JP2511669B2 (en) Compressor for gradation image data
JPH07283948A (en) Compressing device for gradation picture data
WO1998054841A1 (en) Data compressing device by permutation encoding and decompressing device
JP3049265B2 (en) Image data coding circuit
JPH09172379A (en) Variable length en-coding device/method
JPH0595484A (en) Picture compressor and its method
JPH01237774A (en) Encoding method in compression of gradation picture data
JPS63252018A (en) Image data compressing device

Legal Events

Date Code Title Description
S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

S533 Written request for registration of change of name

Free format text: JAPANESE INTERMEDIATE CODE: R313533

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

EXPY Cancellation because of completion of term
FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20070904

Year of fee payment: 9