Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP2833743B2 - MH code decoder - Google Patents
[go: Go Back, main page]

JP2833743B2 - MH code decoder - Google Patents

MH code decoder

Info

Publication number
JP2833743B2
JP2833743B2 JP62105825A JP10582587A JP2833743B2 JP 2833743 B2 JP2833743 B2 JP 2833743B2 JP 62105825 A JP62105825 A JP 62105825A JP 10582587 A JP10582587 A JP 10582587A JP 2833743 B2 JP2833743 B2 JP 2833743B2
Authority
JP
Japan
Prior art keywords
code
decoding logic
run
length
logic circuit
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
JP62105825A
Other languages
Japanese (ja)
Other versions
JPS63269833A (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.)
NEC Corp
Original Assignee
Nippon Electric 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 Nippon Electric Co Ltd filed Critical Nippon Electric Co Ltd
Priority to JP62105825A priority Critical patent/JP2833743B2/en
Publication of JPS63269833A publication Critical patent/JPS63269833A/en
Application granted granted Critical
Publication of JP2833743B2 publication Critical patent/JP2833743B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Description

【発明の詳細な説明】 [産業上の利用分野] 本発明は、MH(モデイファイドホフマン)符号復号器
に関する。 [従来の技術] MH(Modified Huffman)符号は、主にFAXの白黒画素
の文書画像の1次元のデータを圧縮するために用いられ
ており、1980年(昭和55年)11月にCCITT総会でT.4とし
て勧告されている。このMH符号は、本明細書の[発明の
効果]の後にある別表の符号であり、この符号について
別表を引用して具体的に説明する。 まずFAXが原稿の端から1次元方向に白黒の画素を読
みとり、初めの4画素が白で、次の133画素が黒、さら
に次の1588画素が白の場合に、対応するMH符号がどのよ
うになるかを説明する。別表で、4画素が白に対応する
部分は、まず白画素または黒画素が続く長さである「ラ
ン長」が4の部分を探し、次にこの部分の右側にある白
の画素を表す「白ラン」の部分の符号を探し、符号とし
て 1011 …… を得る。次に同じく別表で、133画素が黒に対応する部
分を探すと、ラン長として128や192はあるが、133はな
い。この場合は、画素数の133が133=128+5なので、
画素数128と画素数5とに分ける必要がある。このため
ラン長が128の部分を見て、次にこの部分の右側にある
黒の画素を表す「黒ラン」の部分の符号を探し、符号と
して 000011001000 …… を得る。次に残りの5画素(=133−128)が黒の符号化
をする。別表で、5画素が黒に対応する部分は、まずラ
ン長が5の部分を探し、次にこの部分の右側にある黒ラ
ンの部分の符号を探し、符号として 0011 …… を得る。次に同じく別表で、1588画素が白に対応する部
分は、まずラン長が1536と1600との間であるので、小さ
い方のラン長が1536の部分を見て、次にこの部分の右側
にある白ランの部分の符号を探し、符号として 010011001 …… を得る。ちなみに、この部分はMH符号化しないならば15
36ビットの大きなデータになるが、符号化するとわずか
9ビットのデータ(010011001)になる。次に1588画素
が白の内、1536画素の符号化ができたので、残りの52画
素(=1588−1536)が白の符号化をする。別表で、52画
素が白に対応する部分は、まずラン長が52の部分を探
し、次にこの部分の右側にある白ランの部分の符号を探
し、符号として 01010101 …… を得る。これら5つのMH符号を順次並べると
次のようなMH符号列ができる。 1011000011001000001101001100101010101 …… なおMH符号には、他に1次元方向に読みとった画素の
終わりを示すEOLがある。 さてこのようにMH符号化したデータを、逆に元の白黒
の画素に復号して、別表が示すMH符号化についてさらに
説明する。MH符号列の初めは、白ランであるという決ま
りがある(初めが黒の画素の場合は白ランのラン長0の
MH符号を使用)ので、初めのビットからどのラン長に当
てはまるかを照合していくと、ラン長が4である1011が
対応することがわかり、白の画素が4つ並ぶことがわか
る。 次に復号した1011をMH符号列から除いて、次のよう
な符号列 000011001000001101001100101010101 …… が得られるが、次のMH符号が白ランか黒ランかがわから
ないと復号するのに困る。これがわかるように、MH符号
は、別表のように、「ターミネイティング符号語」と
「メイクアップ符号語」とに分けられている。復号に用
いた1011のMH符号は、その色の画素がこの符号で終わり
であることを示す「ターミネイティング符号語」に含ま
れており、これから次の画素が黒で、黒ランの符号のど
のラン長に当てはまるかを照合すればよいことがわか
る。照合を行うと、ラン長が128である000011001000が
対応することがわかり、黒の画素が128並ぶことがわか
る。またこのMH符号は、別表のように「メイクアップ符
号語」(同じ色の「ターミネイティング符号語」が次に
1つ続くことを示す)に含まれるので、次の画素が黒の
ままで、黒ランの符号のどのラン長に当てはまるかを照
合すればよいことがわかる。従って、復号した00001100
1000をMH符号列から除いて、次のような符号列 001101001100101010101 …… が得られる。再度、黒ランの符号のどのラン長に当ては
まるかを照合すると、ラン長が5である0011が対応する
ことがわかり、黒の画素が128+5の133並ぶことがわか
る。この0011のMH符号は、「ターミネイティング符号
語」に含まれており、これから次の画素が白で、白ラン
の符号のどのラン長に当てはまるかを照合すればよいこ
とがわかる。 以上に白黒の画素の並びとMH符号列との対応を説明し
た。なお以降の説明では、「ターミネイティング符号
語」をTコード、「メイクアップ符号語」をMコードと
略記する。 MH符号復号器は、MH符号に符号化されたものを復号し
て、ラン長を出力する。MH符号の符号長は2から13まで
である。したがって、連続する13ビットずつ復号すれば
よい。 従来、この種のMH符号復号器では、連続する13ビット
の符号をそのまま入力としていた。 第3図に、従来のMH符号復号器の一例を示す。同図に
於て、シフトレジスタ301はMH符号の符号列を復号化論
理回路302へ順次入力させるレジスタである。同図で最
上位ビットをMSB、最下位ビットをLSBとする。シフトレ
ジスタ301は16ビットで、後述するラッチ信号311により
MH符号を8ビットずつラッチする。また、保持されてい
るデータは、後述するシフトパルス312によりLSB方向へ
1ビットずつシフトされる。復号化論理回路302はリー
ドオンリメモリ(以下、ROMという)を使用して実現さ
れており、シフトレジスタ301からMH符号を13ビットず
つ入力してラン長積算器303へラン長を、色反転回路304
へTコード/Mコードの別を、符号長積算器310へ符号長
をそれぞれ出力する。ラン長積算器303は色反転回路304
から色反転信号305が来るまでラン長を積算する。色反
転回路304は復号化論理回路302からTコード/Mコードの
別を表す信号を入力し、Tコードであることを検出する
と色反転信号305と復号化論理選択信号306とを出力す
る。色反転信号305は前述したようにラン長積算器303に
つながる。また、復号化論理選択信号306は復号化論理
回路302へ出力される。符号長積算器310は復号化論理回
路302から符号長を入力して、符号長と同数のシフトパ
ルス312を発生する。また、符号長を積算して8ビット
ごとにラッチ信号311を出力する。 同図に於て、MH符号を復号する動作を考える。まず、
シフトレジスタ301に図示していない開始信号によりMH
符号16ビットを入力する。始めは白ランであるとする。
入力した16ビットのうち下位13ビットが復号化論理回路
302にはいり、ラン長、Tコード/Mコードの別、符号長
を出力する。符号がMコードであれば、色反転信号305
はインアクティブになりラン長は次の復号でも積算され
る。また、復号化論理選択信号306もインアクティブで
あり次の復号も白ランになる。Tコードであれば、色反
転信号305はアクティブになりラン長は次の復号から新
に積算される。また、復号化論理選択信号306もアクテ
ィブになり次の復号は黒ランになる。符号長積算器310
は符号長と同数のシフトパルス312を発生し、シフトレ
ジスタ301の内容は符号長分だけシフトされる。また、
ラッチ信号311がアクティブになれば、シフトレジスタ3
01にMH符号が8ビット入力される。符号がTコードにな
ったときのラン長積算器303の出力が復号されたデータ
である。 この例で、第1表よりラン長は最大2560であるからラ
ン長積算器303へ出力するラン長は12ビット、符号長積
算器310へ出力する符号長は4ビットである。従って、
Tコードの別を1ビットで表すとすれば、復号化論理回
路302からの出力は合計17ビットとなる。このとき、復
号化論理回路302をROMで構成すると総ビット数は、214
×17=272Kビットとなる。 [発明が解決しようとする問題点] 上述したように、従来のMH符号復号器では、復号化論
理回路をROMで構成しようとすると総ビット数が、214×
17=272Kビットとなり、ハードウェア量が大きすぎると
いう問題点がある。 したがって、本発明の目的は少ないハードウェア量で
MH符号復号器を実現することである。 [問題点を解決するための手段] 本願のMH符号復号器は、白ランの復号を行う際に、MH
符号の符号列のまだ復号していない部分を初めから連続
して9ビットだけ読み込み、9ビット以下のMH符号を有
する白ランのラン長が0から1728までのMH符号の復号を
行い、11ビット以上の白ランのラン長が1792以上のMH符
号を復号しないで検出信号を出力する、9ビット入力の
1つのメモリからなる復号化論理回路をを有する。 [実施例] 次に、本発明の実施例について図面を参照して説明す
る。 第1実施例 第1図は本発明の第1実施例を示すブロック図であ
る。同図に於て、シフトレジスタ101は、MH符号の符号
列を復号化論理回路121、復号化論理回路122、復号化論
理回路123へ供給するレジスタである。同図で上側をMS
B、下側をLSBとする。シフトレジスタ101は16ビット
で、後述するラッチ信号111によりMH符号を8ビットず
つラッチする。また、中のデータは、後述するシフトパ
ルス112によりLSB方向へ1ビットずつシフトされる。本
実施例では、復号化論理回路121は白ランに対する復号
化論理回路、復号化論理回路122は黒ランと白黒共通ラ
ンに対する復号化論理回路、復号化論理回路123は一部
の黒ランに対する復号化論理回路である。復号化論理回
路121、復号化論理回路122、復号化論理回路123はいず
れも、シフトレジスタ101からMH符号を9ビットずつ入
力して、ラン長、Tコード/Mコードの別、符号長を、マ
ルチプレクサ130に出力する。また、復号化論理回路122
は、連続ゼロ検出信号を出力する。マルチプレクサ130
は後述する復号化論理選択信号132にしたがって、前記
3つの復号化論理回路から出力された各情報のうちいず
れかを選び、ラン長積算器103へラン長を、色反転回路1
04へTコード/Mコードの別を、符号長積算器110へ符号
長を、復号化論理選択回路131へ連続ゼロ検出信号をそ
れぞれ出力する。復号化論理選択回路131はマルチプレ
クサ130に復号化論理選択信号132を出力する。ラン長積
算器103は色反転回路104から色反転信号105が来るまで
ラン長を積算する。色反転回路104は、マルチプレクサ1
30からTコード/Mコードの別を表す信号を入力し、Tコ
ードであることを検出すると色反転信号105と復号化論
理選択信号132とを出力する。符号長積算器110は、マル
チプレクサ130から符号長を入力して、符号長と同数の
シフトパルス112を発生する。また、符号長を積算して
8ビットごとにラッチ信号111を出力する。 次に、動作の説明を行う。処理の概要フローを第4図
に示す。 シフトレジスタ101に図示していない開始信号によりM
H符号16ビットを入力する。簡単のため、始めが白ラン
であるとする。入力した16ビットのうち下位9ビットが
復号化論理回路121、復号化論理回路122、復号化論理回
路123に供給される。始めを白ランとしたので、復号化
論理回路121からの出力がマルチプレクサ130で選択され
る。ここで、別表の関係から、もし入力した9ビットの
うち最下位の連続する8ビットがLSBから順に“0000 00
01"でなければ、復号化論理回路121は、ラン長、Tコー
ド/Mコードの別、符号長を出力する。符号がMコードで
あれば、色反転信号105はインアクテイブになりラン長
は次の復号でも積算される。また、復号化論理選択信号
132もインアクティブであり次の復号も白ランになる。
Tコードであれば、色反転信号105はアクティブになり
ラン長は次の復号から新たに積算される。また、復号化
論理選択信号132もアクティブになり次の復号は黒ラン
になる。符号長積算機110は符号長と同数のシフトパル
ス112を発生し、シフトレジスタ101の内容は符号長分だ
けシフトされる。また、ラッチ信号111がアクティブに
なれば、シフトレジスタ101に次の8ビットのMH符号が
入力される。符号がTコードになったときのラン長積算
器103の出力が復号されたデータである。もし入力した
9ビットのうち最下位の連続する8ビットが“0000 000
1"であれば、復号化論理回路121は、ラン長、Tコード/
Mコードの別、符号長のほかに、連続ゼロ検出信号を出
力する。この時のラン長は“0"、Tコード/Mコードの別
はMコード、符号長は“4"とする。色反転信号105はイ
ンアクティブになりラン長は次の復号でも積算される。
また、復号化論理選択回路131は、連続ゼロ検出信号と
色反転信号105とを入力して復号化論理選択信号132を出
力し、次の復号も白ランであるが選択すべき復号化論理
回路を復号化論理回路122に切り換えることを指示す
る。符号長積算器110はシフトパルス112を符号長と同
数、すなわち4個発生する。シフトレジスタ101の内容
は所定ビットである4ビット分だけシフトされる。次
に、再びシフトレジスタ101から下位9ビットが復号化
論理回路121、復号化論理回路122、復号化論理回路123
にはいる。前述の動作により、今回は復号化論理回路12
2からの出力がマルチプレクサ130で選択される。以下の
動作は、前述したものと同様である。 次に、黒ランの場合について考える。シフトレジスタ
101から入力されたMH符号9ビットが復号化論理回路12
1、復号化論理回路122、復号化論理回路123にはいる。
黒ランの場合、別表の関係から、もし入力した9ビット
のうち最下位の連続する4ビットがLSBから順に“0000"
でなければ、復号化論理回路123からの出力がマルチプ
レクサ130で選択される。復号化論理回路123は、ラン
長、Tコード/Mコードの別、符号長を出力する。この場
合符号はTコードであるから、色反転信号105はアクテ
ィブになりラン長は次の復号から新たに積算される。ま
た、復号化論理選択信号106もアクティブになり次の復
号は白ランになる。符号長積算器110は符号長と同数の
シフトパルス112を発生し、シフトレジスタ101の内容は
符号長分だけシフトされる。また、ラッチ信号111がア
クティブになれば、シフトレジスタ101に次の8ビット
のMH符号が入力される。ラン長積算器103の出力が復号
されたデータである。もし入力した9ビットのうち最下
位の連続する4ビットが“0000"であれば、復号化論理
回路122が選択される。復号化論理回路122は、ラン長、
Tコード/Mコードの別、符号長のほかに、連続ゼロの検
出信号を出力する。この時のラン長は“0"、Tコード/M
コードの別はMコード、符号長は“4"とする。色反転信
号105はインアクティブになりラン長は次の復号でも積
算される。また、復号化論理選択回路131は、連続ゼロ
検出信号と色反転信号105とを入力して復号化論理選択
信号106を出力し、次の復号も黒ランであり選択すべき
復号化論理回路を再び復号化論理回路122にすることを
指示する。符号長積算器110はシフトパルス112を符号長
と同数、すなわち4個発生する。シフトレジスタ101の
内容は4ビット分だけシフトされる。次に、再びシフト
レジスタ101から下位9ビットが復号化論理回路121、復
号化論理回路122、復号化論理回路123にはいる。前述の
動作により、今回も復号化論理回路122からの出力がマ
ルチプレクサ130で選択される。以下の動作は、前述し
たものと同様になる。 本実施例によれば、復号化論理回路への入力は9ビット
でよい。また、復号化論理回路123では短い黒ランの場
合を扱うだけなので、復号化論理回路123は簡単な論理
回路で構成できる。残り2つの復号化論理回路をROMで
構成しようとすると総ビット数は、29×17×2=17Kビ
ットとなる。これに、復号化論理回路123の論理回路と
マルチプレクサ130と復号化論理選択回路131とのハード
ウェアを加えても、214×17=272KビットのROMのハード
ウェア量には、はるかに及ばない。 第2実施例 第2図は、本発明の第2実施例を示すブロック図であ
る。同図に於て、入力レジスタ241、入力レジスタ242
は、それぞれ後述するラッチ信号243、ラッチ信号244に
よりMH符号を入力する。バレルシフタ201は、MH符号の
符号列を復号化論理回路221、復号化論理回路222、復号
化論理回路223へ入力させるレジスタである。バレルシ
フタ201は16ビットで、後述するラッチ信号211によりMH
符号の符号列を入力レジスタ241、入力レジスタ242から
入力する。同図で上をMSB、下をLSBとする。また、中の
データは、後述するシフトパルス212によりLSB方向へシ
フト数213で指示されるビット数ずつシフトされる。本
実施例では、復号化論理回路221は白ランに対する復号
化論理回路、復号化論理回路222は黒ランと白黒共通ラ
ンに対する復号化論理回路、復号化論理回路223は一部
の黒ランに対する復号化論理回路である。復号化論理回
路221、復号化論理回路222、復号化論理回路223はいず
れも、バレルシフタ201からMH符号を9ビットずつ入力
して、ラン長、Tコード/Mコードの別、符号長を、マル
チプレクサ230に出力する。復号化論理回路221と復号化
論理回路222は、連続ゼロ検出信号を出力する。マルチ
プレクサ230は、後述する復号化論理選択信号232にした
がって、前記3つの復号化論理回路から出力された各情
報のうちいずれかを選び、ラン長積算器203へラン長
を、色反転回路204へTコード/Mコードの別を、符号長
積算器210へ符号長を、復号化論理選択回路231へ連続ゼ
ロ検出信号をそれぞれ出力する。復号化論理選択回路23
1は、マルチプレクサ230に復号化論理選択信号232を出
力する。ラン長積算器203は、色反転回路204から色反転
信号205が来るまでラン長を積算する。色反転回路204
は、マルチプレクサ230からTコード/Mコードの別を表
す信号を入力し、Tコードであることを検出すると色反
転信号205と復号化論理選択信号206とを出力する。符号
長積算器210は、マルチプレクサ230から符号長を入力し
て、シフトパルス212とシフト数213とを発生する。ま
た、符号長を積算して8ビットごとにラッチ信号211を
出力する。 この実施例では、符号長積算器210の動作が第1の実
施例とは異なる。符号長積算器210は、マルチプレクサ2
30から符号長を入力すると、シフトパルス212を発生す
る。また、この時同時にシフト数213を出力するが、こ
の値は、符号長の積算値の8の剰余数で与えられる。ま
た、ラッチ信号211をバレルシフタ201に対して出力する
とともに、入力レジスタ241、入力レジスタ242のいずれ
かに対しても出力する。この時のラッチ信号243、ラッ
チ信号244は、ラッチ信号211から作られる。 この実施例では、MH符号のシフトを、バレルシフタを
用いて1クロックで行うので、第1実施例よりも処理が
高速になるという利点がある。 [発明の効果] 以上説明してきたように、本発明によればMH符号復号
器のハードウェア量を減少させることができるという効
果を奏する。
Description: TECHNICAL FIELD The present invention relates to an MH (Modified Huffman) code decoder. [Prior art] The MH (Modified Huffman) code is mainly used for compressing one-dimensional data of a document image of a black and white pixel of a facsimile. The CCITT general meeting was held in November 1980 (Showa 55). Recommended as T.4. This MH code is a code in a separate table after [Effect of the Invention] in this specification, and this code will be specifically described with reference to the different table. First, the FAX reads black and white pixels in one dimension from the edge of the document. If the first 4 pixels are white, the next 133 pixels are black, and the next 1588 pixels are white, the corresponding MH code is Will be described. In the separate table, the portion where four pixels correspond to white is first searched for a portion in which the “run length”, which is the length of a continuous white pixel or black pixel, is 4, and then represents a white pixel on the right side of this portion. Look for the code of the "white run" part and obtain 1011 as the code. Next, in the same table, when a portion where 133 pixels correspond to black is searched, there are run lengths of 128 and 192, but no run length. In this case, since the number of pixels 133 is 133 = 128 + 5,
It is necessary to divide into 128 pixels and 5 pixels. Therefore, looking at the portion where the run length is 128, the code of the “black run” portion representing the black pixel on the right side of this portion is searched, and the code 000011001000 is obtained. Next, the remaining five pixels (= 133-128) are coded black. In the separate table, for the portion where 5 pixels correspond to black, first, a portion having a run length of 5 is searched, and then the code of the black run portion on the right side of this portion is searched to obtain 0011... Next, similarly in the separate table, the part where 1588 pixels correspond to white first has a run length between 1536 and 1600, so look at the part with the smaller run length of 1536, and then on the right side of this part The code of a certain white run is searched, and 010011001... Is obtained as the code. By the way, this part is 15 if not MH encoded.
Although it becomes large data of 36 bits, it becomes only 9-bit data (010011001) when encoded. Next, since 1588 pixels are white, 1536 pixels can be encoded, and the remaining 52 pixels (= 1588-1536) are encoded in white. In the separate table, for the portion where 52 pixels correspond to white, first, a portion with a run length of 52 is searched, and then the code of the white run portion on the right side of this portion is searched, and as a code, 01010101... By arranging these five MH codes sequentially, the following MH code string is created. 1011000011001000001101001100101010101... The MH code also has EOL indicating the end of the pixel read in the one-dimensional direction. Now, the MH-encoded data is decoded into the original black and white pixels, and the MH encoding shown in the attached table will be further described. There is a rule that the beginning of the MH code string is a white run (in the case of a black pixel at the beginning, the run length of the white run is 0).
(MH code is used), it is found from the first bit to which run length applies, and it can be seen that 1011 having a run length of 4 corresponds, and that four white pixels are arranged. Next, by removing the decoded 1011 from the MH code string, the following code string 000011001000001101001100101010101... Can be obtained. As can be seen, the MH code is divided into a "terminating codeword" and a "makeup codeword" as shown in a separate table. The 1011 MH code used for decoding is included in the "terminating codeword" indicating that the pixel of that color ends with this code, and the next pixel is black, It can be seen that it is sufficient to check whether or not the condition applies to the run length. When the collation is performed, it can be seen that 000011001000 having a run length of 128 corresponds, and that 128 black pixels are arranged. Also, this MH code is included in the "make-up code word" (indicating that one "terminating code word" of the same color follows next) as shown in the separate table, so the next pixel remains black, It can be seen that the run length of the code of the black run should be checked. Therefore, the decoded 00001100
By removing 1000 from the MH code sequence, the following code sequence 001101001100101010101 is obtained. Again, when it is checked which of the black run codes corresponds to which run length, it can be seen that 0011, which has a run length of 5, corresponds, and that the black pixels are lined up with 133 of 128 + 5. The MH code of 0011 is included in the “terminating codeword”, and it can be seen from this that the next pixel is white and the run length of the white run code should be checked. The correspondence between the arrangement of black and white pixels and the MH code string has been described above. In the following description, "terminating codeword" is abbreviated as T code, and "makeup codeword" is abbreviated as M code. The MH code decoder decodes the MH code and outputs the run length. The code length of the MH code is from 2 to 13. Therefore, it is sufficient to decode consecutive 13 bits at a time. Conventionally, in this type of MH code decoder, a continuous 13-bit code has been input as it is. FIG. 3 shows an example of a conventional MH code decoder. In the figure, a shift register 301 is a register for sequentially inputting a code string of an MH code to a decoding logic circuit 302. In the figure, the most significant bit is MSB and the least significant bit is LSB. The shift register 301 is 16 bits, and is latched by a latch signal 311 described later.
Latch the MH code 8 bits at a time. The held data is shifted one bit at a time in the LSB direction by a shift pulse 312 described later. The decoding logic circuit 302 is realized by using a read only memory (hereinafter, referred to as ROM). The decoding logic circuit 302 inputs the MH code 13 bits at a time from the shift register 301, inputs the run length to the run length integrator 303, 304
And outputs the code length to the code length integrator 310. The run length integrator 303 is a color inversion circuit 304
The run length is integrated until the color inversion signal 305 comes from. The color inversion circuit 304 receives a signal indicating the distinction between the T code and the M code from the decoding logic circuit 302, and outputs a color inversion signal 305 and a decoding logic selection signal 306 when detecting that the signal is a T code. The color inversion signal 305 is connected to the run length integrator 303 as described above. Further, the decoding logic selection signal 306 is output to the decoding logic circuit 302. The code length integrator 310 receives the code length from the decoding logic circuit 302 and generates the same number of shift pulses 312 as the code length. Further, the code length is integrated and a latch signal 311 is output every 8 bits. The operation of decoding the MH code in FIG. First,
The start signal (not shown) in the shift register 301 causes MH
Enter the sign 16 bits. It is assumed that the start is a white run.
The lower 13 bits of the input 16 bits are the decoding logic circuit
At 302, the run length, T code / M code, and code length are output. If the code is an M code, the color inversion signal 305
Becomes inactive, and the run length is also integrated in the next decoding. The decoding logic selection signal 306 is also inactive, and the next decoding is also a white run. If it is a T code, the color inversion signal 305 becomes active and the run length is newly added from the next decoding. Also, the decoding logic selection signal 306 becomes active, and the next decoding becomes a black run. Code length integrator 310
Generates the same number of shift pulses 312 as the code length, and the contents of the shift register 301 are shifted by the code length. Also,
When the latch signal 311 becomes active, the shift register 3
An 8-bit MH code is input to 01. The output of the run length integrator 303 when the code becomes the T code is the decoded data. In this example, since the run length is 2560 at the maximum from Table 1, the run length output to the run length integrator 303 is 12 bits, and the code length output to the code length integrator 310 is 4 bits. Therefore,
If the T code is represented by one bit, the output from the decoding logic circuit 302 is a total of 17 bits. At this time, if the decoding logic circuit 302 is configured by a ROM, the total number of bits is 2 14
× 17 = 272K bits. [Problems to be Solved by the Invention] As described above, in the conventional MH code decoder, when the decoding logic circuit is configured by ROM, the total number of bits is 2 14 ×
17 = 272 Kbits, and there is a problem that the amount of hardware is too large. Therefore, the object of the present invention is to use a small amount of hardware.
It is to realize an MH code decoder. [Means for Solving the Problems] The MH code decoder according to the present application performs MH decoding when decoding a white run.
Only 9 bits are read continuously from the beginning of the undecoded part of the code string of the code, and the MH code having a run length of 0 to 1728 of a white run having an MH code of 9 bits or less is decoded, and 11 bits are decoded. It has a decoding logic circuit consisting of one memory of 9-bit input, which outputs a detection signal without decoding the MH code having a run length of 1792 or more of the white run. Example Next, an example of the present invention will be described with reference to the drawings. First Embodiment FIG. 1 is a block diagram showing a first embodiment of the present invention. In the figure, a shift register 101 is a register that supplies a code sequence of an MH code to a decoding logic circuit 121, a decoding logic circuit 122, and a decoding logic circuit 123. MS is the upper side in the figure.
B, the lower side is LSB. The shift register 101 is 16 bits and latches the MH code 8 bits at a time by a latch signal 111 described later. The data inside is shifted one bit at a time in the LSB direction by a shift pulse 112 described later. In this embodiment, the decoding logic circuit 121 is a decoding logic circuit for a white run, the decoding logic circuit 122 is a decoding logic circuit for a black run and a black and white common run, and the decoding logic circuit 123 is a decoding circuit for a part of black runs. It is a chemical logic circuit. Each of the decoding logic circuit 121, the decoding logic circuit 122, and the decoding logic circuit 123 inputs the MH code from the shift register 101 by 9 bits and sets the run length, the T code / M code, and the code length. Output to the multiplexer 130. Also, the decoding logic circuit 122
Outputs a continuous zero detection signal. Multiplexer 130
Selects one of the pieces of information output from the three decoding logic circuits according to a decoding logic selection signal 132 described later, and sends the run length to the run length integrator 103 and the color inversion circuit 1
The T code / M code is output to 04, the code length is output to the code length integrator 110, and the continuous zero detection signal is output to the decoding logic selection circuit 131. The decoding logic selection circuit 131 outputs a decoding logic selection signal 132 to the multiplexer 130. The run length integrator 103 integrates the run length until the color inversion signal 105 from the color inversion circuit 104 comes. The color inversion circuit 104 includes the multiplexer 1
A signal representing the distinction between the T code and the M code is input from 30. When the signal is detected as a T code, a color inversion signal 105 and a decoding logic selection signal 132 are output. The code length integrator 110 receives the code length from the multiplexer 130 and generates the same number of shift pulses 112 as the code length. Further, the code length is integrated and a latch signal 111 is output every 8 bits. Next, the operation will be described. FIG. 4 shows an outline flow of the processing. A start signal not shown in the shift register 101 causes M
Input 16-bit H code. For the sake of simplicity, it is assumed that the beginning is a white run. The lower 9 bits of the input 16 bits are supplied to the decoding logic circuit 121, the decoding logic circuit 122, and the decoding logic circuit 123. Since the beginning is a white run, the output from the decoding logic circuit 121 is selected by the multiplexer 130. Here, from the relationship shown in the attached table, if the least significant consecutive 8 bits of the input 9 bits are "0000 00
If it is not 01 ", the decoding logic circuit 121 outputs the run length, the T code / M code, and the code length. If the code is M code, the color inversion signal 105 becomes inactive and the run length becomes It is also integrated in the next decoding, and the decoding logic selection signal
132 is also inactive and the next decryption will be a white run.
In the case of the T code, the color inversion signal 105 becomes active, and the run length is newly integrated from the next decoding. Also, the decoding logic selection signal 132 becomes active, and the next decoding becomes a black run. The code length integrator 110 generates the same number of shift pulses 112 as the code length, and the contents of the shift register 101 are shifted by the code length. When the latch signal 111 becomes active, the next 8-bit MH code is input to the shift register 101. The output of the run length integrator 103 when the code becomes the T code is the decoded data. If the least significant consecutive 8 bits of the input 9 bits are "0000 000
If "1", the decoding logic circuit 121 determines that the run length, T code /
Outputs a continuous zero detection signal in addition to the M code and code length. At this time, the run length is "0", the T code / M code is M code, and the code length is "4". The color inversion signal 105 becomes inactive, and the run length is integrated in the next decoding.
Further, the decoding logic selection circuit 131 receives the continuous zero detection signal and the color inversion signal 105 and outputs a decoding logic selection signal 132, and the next decoding is a white run, but a decoding logic circuit to be selected. To the decoding logic circuit 122. The code length integrator 110 generates the same number of shift pulses 112 as the code length, that is, four shift pulses. The contents of the shift register 101 are shifted by a predetermined bit of 4 bits. Next, the lower 9 bits from the shift register 101 are again decoded logic circuits 121, 122, and 123.
Enter. By the above operation, this time the decoding logic circuit 12
The output from 2 is selected by multiplexer 130. The following operation is the same as that described above. Next, consider the case of a black run. Shift register
9 bits of the MH code input from 101 are used as the decoding logic circuit 12
1. The decoding logic circuit 122 and the decoding logic circuit 123 are entered.
In the case of a black run, the least significant four consecutive bits out of the input 9 bits are "0000" in order from the LSB, according to the relationship shown in the attached table.
If not, the output from the decoding logic circuit 123 is selected by the multiplexer 130. The decoding logic circuit 123 outputs the run length, the T code / M code, and the code length. In this case, since the code is a T code, the color inversion signal 105 becomes active, and the run length is newly integrated from the next decoding. Also, the decoding logic selection signal 106 becomes active, and the next decoding is a white run. The code length integrator 110 generates the same number of shift pulses 112 as the code length, and the contents of the shift register 101 are shifted by the code length. When the latch signal 111 becomes active, the next 8-bit MH code is input to the shift register 101. The output of the run length integrator 103 is the decoded data. If the lowest 4 consecutive bits among the input 9 bits are “0000”, the decoding logic circuit 122 is selected. The decoding logic 122 includes a run length,
A detection signal of continuous zero is output in addition to the T code / M code and the code length. The run length at this time is “0”, T code / M
The code is M code and the code length is "4". The color inversion signal 105 becomes inactive, and the run length is integrated in the next decoding. Further, the decoding logic selection circuit 131 receives the continuous zero detection signal and the color inversion signal 105, outputs a decoding logic selection signal 106, and selects the decoding logic circuit to be selected because the next decoding is also a black run. It is instructed to switch to the decoding logic circuit 122 again. The code length integrator 110 generates the same number of shift pulses 112 as the code length, that is, four shift pulses. The contents of the shift register 101 are shifted by 4 bits. Next, the lower 9 bits from the shift register 101 enter the decoding logic circuit 121, the decoding logic circuit 122, and the decoding logic circuit 123 again. By the above operation, the output from the decoding logic circuit 122 is selected by the multiplexer 130 again this time. The following operations are the same as those described above. According to this embodiment, the input to the decoding logic may be 9 bits. Further, since the decoding logic circuit 123 only handles the case of a short black run, the decoding logic circuit 123 can be configured by a simple logic circuit. If the remaining two decoding logic circuits are to be constituted by ROM, the total number of bits is 2 9 × 17 × 2 = 17K bits. Even if the logic circuit of the decoding logic circuit 123 and the hardware of the multiplexer 130 and the decoding logic selection circuit 131 are added, the hardware amount of the ROM of 2 14 × 17 = 272 Kbits is far less. . Second Embodiment FIG. 2 is a block diagram showing a second embodiment of the present invention. In the figure, the input registers 241 and 242
Inputs an MH code in accordance with a latch signal 243 and a latch signal 244 described later. The barrel shifter 201 is a register that inputs a code string of the MH code to the decoding logic circuit 221, the decoding logic circuit 222, and the decoding logic circuit 223. The barrel shifter 201 has 16 bits, and the MH is controlled by a latch signal 211 described later.
A code string of codes is input from the input register 241 and the input register 242. In the figure, the upper part is the MSB and the lower part is the LSB. The data in the middle is shifted in the LSB direction by the number of bits indicated by the shift number 213 by a shift pulse 212 described later. In this embodiment, the decoding logic circuit 221 is a decoding logic circuit for a white run, the decoding logic circuit 222 is a decoding logic circuit for a black run and a black and white common run, and the decoding logic circuit 223 is a decoding for a part of black runs. It is a chemical logic circuit. Each of the decoding logic circuit 221, the decoding logic circuit 222, and the decoding logic circuit 223 inputs the MH code from the barrel shifter 201 by 9 bits, and sets the run length, the T code / M code, and the code length to a multiplexer. Output to 230. The decoding logic circuit 221 and the decoding logic circuit 222 output a continuous zero detection signal. The multiplexer 230 selects one of the pieces of information output from the three decoding logic circuits according to a decoding logic selection signal 232 described later, and sends the run length to the run length integrator 203 and the run length to the color inversion circuit 204. For the T code / M code, the code length is output to the code length integrator 210 and the continuous zero detection signal is output to the decoding logic selection circuit 231. Decoding logic selection circuit 23
1 outputs the decoding logic selection signal 232 to the multiplexer 230. The run length integrator 203 integrates the run length until a color inversion signal 205 from the color inversion circuit 204 is received. Color inversion circuit 204
Receives a signal representing the distinction between the T code and the M code from the multiplexer 230, and outputs a color inversion signal 205 and a decoding logic selection signal 206 when detecting a T code. The code length integrator 210 receives the code length from the multiplexer 230 and generates a shift pulse 212 and a shift number 213. Further, the code length is integrated and a latch signal 211 is output every 8 bits. In this embodiment, the operation of the code length integrator 210 is different from that of the first embodiment. The code length integrator 210 is connected to the multiplexer 2
When a code length is input from 30, a shift pulse 212 is generated. At this time, the shift number 213 is simultaneously output, and this value is given by the remainder of 8 of the integrated value of the code length. Further, it outputs the latch signal 211 to the barrel shifter 201 and outputs it to either the input register 241 or the input register 242. At this time, the latch signal 243 and the latch signal 244 are generated from the latch signal 211. In this embodiment, since the shift of the MH code is performed in one clock using the barrel shifter, there is an advantage that the processing is faster than in the first embodiment. [Effects of the Invention] As described above, according to the present invention, there is an effect that the amount of hardware of the MH code decoder can be reduced.

【図面の簡単な説明】 第1図は本発明の第1実施例を示すブロック図、 第2図は本発明の第2実施例を示すブロック図、 第3図は従来のMH符号復号器の例を示すブロック図、 第4図は第1実施例の処理の概要フローを示すフローチ
ャート図である。 101…シフトレジスタ、103…ラン長積算器、104…色反
転回路、105…色反転信号、110…符号長積算器、111…
ラッチ信号、112…シフトパルス、121,122,123…復号化
論理回路、130…マルチプレクサ、131…復号化論理選択
回路、132…復号化論理選択信号、201…バレルシフト、
203…ラン長積算器、204…色反転回路、205…色反転信
号、210…符号長積算器、211…ラッチ信号、212…シフ
トパルス、213…シフト数、221,222,223…復号化論理回
路、230…マルチプレクサ、231…復号化論理選択回路、
232…復号化論理選択信号、241,242…入力レジスタ、24
3,244…ラッチ信号。
BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is a block diagram showing a first embodiment of the present invention, FIG. 2 is a block diagram showing a second embodiment of the present invention, and FIG. FIG. 4 is a flow chart showing an outline flow of processing of the first embodiment. 101 shift register, 103 run length integrator, 104 color inversion circuit, 105 color inversion signal, 110 code length integrator, 111
Latch signal, 112: shift pulse, 121, 122, 123: decoding logic circuit, 130: multiplexer, 131: decoding logic selection circuit, 132: decoding logic selection signal, 201: barrel shift,
203: run length integrator, 204: color inversion circuit, 205: color inversion signal, 210: code length integrator, 211: latch signal, 212: shift pulse, 213: shift number, 221, 222, 223: decoding logic circuit, 230 ... Multiplexer, 231 ... Decoding logic selection circuit,
232: decoding logic selection signal, 241, 242: input register, 24
3,244 ... Latch signal.

Claims (1)

(57)【特許請求の範囲】 1.白ランの復号を行う際に、MH符号の符号列のまだ復
号していない部分を初めから連続して9ビットだけ読み
込み、9ビット以下のMH符号を有する白ランのラン長が
0から1728までのMH符号の復号を行い、11ビット以上の
白ランのラン長が1792以上のMH符号を復号しないで検出
信号を出力する、9ビット入力の1つのメモリからなる
復号化論理回路を含むことを特徴とするMH符号復号器。
(57) [Claims] When decoding a white run, the undecoded part of the code sequence of the MH code is read only 9 bits continuously from the beginning, and the run length of the white run having the MH code of 9 bits or less is from 0 to 1728. A decoding logic circuit consisting of one memory of 9-bit input for decoding a MH code and outputting a detection signal without decoding an MH code having a white run of 11 bits or more and a run length of 1792 or more. Characteristic MH code decoder.
JP62105825A 1987-04-28 1987-04-28 MH code decoder Expired - Lifetime JP2833743B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP62105825A JP2833743B2 (en) 1987-04-28 1987-04-28 MH code decoder

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP62105825A JP2833743B2 (en) 1987-04-28 1987-04-28 MH code decoder

Publications (2)

Publication Number Publication Date
JPS63269833A JPS63269833A (en) 1988-11-08
JP2833743B2 true JP2833743B2 (en) 1998-12-09

Family

ID=14417836

Family Applications (1)

Application Number Title Priority Date Filing Date
JP62105825A Expired - Lifetime JP2833743B2 (en) 1987-04-28 1987-04-28 MH code decoder

Country Status (1)

Country Link
JP (1) JP2833743B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2833112B2 (en) * 1990-03-02 1998-12-09 日本電気株式会社 Change point detection circuit

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5579565A (en) * 1978-12-12 1980-06-16 Fujitsu Ltd Picture signal decoding system

Also Published As

Publication number Publication date
JPS63269833A (en) 1988-11-08

Similar Documents

Publication Publication Date Title
US5142283A (en) Arithmetic compression coding using interpolation for ambiguous symbols
JP3108479B2 (en) Encoding / decoding method and apparatus therefor
KR900001821B1 (en) Processor for compressing and expanding binary data
JP2766302B2 (en) Variable length code parallel decoding method and apparatus
KR100241792B1 (en) Method and apparatus for encoding and decoding image data
JP3409552B2 (en) Digital information encoding device, digital information decoding device, and digital information encoding / decoding device
JP3621512B2 (en) Digital information encoding apparatus, digital information decoding apparatus, digital information encoding / decoding apparatus, digital information encoding method, and digital information decoding method
JPS59178077A (en) Method for compressing data of binary picture
JP2962518B2 (en) Image data encoding device
EP0349677B1 (en) Image coding system
US3984833A (en) Apparatus for encoding extended run-length codes
JP2833743B2 (en) MH code decoder
KR880002075A (en) Binary data compression and decompression processing device
US7085415B2 (en) Image display apparatus
JPH11317673A (en) Run-length encoding method and decoding method
JPH05151349A (en) Image data compression method and encoding circuit
JP3029863B2 (en) Compressed data decoding device
JPS6341271B2 (en)
JPH04270569A (en) Data compression system for picture processor
JP2606336B2 (en) EOL code search circuit
JP2615215B2 (en) Image data compression method
KR900007566B1 (en) Image data conversion device and method
JPH07236065A (en) Binary image compression device
JP2556160B2 (en) Compression code decompression device
JPH04213222A (en) Decoding circuit for unequal length code data