JPH0584697B2 - - Google Patents

Info

Publication number
JPH0584697B2
JPH0584697B2 JP59114837A JP11483784A JPH0584697B2 JP H0584697 B2 JPH0584697 B2 JP H0584697B2 JP 59114837 A JP59114837 A JP 59114837A JP 11483784 A JP11483784 A JP 11483784A JP H0584697 B2 JPH0584697 B2 JP H0584697B2
Authority
JP
Japan
Prior art keywords
code
decoding
eol
compressed
signal
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
JP59114837A
Other languages
Japanese (ja)
Other versions
JPS60257669A (en
Inventor
Kazutoshi Hisada
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.)
Canon Inc
Original Assignee
Canon 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 Canon Inc filed Critical Canon Inc
Priority to JP59114837A priority Critical patent/JPS60257669A/en
Publication of JPS60257669A publication Critical patent/JPS60257669A/en
Publication of JPH0584697B2 publication Critical patent/JPH0584697B2/ja
Granted legal-status Critical Current

Links

Description

【発明の詳細な説明】[Detailed description of the invention]

本発明はフアクシミリや画像電子フアイル等に
用いられる帯域圧縮符号化による圧縮コードの復
号装置に関するものである。 従来のフアクシミリ等の画像伝送装置や近年の
光デイスクや磁気デイスク等を用いた画像フアイ
ル装置等においては、画像データを圧縮して取扱
うことにより、データ量を減少せしめ伝送或いは
蓄積動作の高速化、効率化を計つている。 かかる画像圧縮とは、いわゆるコード変換操作
の一種であり、代表的な圧縮方法であるモデイフ
アイド・ホフマン(MH)符号化について言え
ば、画像中の連続した白又は黒画素のビツトブロ
ツクを別の圧縮コードに対応させて表現するもの
である。この際、発生頻度の高い画素ビツトブロ
ツクに対しては短いコード長の圧縮コードを対応
させ、一方、発生頻度の低い画素ビツトブロツク
に対しては長いコード長の圧縮コードを対応させ
ることにより、画素の組合せの発生頻度の偏りを
利用し画像全体をより少ないビツト数の別のコー
ド列で表現するものである。 ところで、この画素ビツトブロツクに対する圧
縮コードの対応は経験則に基づいて決められたも
のであり、また、その圧縮コードのコード長は不
揃いなものである。 また、MH符号化の規約として、1ライン毎の
画像の同期又は区切りを示すために、EOL(エン
ド・オブ・ライン)符号が、上記圧縮符号ととも
に用いられる。そして、受信側の装置ではこの
EOL符号に基づきライン同期をとる構成が一般
的に用いられている。従つて、何らかの原因によ
り、ラインの途中、或いは、ある符号の途中から
のデータが復号回路に伝達された場合には、復号
回路ではその後に入力するEOL符号を検出し、
検出動作に従つて、復号動作を開始する。この様
に、EOL符号は復号動作に重要な機能を果すも
のであり、もし、EOL符号の検出が誤つてなさ
れると、それに続く復号動作に乱れを生じ、正確
な画像再現がなされないことになる。 本発明は以上の点に鑑みてなされたもので、記
憶手段に記憶されるEOLコード以外の圧縮コー
ドをEOLコードとして誤判別することなく、
EOLコードを正確に検出して、圧縮コードの復
号動作の同期合わせを確実になすことを目的と
し、詳しくは、画像の各ラインの終了を示す
EOLコードを含む不定長の圧縮コードを順次復
号する圧縮コードの復号装置において、連続して
入力する圧縮コードを複数連続して記憶する記憶
手段と、前記記憶手段に記憶されている複数の圧
縮コードをシフトすることにより次に復号すべき
圧縮コードを前記記憶手段の所定位置にセツトす
るシフト手段と、前記記憶手段の所定位置にセツ
トされた圧縮コードを復号することによりラン長
データ及び圧縮コードのコード長データを出力す
る復号手段と、前記復号手段から出力された前記
コード長データに従つて前記シフト手段により実
行される複数の圧縮コードのシフト量を制御する
シフト制御手段と、前記記憶手段に前記EOLコ
ードが存在しているか否かを検出する検出手段
と、前記検出手段による前記EOLコードの検出
に基づいて前記復号手段により前記EOLコード
に続く圧縮コードを復号せしめる復号制御手段
と、前記記憶手段への圧縮コードの記憶に先立つ
て前記記憶手段に、それ自体前記EOLコードと
して検出されず、且つ、他の圧縮コードと組合わ
さつたとしても前記EOLコードとして検出され
ない特定データを格納せしめる格納手段とを有す
る圧縮コードの復号装置を提供するものである。 本発明の詳細な説明を以下に述べる。 まず、本発明の実施例の概要を第1図に示す回
路ブロツク図を用いて説明する。 第1図において101は記憶回路であり、例え
ば画像を光電的に読取るリーダや画像をフアイル
する電子フアイル、或いは電話線等の伝送路を介
して画像情報を受信する受信機等から入力された
既に別途手段を用いて画像信号を圧縮符号化する
ことにより得た謂る、MH(モデイフアイド・ホ
フマン)コードを、16ビツト(1ワード)単位
で順次読出し可能な形で記憶している回路で、例
えばRAM(ランダム・アクセス・メモリ)又は
ラツチ回路等により実現できる回路である。又、
記憶回路101に於けるMHコードの記憶形式
は、第2図aに一例を示す如くである。即ち、
MHコード本来の性質としてそのコード長は不揃
い(最小2ビツト〜最大13ビツト)であるが、コ
ード長に拘らず、1ビツトの空もなく、第2図b
の如くシリアルに連ねたビツト列を16ビツト毎に
並列に交換して並べた形式である。第2図bにお
いて、WB及びBBは夫々白及び黒画素を示す
MHコードで、WB及びBBの後の数字はそのコ
ードの示すランレングスを表わしており、例え
ば、WB8はランレングス8の白を示すMHコー
ドである。この形式に於いてMHコードの区切り
とワード(16ビツト)の区切りとは必ずしも一致
していない。又、記憶回路101は外部コントロ
ールに依り、後続のワードを順次、パラレル出力
できる機能を有するものである。 第1図において102は謂ゆるマルチ・プレク
サ(データ・セレクタ)である。また、103は
28ビツト並列入力及び出力を有するレジスタであ
り、記憶回路101から、マルチ・プレクサ10
2を経て、レジスタ103の入力側に与えられる
MHコードを一時記憶する機能及び既にレジスタ
103に記憶しているMHコードを出力として後
述するMHコード・デコード・ロジツク104及
びMHコード・デコード・テーブルROM(リー
ド・オンリ・メモリ)105等に与える役割りを
有する。 マルチ・プレクサ102及びレジスタ103と
でデータのシリアル・シフト及びnビツトのジヤ
ンプ・シフトが可能な謂ゆるビツト・シフタを形
成する。このビツト・シフタは後述するMHコー
ド・デコード・ロジツク104及びMHコード・
デコードRM105の出力等によりコントロー
ルされ、前述の方法によりMHコードの境目に拘
りなく記憶回路101がレジスタ103内に記憶
されたMHコードを必要なビツト数だけシフトし
記憶する機能を果すものである。第3図(詳細は
後述する)はこのビツトシフタの詳細な構成を示
す図であり、レジスタ103内に例示されたMH
コード列は第1図示の記憶回路101内に例示し
たMHコードが適切なコントロールを経て、レジ
スタ103内に移動し、更に白のランレングス8
を示すMHコードWB1(10011)がデコード可能
な位置に来た状態を図示している。即ち第3図示
のレジスタ103の出力C0、即ち、LSB出力に
MHコードの先頭ビツトが出力されている状態を
デコード可能な位置とし、今後「頭出し完了」と
称する。従つて第3図レジスタ103内のコード
の配列は白のランレングス8を示すMHコード
WB8が「頭出し完了」の状態にある事を示して
いる。 第1図において104はMH・コード・デコー
ド・ロジツク(以下ロジツク104と称する)で
あり、MHコードのコード長よりMHコードの示
すランレングスの方が短い以下の4種のコード、
即ち、白のランレングス1(MHコードで
000111、コード長=6>ランレングス=1)、白
のランレングス2(MHコードで0111、コード長
=4>ランレングス=2)、白のランレングス3
(MHコードで1000、コード長=4>ランレング
ス=3)及び黒のランレングス1(MHコードで
010、コード長=3>ランレングス=1)をデコ
ードする回路である。尚、以下の説明中、白のラ
ンレングス1、白のランレングス2、白のランレ
ングス3及び黒のランレングス1を夫々示す上述
の4種のMHコードをまとめてHSCコードと呼
ぶことにする。 第1図において105はMH・コード・デコー
ド・RM(以下RM105と称する)であり、
前述のロジツク104がデコードを受持つ4種の
MHコードを含む全てのMH・コードを主として
デコードする回路である。 ロジツク104及びROM105はMHコード
の処理スピード、及び方法の違いにより、デコー
ドを受け持つMHコードを区分しているのである
が、これら2つのデコーダによりレジスタ103
においてMHコードが「頭出し完了」する毎に、
該MHコードのランレングス、コード長及び黒又
は白の画像の色の別、そしてメイク・アツプ・コ
ード又はターミネイト・コードの別、あるかない
か等の出力をするものである。 112はEOL検出回路で、レジスタ103に
ビツトシリアルに格納されたMHコード中にライ
ン同期のためのコード、即ち、エンドオブライン
(EOL)コードが存在するか否か及びその格納位
置を検出する。 第1図において108はランレングス・カウン
タでカウント数“0”から最大のメイク・アツ
プ・コードのランレングス、即ち“2560”以上の
カウントが可能なバイナリ・カウンタである。こ
のランレングス・カウンタ108はロジツク10
4又はROM105から出力されるMHコードの
ランレングスをカウントし終える毎にカウント終
了信号(本例ではカウンタのリツプル・キヤリ
CR)を出力する。 109はフリツプ・フロツプであり、前述のラ
ンレングス・カウンタ108からのカウント終了
信号(リツプル・キヤリCR)を受けて、その度
毎に出力を反転させる。但し、後述するようにメ
イク・アツプ・コードのカウント終了信号では該
出力は反転しないように制御される。このフリツ
プ・フロツプ109の出力が記憶回路101から
読出したMHコードをデコードして得られた画像
信号である。 107はコード・レングス・カウンタでMH・
コードの最大コード長である“13”以上をカウン
トできるバイナリ・カウンタでレジスタ103内
において「頭出し完了」していたMH・コードを
シリアルシフト或いはジヤンプ・シフトする事に
よつて、デコード済コードとして103レジスタ
から掃出してしまい、後続するMHコードを「頭
出し完了」の位置へシフトする際に、そのシフト
量をカウントし制御するものである。 106は4ビツトのアキユミユレータである。
上述したようにレジスタ103内に記憶回路10
1から取込まれたMHコードはデコード済となる
と順次レジスタ103から掃出され、これによ
り、レジスタ103内に空ビツトができる。そこ
でアキユミユレータ106がレジスタ103内の
空ビツトの数をカウントし、16ビツトの空ビツト
ができる毎に新たなMHコードを記憶回路101
から1ワード(16ビツト)パラレルにレジスタ1
03内の空ビツトへ補充する。これによりレジス
タ103からロジツク104又はRM105へ
与えるMHコードの列が途切れないように制御
し、高速なデコード動作を可能とする。 尚、110は第1図示のブロツク101〜10
9間の入出力信号を制御する制御回路を図示した
ものである。 以上の如くしてMHコードを画像信号へ変換、
即ちMHコードの復号がなされる。復号された画
像信号はプリンタ111に供給され、被記録材上
に画像記録がなされる。尚、プリンタ111から
は1走査毎の同期信号である水平同期信号
HSYNCが出力され、このHSYNCは複号動作の
タイミングに用いられる。 次に本発明の実施例を更に具体的に説明する。
本実施例は、画像圧縮符号であるMHコードを複
号した結果である画像信号を何らの画像メモリを
設けることなくレーザ・ビーム・プリンタ等の高
速プリンタに直接出力するのに使用する謂ゆる
“高速・リアル・タイム・MH・デコーダ”を提
供するものである。従つて、MH・デコーダの処
理速度の高速性及びMH・デコーダの画像出力
(本例は画像周波数=+数MHzを想定)とレー
ザ・ビーム・プリンタ等の高速プリンタとの同期
の問題が解決されねばならない。そこで、これら
の問題点を解決する為に、以下に述べる処理方法
に基き所望の“高速・リアル・タイム・MH・デ
コーダ”を実現する。 (1) MH・デコーダとプリンタの同期はMHコー
ドのELとプリンタの1ライン毎の同期信号
である水平同期信号とで行なう。 (2) 第1図レジスタ103内において「頭出し完
了」してデコード済となつたMHコードを掃出
し、後続のMHコードを「頭出し完了」の位置
までシフトする方法として、掃出すべきコード
によつてジヤンプシフト及びシリアルシフトの
2種類の方法のうちのどちらかを使用するよう
にする。 この2点を達成するための具体的な構成を図面
を用いて説明する。 第8図は第1図に出力部の例として示したレー
ザ・ビーム・プリンタの一実施例の構成を示す斜
視図である。 このプリンタはレーザ光を用いた電子写真方式
によるものであり、201はハウジングHa内に
可回動に支持された感光ドラムである。202は
レーザ光Laを出射する半導体レーザであり、出
射されたレーザ光Laはビームエキスパンダ20
3に入射せしめられ、所定のビーム径をもつたレ
ーザ光となる。更にレーザ光は鏡面を複数個有す
る多面体ミラー204に入射される。多面体ミラ
ー204は定速回転モータ205により所定速度
で回転される。多面体ミラー204によつてビー
ムエキスパンダ203より出射したレーザ光は実
質的に水平に走査される。そしてf−θ特性を有
する結像レンズ206により、帯電器213によ
り所定の極性に帯電されている感光ドラム201
上にスポツト光として結像される。 207は反射ミラー208によつて反射された
レーザ光を検知するビーム検出器で、この検出信
号により感光ドラム201上に所望の光情報を与
えるため半導体レーザ202の変調動作のタイミ
ングを決定する。 感光ドラム201上に結像走査されたレーザ光
により感光ドラム201上に高解像度の静電潜像
が形成される。この潜像は現像器209により顕
画化された後、カセツト210,211のいずれ
かに収納されている記録材に転写され、更に定着
器212を記録材が通ることにより像は記録材に
定着されハードコピーとして不図示の排出部に排
出される。 第9図に第8図の半導体レーザを所定の画像信
号により変調するためのプリンタ回路の一実施例
を示す。 複号処理されて入力端子INから入力された画
像信号VIDEOは1走査分の画像信号群毎に少な
くとも1走査分の画素数に等しい数のビツト数を
持つシフトレジスタ等からなる第1ラインバツフ
ア301及び第2ラインバツフア302に、バツ
フアスイツチ制御回路303の制御により交互に
入力される。 更に、第1ラインバツフア301及び第2ライ
ンバツフア302に入力された画像信号はビーム
検出器304からのビーム検出信号をトリガ信号
として1走査分毎に交互に読出され、レーザドラ
イバ305に加えられる。 レーザドライバ305はレーザ光の発光を制御
すべく入力した画像信号に基づき反導体レーザ3
06を変調制御する。 ラインバツフアを2個有することにより次々に
入力される画像信号をいずれかのラインバツフア
に入力している間に他方のラインバツフアに既に
格納されている画像信号をレーザドライバ305
に出力するので高速な画像信号の入力に対応可能
である。 又、ビーム検出器304からのビーム検出信号
は水平同期信号HSYNCとして複号処理回路にも
伝達され、後述の如く複号処理とプリンタ動作と
の同期合せに用いられる。 尚、本プリンタにおいて複号化された画像信号
は2つのラインバツフア、即ち、第1ラインバツ
フア301及び第2ラインバツフア302による
ダブルバツフア構成のバツフアを介して入力され
る。このダブルバツフア構成を用いて復号動作に
誤まりがあつた場合の補正動作を行なう。つま
り、復号回路により復号された画像信号を一方の
ラインバツフアに格納中、復号動作に誤まりを生
じた場合、誤まりのあつた現ラインの画像信号に
よるプリント動作を禁止し、他方のラインバツフ
アに既に格納されている前ラインの画像信号によ
りプリント動作する。 これにより、復号誤まりのあつた画像信号によ
るプリントがなされないので、再生画像への影響
を除去できる。尚、この補正動作により同一画像
信号による画像が少なくとも2ライン重復してし
まうことになるが、本例に用いた高解像度(例え
ば16pel/mm)の記録動作においては再生画像に
それほど影響を与えるものではない。 第4図において105は第1図示のMH・コー
ド・テーブルROMであり、実際には複数個のR
OM(リード・オンリ・メモリ)により構成され
るものである。以下にRM105の内容を模式
的に説明すると、AD0〜AD13はRM10
5のアドレス端子である、又0〜011はR
M105の出力端子である。ROM105の記憶
内容のフオーマツトはレジスタ103から供給さ
れるデコードすべきMHコードのLSBビツトをR
OM105のアドレス端子AD0にそろえ以下各
MHコードの各ビツトをMSB方向へ順次ROM1
05のアドレス端子のAD1からAD11までに
与える。アドレス端子AD13にはMHコードの
色別を示す信号B/−ROM(黒=1、白=0)
を与えるものとする。尚、MHコードが12ビツト
より短い場合はその不足分のビツトは無視
(DONT CARE)する。又、ELコードはメ
イクアツプコードとして扱う。又ランレングス1
792以上のメイクアツプコードの色別ビツト
(AD13)は無視(DON'T CARE)とする。 ROM105には、以上によつて決めたアドレ
スの記憶データとして各アドレスを与えたMHコ
ードの内容を書き込んでおき、各MHコードに対
応した出力を出力端子O0〜O11に出力する。
即ち、出力端子0はデコードしたMHコードが
メイクアツプコードのときに「1」、ターミネイ
トコードのときに「0」となる信号M/を出力
する。出力端子1はデコードしたMHコードが
ランレングス0の白コード(00110101)又はラン
レングス0の黒コード(0000110111)のときに
「0」を出力し、その他の時「1」となる信号
TOを出力する。 出力端子2〜5は各MHコードのコード長
(ビツト数)を2の補数表現した形式の4ビツト
出力CL0〜CL3を出力する。但し、出力端子
5は該コード長のLSBである。出力端子6〜
O11は各MHコードのランレングスを2の補数
表現した形式の6ビツト出力RL0〜RL5を出力
する。但し、出力端子11は該ランレングスの
LSBである。尚、メイク・アツプ・コードに対
してはランレングスの2進数表現の上位6ビツト
のみを出力端子6〜11に割当てる。これは
MHコードにおけるメイクアツプコードは上位6
ビツトのみでもそのランレングスを表現できるか
らである。第4図の402にランレングス8の白
を示すMHコードWB8(10011)をデコードした
場合のROM105の出力0〜11を例示す
る。(本実施例に用いるMHコード表はCCITT
YELLOW−BK Fascicle .2 Rec.
T.4 TABLE 1/T.4及びTABLE 2/T.4によ
る。) 第4図において104は第1図示のMHコー
ド・デコード・ロジツクであり、本実施例ではア
ンドゲート及びオアゲートにより構成した検出ロ
ジツクである。ロジツク104の出力である
HSC信号はコード、即ち、ランレングス1,
2及び3の白を示すMHコード及びランレングス
1の黒を示すMHコードを検出した時「0」とな
る。また、出力0〜2は上述の4種のMHコ
ード(HSCコード)の各々のコード長を2進数
で表現し、インバートして出力したものである。
第4図404にランレングス1の白を示すMHコ
ード白1WD1(000111)をデコードした場合の出
力を例示する。 尚、HSCコードのデコード用にロジツク回路
を用いたのは高速処理のために現在のROMアド
レス方式では時間的に充分対応できないからであ
る。 第3図示のビツトシフタの動作を表1及び表2
を参照して説明する。 第3図102は第1図示のマルチプレクサであ
り、2個のトライステートのマルチプレクサ10
21及び1022からなる。マルチプレクサ10
2へのアキユミユレータ106からの制御線が
「0」のときはマルチプレクサ1022側からレ
ジスタ103への出力A7〜A27はすべて、トライ
ステートのフローテイングとなることにより、無
効となり、レジスタ103にはマルチプレクサ1
021側からの出力A0〜A27が有効となり、レジ
スタ103の出力C0〜C27となる。その時マルチ
プレクサ1021は入力線S0〜S2によりレジスタ
103からの入力信号C0〜C27の選択動作をする。
その選択のされ方を表1に示す。例えばS0=S1
1、S2=0の場合はレジスタ103の出力C3
C27を取り込み、夫々出力A0〜A24として選択出
力する。 次にマルチプレクサ102への制御線が
「1」の時は、マルチプレクサ102の出力A0
A6は制御線が「0」の時と同じにマルチプレ
クサ1021から入力線S0〜S2により選択的に与
えられる。マルチプレクサ102からの出力A7
〜A27のうち表2でYで示す以外はマルチプレク
サ1022側が有効となり、マルチプレクサ10
21側の出力A7〜A27のうち表2でYで示す以外
はフローテイングとなり無効となる。又、マルチ
プレクサ1022からレジスタ103に与えられ
る出力A7〜A27は表2に示す如く、マルチプレク
サ1022への入力線Σ0〜Σ2により選択される
が、但し、表2においてYで示すビツトはマルチ
プレクサ1021側から選択される。このYの数
はマルチプレクサ1022への入力線Σ0〜Σ2
対応して出力される入力線ST7〜ST11により
マルチプレクサ1021のトライステート状態を
コントロールすることにより設定される。なお、
第3図のマルチプレクサ1021及び1022の
回路は市販のマルチプレクサ(例えば米国フエア
チヤイルド社製IC.F251等)及びゲート回路等に
より容易に実現できる。又、マルチプレクサ10
2においてレジスタ103への出力としてA0
A27に選択された出力はクロツクCKによりレジ
スタ103にラツチされる。 以上の様にビツト・シフタを構成し、記憶回路
101より16ビツトパラレルに入力するMHコー
ド信号に対する任意のビツト数分のシフトを可能
とする。これにより、コード長の不揃いなMHコ
ードを前述の「頭出し完了」状態にすることがで
きる。
The present invention relates to a decoding device for compressed codes using band compression encoding used for facsimiles, image electronic files, and the like. In conventional image transmission devices such as facsimiles and recent image file devices using optical disks and magnetic disks, image data is compressed and handled to reduce the amount of data and speed up transmission or storage operations. We are trying to improve efficiency. Such image compression is a type of so-called code conversion operation, and in the case of Modified Hoffman (MH) encoding, which is a typical compression method, bit blocks of continuous white or black pixels in an image are converted to a different compression code. It is expressed in correspondence with . At this time, pixel combinations are created by associating compressed codes with short code lengths with pixel bit blocks that occur frequently, and by associating compressed codes with long code lengths with pixel bit blocks that occur less frequently. This method utilizes the bias in the frequency of occurrence to express the entire image using a different code string with a smaller number of bits. Incidentally, the correspondence of compressed codes to pixel bit blocks is determined based on empirical rules, and the code lengths of the compressed codes are irregular. Further, as a rule of MH encoding, an EOL (end of line) code is used together with the above compression code to indicate synchronization or separation of images on a line-by-line basis. Then, on the receiving device, this
A configuration in which line synchronization is performed based on EOL codes is generally used. Therefore, if data from the middle of a line or from the middle of a certain code is transmitted to the decoding circuit for some reason, the decoding circuit detects the EOL code that will be input afterwards,
According to the detection operation, a decoding operation is started. In this way, the EOL code plays an important function in the decoding operation, and if the EOL code is detected incorrectly, the subsequent decoding operation will be disrupted and accurate image reproduction will not be possible. Become. The present invention has been made in view of the above points, and it is possible to avoid erroneously identifying compressed codes other than EOL codes stored in a storage means as EOL codes.
The purpose is to accurately detect the EOL code and ensure synchronization of the decoding operation of the compressed code.
A compressed code decoding device that sequentially decodes compressed codes of undefined length including an EOL code, comprising a storage means for successively storing a plurality of compressed codes that are input continuously, and a plurality of compressed codes stored in the storage means. a shift means for setting the compressed code to be decoded next at a predetermined position in the storage means by shifting the run length data and the compressed code by decoding the compressed code set in the predetermined position in the storage means; a decoding means for outputting code length data; a shift control means for controlling a shift amount of a plurality of compressed codes executed by the shifting means according to the code length data output from the decoding means; a detection means for detecting whether or not the EOL code exists; a decoding control means for causing the decoding means to decode the compressed code following the EOL code based on the detection of the EOL code by the detection means; and the memory. Storage means for storing in the storage means, prior to storing the compressed code in the means, specific data that is not detected as the EOL code by itself and that is not detected as the EOL code even when combined with another compressed code. The present invention provides a compressed code decoding device having the following. A detailed description of the invention follows. First, an outline of an embodiment of the present invention will be explained using the circuit block diagram shown in FIG. In FIG. 1, reference numeral 101 denotes a memory circuit, for example, a reader that photoelectrically reads images, an electronic file that files images, or a receiver that receives image information via a transmission path such as a telephone line. A circuit that stores a so-called MH (Modified Hoffman) code obtained by compressing and encoding an image signal using a separate means in a form that can be read out sequentially in units of 16 bits (1 word), for example. This is a circuit that can be implemented using RAM (random access memory) or a latch circuit. or,
An example of the storage format of the MH code in the storage circuit 101 is shown in FIG. 2a. That is,
The inherent nature of the MH code is that its code length is uneven (minimum 2 bits to maximum 13 bits), but regardless of the code length, there is no empty bit, and the length is as shown in Figure 2b.
This is a format in which serially connected bit strings are exchanged in parallel every 16 bits. In Figure 2b, WB and BB indicate white and black pixels, respectively.
In the MH code, the numbers after WB and BB represent the run length of the code; for example, WB8 is an MH code that represents white with a run length of 8. In this format, the MH code delimiter and the word (16 bit) delimiter do not necessarily match. Furthermore, the memory circuit 101 has a function of outputting subsequent words sequentially in parallel under external control. In FIG. 1, 102 is a so-called multiplexer (data selector). Also, 103 is
It is a register having 28-bit parallel input and output, and is connected from the storage circuit 101 to the multiplexer 10.
2 and is applied to the input side of register 103.
The function of temporarily storing the MH code and the role of outputting the MH code already stored in the register 103 to the MH code decode logic 104 and MH code decode table ROM (read-only memory) 105, etc., which will be described later. It has properties. The multiplexer 102 and the register 103 form a so-called bit shifter capable of serially shifting data and n-bit jump shifting. This bit shifter is connected to the MH code decode logic 104 and the MH code decode logic 104, which will be described later.
Controlled by the output of the decode RM 105, etc., the storage circuit 101 functions to shift and store the MH code stored in the register 103 by the required number of bits, regardless of the boundary between the MH codes, using the method described above. FIG. 3 (details will be described later) is a diagram showing the detailed configuration of this bit shifter.
In the code string, the MH code illustrated in the storage circuit 101 shown in the first diagram is moved to the register 103 through appropriate control, and then the white run length 8
The diagram shows a state in which the MH code WB1 (10011) indicating the MH code WB1 (10011) has reached a decodable position. That is, the output C0 of the register 103 shown in the third diagram, that is, the LSB output.
The state in which the first bit of the MH code is output is defined as a decodable position, and will be referred to as ``completion of cueing'' from now on. Therefore, the code arrangement in the register 103 in FIG. 3 is an MH code indicating a white run length of 8.
This shows that WB8 is in the "cueing complete" state. In FIG. 1, 104 is an MH code decode logic (hereinafter referred to as logic 104), and the following four types of codes have a run length shorter than the code length of the MH code.
i.e. white run length 1 (in MH code)
000111, code length = 6 > run length = 1), white run length 2 (0111 in MH code, code length = 4 > run length = 2), white run length 3
(1000 for MH code, code length = 4 > run length = 3) and black run length 1 (for MH code
010, code length=3>run length=1). In the following explanation, the above four types of MH codes that indicate white run length 1, white run length 2, white run length 3, and black run length 1 will be collectively referred to as the HSC code. . In FIG. 1, 105 is an MH code decode RM (hereinafter referred to as RM105),
The above-mentioned logic 104 handles the decoding of four types.
This circuit mainly decodes all MH codes including MH codes. The logic 104 and the ROM 105 are responsible for decoding the MH code, which is divided into sections depending on the processing speed and method of the MH code.
Every time the MH code completes cueing,
It outputs the run length of the MH code, the code length, whether the image is black or white, whether it is a make-up code or a termination code, and whether it is present or not. Reference numeral 112 denotes an EOL detection circuit which detects whether or not a code for line synchronization, that is, an end-of-line (EOL) code exists in the MH code stored in bit serial form in the register 103, and the location where the code is stored. In FIG. 1, reference numeral 108 is a run length counter, which is a binary counter capable of counting from the count number "0" to the maximum make-up code run length, that is, "2560" or more. This run length counter 108 is a logic 10
4 or every time the run length of the MH code output from the ROM 105 is finished counting, the count end signal (in this example, the ripple/carry signal of the counter
CR) is output. A flip-flop 109 inverts its output each time it receives a count end signal (ripple/carry CR) from the run-length counter 108 mentioned above. However, as will be described later, the output is controlled so as not to be inverted by the count end signal of the make-up code. The output of flip-flop 109 is an image signal obtained by decoding the MH code read from memory circuit 101. 107 is the chord length counter.
By serially or jump shifting the MH code that has been "cueing completed" in the register 103 with a binary counter that can count over "13", which is the maximum code length of the code, it can be converted into a decoded code. When the MH code is swept out from the 103rd register and the subsequent MH code is shifted to the "cue completion" position, the shift amount is counted and controlled. 106 is a 4-bit accumulator.
As described above, the memory circuit 10 is stored in the register 103.
When the MH code taken in from 1 is decoded, it is sequentially flushed out from the register 103, thereby creating an empty bit in the register 103. Therefore, the accumulator 106 counts the number of empty bits in the register 103, and stores a new MH code in the memory circuit 101 every time 16 empty bits are created.
1 word (16 bits) from register 1 in parallel.
Replenish the empty bits in 03. This controls the MH code sequence fed from the register 103 to the logic 104 or RM 105 so as not to be interrupted, thereby enabling high-speed decoding operation. In addition, 110 is the blocks 101 to 10 shown in the first diagram.
9 is a diagram illustrating a control circuit that controls input/output signals between 9 and 9. Convert the MH code to an image signal as described above,
That is, the MH code is decoded. The decoded image signal is supplied to the printer 111, and the image is recorded on the recording material. Note that the printer 111 outputs a horizontal synchronization signal, which is a synchronization signal for each scan.
HSYNC is output, and this HSYNC is used for the timing of the decoding operation. Next, embodiments of the present invention will be described in more detail.
This embodiment uses a so-called "" It provides a high-speed, real-time, MH decoder. Therefore, the problems of high processing speed of the MH/decoder and synchronization of the image output of the MH/decoder (in this example, the image frequency is assumed to be + several MHz) with a high-speed printer such as a laser beam printer are solved. Must be. Therefore, in order to solve these problems, we will realize the desired "high-speed, real-time, MH decoder" based on the processing method described below. (1) Synchronization between the MH decoder and the printer is performed using the EL of the MH code and the horizontal synchronization signal, which is a synchronization signal for each line of the printer. (2) In the register 103 in FIG. 1, the MH code that has been decoded with "cueing completed" is swept out, and the subsequent MH code is shifted to the "cueing completed" position. Therefore, one of two methods is used: jump shift and serial shift. A specific configuration for achieving these two points will be explained using the drawings. FIG. 8 is a perspective view showing the configuration of one embodiment of the laser beam printer shown as an example of the output section in FIG. 1. This printer uses an electrophotographic method using laser light, and 201 is a photosensitive drum rotatably supported within a housing Ha. 202 is a semiconductor laser that emits laser light La, and the emitted laser light La is transmitted to the beam expander 20.
3 and becomes a laser beam with a predetermined beam diameter. Further, the laser beam is incident on a polyhedral mirror 204 having a plurality of mirror surfaces. The polyhedral mirror 204 is rotated at a predetermined speed by a constant speed rotation motor 205. The laser light emitted from the beam expander 203 is scanned substantially horizontally by the polyhedral mirror 204. The photosensitive drum 201 is charged to a predetermined polarity by a charger 213 using an imaging lens 206 having f-θ characteristics.
An image is formed above as a spot light. A beam detector 207 detects the laser beam reflected by the reflecting mirror 208, and uses this detection signal to determine the timing of the modulation operation of the semiconductor laser 202 in order to provide desired optical information onto the photosensitive drum 201. A high-resolution electrostatic latent image is formed on the photosensitive drum 201 by the laser light that is imaged and scanned on the photosensitive drum 201 . After this latent image is developed by the developing device 209, it is transferred to the recording material stored in either the cassette 210 or 211, and then the image is fixed on the recording material by passing through the fixing device 212. The hard copy is ejected to an ejecting unit (not shown). FIG. 9 shows an embodiment of a printer circuit for modulating the semiconductor laser shown in FIG. 8 with a predetermined image signal. The image signal VIDEO inputted from the input terminal IN after being decoded is sent to a first line buffer 301 consisting of a shift register or the like having a number of bits equal to the number of pixels for at least one scan for each group of image signals for one scan; The signals are alternately input to the second line buffer 302 under the control of the buffer switch control circuit 303. Further, the image signals inputted to the first line buffer 301 and the second line buffer 302 are read out alternately for each scan using the beam detection signal from the beam detector 304 as a trigger signal, and are applied to the laser driver 305. The laser driver 305 controls the anticonductor laser 3 based on the input image signal to control the emission of laser light.
06 is modulated and controlled. By having two line buffers, while inputting image signals that are input one after another to one of the line buffers, the laser driver 305 transfers the image signals already stored in the other line buffer.
Since it outputs to The beam detection signal from the beam detector 304 is also transmitted to the decoding processing circuit as a horizontal synchronizing signal HSYNC, and is used for synchronizing the decoding processing and the printer operation as described later. Incidentally, the image signal decoded in this printer is inputted through a buffer having a double buffer configuration including two line buffers, that is, a first line buffer 301 and a second line buffer 302. This double buffer configuration is used to perform a correction operation when an error occurs in the decoding operation. In other words, if an error occurs in the decoding operation while the image signal decoded by the decoding circuit is being stored in one line buffer, printing operation using the image signal of the current line containing the error is prohibited, and the image signal already stored in the other line buffer is Printing is performed based on the stored image signal of the previous line. As a result, printing is not performed using an image signal with a decoding error, so that the influence on the reproduced image can be eliminated. Note that this correction operation will cause at least two lines of the image to be duplicated based on the same image signal, but in the high-resolution (for example, 16 pel/mm) recording operation used in this example, it will not have much of an effect on the reproduced image. isn't it. In FIG. 4, 105 is the MH code table ROM shown in FIG.
It is composed of OM (read only memory). To schematically explain the contents of RM105 below, AD0 to AD13 are RM10
5 is the address terminal, and 0 to 011 are R
This is the output terminal of M105. The format of the memory contents of the ROM 105 is determined by inputting the LSB bit of the MH code to be decoded from the register 103.
Align with address terminal AD0 of OM105 and each below.
Each bit of the MH code is sequentially transferred to ROM1 in the MSB direction.
05 address terminals AD1 to AD11. Address terminal AD13 has a signal B/-ROM indicating the color of the MH code (black = 1, white = 0)
shall be given. If the MH code is shorter than 12 bits, the missing bits are ignored (DONT CARE). Also, the EL code is treated as a make-up code. Also run length 1
Color bits (AD13) of make-up codes of 792 or higher are ignored (DON'T CARE). The contents of the MH codes given each address are written in the ROM 105 as storage data for the addresses determined above, and outputs corresponding to each MH code are output to the output terminals O0 to O11.
That is, output terminal 0 outputs a signal M/ which becomes "1" when the decoded MH code is a make-up code, and becomes "0" when it is a termination code. Output terminal 1 is a signal that outputs "0" when the decoded MH code is a white code with run length 0 (00110101) or a black code with run length 0 (0000110111), and becomes "1" in other cases.
Output TO. Output terminals 2 to 5 output 4-bit outputs CL0 to CL3 in which the code length (number of bits) of each MH code is expressed in two's complement. However, the output terminal 5 is the LSB of the code length. Output terminal 6~
O11 outputs 6-bit outputs RL0 to RL5 in the form of two's complement representation of the run length of each MH code. However, the output terminal 11 is
It is LSB. For the make-up code, only the upper 6 bits of the binary representation of the run length are assigned to the output terminals 6-11. this is
Top 6 makeup codes in MH code
This is because the run length can be expressed using only bits. 402 in FIG. 4 illustrates outputs 0 to 11 of the ROM 105 when the MH code WB8 (10011) indicating white with a run length of 8 is decoded. (The MH code table used in this example is CCITT
YELLOW-BK Fascicle. 2 Rec.
T.4 According to TABLE 1/T.4 and TABLE 2/T.4. ) In FIG. 4, reference numeral 104 is the MH code decoding logic shown in FIG. 1, which in this embodiment is a detection logic composed of an AND gate and an OR gate. is the output of logic 104.
The HSC signal is a code, i.e. run length 1,
When the MH code indicating white with run length 2 and 3 and the MH code indicating black with run length 1 are detected, it becomes "0". Further, outputs 0 to 2 are the code lengths of the four types of MH codes (HSC codes) described above expressed in binary numbers, inverted and output.
FIG. 4 404 shows an example of the output when decoding the MH code white 1WD1 (000111) indicating white with a run length of 1. Note that a logic circuit is used to decode the HSC code because the current ROM addressing system cannot adequately handle the time required for high-speed processing. Tables 1 and 2 show the operation of the bit shifter shown in Figure 3.
Explain with reference to. FIG. 3 102 is the multiplexer shown in FIG. 1, with two tri-state multiplexers 10
21 and 1022. multiplexer 10
When the control line from the accumulator 106 to 2 is "0", all outputs A 7 to A 27 from the multiplexer 1022 side to the register 103 become tri-state floating and become invalid. Multiplexer 1
The outputs A 0 to A 27 from the 021 side become valid and become the outputs C 0 to C 27 of the register 103. At that time, multiplexer 1021 selects input signals C 0 -C 27 from register 103 using input lines S 0 -S 2 .
Table 1 shows how the selection is made. For example, S 0 =S 1 =
1, if S 2 = 0, the output C 3 of register 103 ~
C 27 is taken in and selectively output as outputs A 0 to A 24 , respectively. Next, when the control line to the multiplexer 102 is "1", the output A 0 ~
A6 is selectively given by the input lines S0 to S2 from the multiplexer 1021 in the same way as when the control line is " 0 ". Output A 7 from multiplexer 102
~A Among 27 , except those indicated by Y in Table 2, the multiplexer 1022 side is enabled, and the multiplexer 10
Among the outputs A 7 to A 27 on the 21 side, the outputs other than those indicated by Y in Table 2 are floating and are invalid. Further, the outputs A 7 to A 27 given from the multiplexer 1022 to the register 103 are selected by the input lines Σ 0 to Σ 2 to the multiplexer 1022, as shown in Table 2, but the bits indicated by Y in Table 2 are It is selected from the multiplexer 1021 side. The number of Y is set by controlling the tri-state state of the multiplexer 1021 using the input lines ST7 to ST11 output corresponding to the input lines Σ 0 to Σ 2 to the multiplexer 1022. In addition,
The circuits of multiplexers 1021 and 1022 in FIG. 3 can be easily realized using commercially available multiplexers (eg, IC.F251 manufactured by Fairchild, Inc., USA), gate circuits, and the like. Also, multiplexer 10
2, A 0 ~ as output to register 103
The output selected by A27 is latched into register 103 by clock CK. By configuring the bit shifter as described above, it is possible to shift the 16-bit parallel MH code signal inputted from the memory circuit 101 by an arbitrary number of bits. As a result, MH codes with uneven code lengths can be brought into the above-mentioned "cue completion" state.

【表】【table】

【表】【table】

【表】【table】

【表】 前述した如くMHコードが何であるかを判別す
るのはレジスタ103内を移動するコード列を監
視する方法をとつているが、その移動方法はビツ
ト・シフタ102等により1ビツトづつ移動する
シリアルシフト及びHSCコードとして扱われる
MHコードが検出された場合の最大6ビツトのジ
ヤンプシフトが起る。即ち103レジスタ内のコ
ード列は最大でも6ビツト以下の移動しか1クロ
ツク時間にはできないように制御されている。 従つてEOLコード(000000000001)はレジス
タ103内を移動する際、前からの経過で誤つた
移動量であつてもそのLSBビツトは必ずレジス
タ103のC0〜C5に現われることになるのであ
る。 さて、一般にMHコードを復号する際、そのコ
ード体系からしてELコードの検出が極めて重
要である。以下、第1図示のEOL検出回路11
2を詳細に説明する。 即ち、EOLコードは画像1ライン毎の区切り
のコードであると同時にそれに続く、MHコード
の位置を示す役割を持つているわけであるが、故
にデコードの際EOLコードを検出ミスすると直
ちにそれに続く各MHコードの区切りが不明とな
り1ライン分の画像がデコード不可能となり、
又、続く各画像ラインのEOLもその検出法に依
つては検出できなくなり、結局プリント出力した
画像乱れが殆んど使用できない程度まで波及する
ことになる。 従つて、MHコード列の中でたとえ送・受信誤
り等によりMHコードを多少誤つていてもEOLコ
ードの検出に極力誤りをおこさせないEOL検出
方法が重要となるのである。 MHコードが確実に検出されればコード誤りは
画像1ライン内で回復できる。 第10図はEOL検出回路112の詳細な構成
を示す図である。第10図に示すように12ビツト
のELコード(000000000001)のLSBがレジ
スタ103のC0〜C5のどこにきても良いように
少なくともレジスタの一度にシフト可能なシフト
量即ち6に対応する6種の検出ゲート1001で
並列に設ける。これによりレジスタ103内の格
納データを監視することによりELコードの検
出漏れを防止している。そして、EOLコードを
検出した検出ゲート1001からは夫々0〜
5EOLの如く、EOLコードのレジスタ103内に
おける位置を示す検出信号が出力される。 この方法によりEOLコード自身が誤りビツト
を含んでいない限りEL検出を誤る事がなくな
るのである。従つて画像コード誤りは必ず1ライ
ン以内で回復可能である。又EOLコード内に誤
りビツトを含む確率は画像コード内に誤りビツト
を含む確率に比較しそのビツト数の割合等からし
て極めて低く実用上無視できる程度である。 第11図にはEOLコード検出のための検出ゲ
ートの詳細を示す。図の如く、12ビツトデータを
パラレルに取込む構成となつており、そのMSB
を除いた11ビツトのデータを反転ゲートINVを
介し、前述のMSBとともに12入力のNANDゲー
ト1002に印加する。これによりEOLコード
のデコードを行ない。EOLコードがデコードさ
れた場合にはNANDゲート1002の出力がロ
ーレベルとなる。 第10図のEOL検出回路112の出力0EOL〜
5EOLはコードレングスカウンタ107及びアキ
ユムレータ106に伝えられる。アキユムレータ
106はこの信号により、EOLコードのコード
長分のシフトをレジスタ103になさしめるもの
である。 即ち、第10図示のEL検出回路112はそ
の検出位置からして、レジスタ103にEOLコ
ードの前にMHコード又は、Fi11ビツトがまだ残
つている状態で既にEOLを検出することもある。
従つて、EOL検出回路112が検出するEOLコ
ードのうち信号0以外のEOLコード検出信号
即ち1〜5を検出した場合には、アキユ
ムレータ106はレジスタ103におけるEL
コードの前の残りコードがレジスタ103から前
述のシフト動作によつて掃出されたあと、EL
コードのコード長分即ち12ビツトのシフトをレジ
スタ103に更に行なわせる。 これにより、EOLコードを掃出し終え、復号
すべき次ラインの先頭の画像MHコードの「頭出
し完了」の状態となる。また、これにより、画像
情報ではないEOLコードを他の圧縮コードと同
様に復号動作することによる時間無駄も除去でき
る。 次に第1図に示したブロツク図全体の詳細な説
明を第5図等を用いて行なう。第5図に揚げた回
路の動作は複雑であるので、説明を容易にするた
めにいくつかの条件設定し、更に一般的と思われ
るMHコードの復号動作を例にして、該回路の基
本的動作の説明を行ない、その後、前記設定条件
の成立に関して説明するものとする。 復号されるべき、MHコード列の一例として第
2図bを用いる事とする。そして本回路の動作原
理として、プリンタの水平同期信号HSYNCが来
る前までに、第2図bの先に現われるELコー
ドは第3図示のレジスタ103から前述のビツ
ト・シフト動作により掃出され、ELの次の
MHコード(即ち、これからデコードしようとす
るラインの最初の画像信号のMHコード)である
白のランレングス8を示すMHコードWB8がレ
ジスタ103に前述の如く「頭出し完了」の状態
でプリンタからのHSYNC待ちとなつているとす
る。 第6図は第5図回路の主要部のタイム・チヤー
トである。第6図においてHSYNC601は前述
のプリンタの主走査方向の同期信号であり主走査
1ライン毎に発生される。これをタイム・チヤー
トの基準とし、この時刻をt0とする。CK600
は基本クロツクであり、その周波数は画像周波数
と同じである。VEN602は主走査線内の有効
画像区間を規定する区間信号である。また、iNi
603は区間信号VENの始まる1クロツク(1
ビツト)前のパルス、EOS604は区間信号
VENの最終クロツク(ビツト)のパルスである。
尚、前述した様に、圧縮コード(MHコード)を
復号した画信号に基づく記録動作をレーザ・ビー
ム・プリンタで行なう場合、水平同期信号
HSYNCはレーザ光によるラスタスキヤンのスキ
ヤンラインの所定位置に、レーザ光が達したこと
を検知したビーム検知信号に基づくものであり、
また、区間信号VENはレーザ光によりスキヤン
されて潜像形成のなされる感光体(ドラム)をレ
ーザ光がスキヤンしている区間に基づく。 これから明らかなように第6図における各信号
600〜604の時間的関係は一般に一定値に固
定されるべきものである。そして本例では、
HSYNC601とiNi603の間を64クロツクの
固定長とする。またVEN602の区間は1ライ
ンの画素数となるが本例ではそれを4096ビツト
(画素)とする。 第6図において、時刻t0では第5図の回路は画
像出力の各主走査毎のイニシヤル状態に設定され
ている。即ち、前述の如く各ライン毎の先頭画像
のMHコード(本例では白のランレングス8を示
すWB8(10011))がレジスタ103に「頭出し完
了」であり、該レジスタ103の出力C0〜C12
(本例では10011.0010.0001)はロジツク104、
ROM105等に与えられている。 又、同じくコードレングスカウンタ107の値
は(−1)=(1111B)となつている。この際(−
1)は「頭出し完了」を意味すると定義されてい
る。又、各フリツプフロツプ510,109,5
15はリセツト状態、フリツプフロツプ509は
セツト状態にある。 フリツプフロツプ509がセツトされている
(Q=1)ことはMHコードのEOLを検出した後、
レジスタ103からEOLコードの掃出しを完了
した状態にある事を示す。また、フリツプフロツ
プ510がセツトされている(Q=1)の状態は
後述するようにランレングス・ラツチ513がビ
ジー(Busy)であるこを示す。フリツプフロツ
プ515はB/−ROM信号を出力Qとして出
力する。このフリツプ・フロツプ515の出力Q
は1のときにこれから複号すべきMH・コードの
色が黒であることを示すB/−ROM信号であ
る。同じく出力Qが0のときは白であることを示
す。 又、ランレングス・カウンタ108は停止して
いるとし、その値は0であるとする。SFTEN6
05はコントロール線でこれが1であることはレ
ジスタ103がデータ(MHコード)をシフトさ
せて良い事を示す。又簡単の為、アキユミユレー
タ106の出力信号Σ0〜Σ2及び信号は0であ
ると仮定する。即ち、この仮定によりレジスタ1
03の28ビツト全てが有効なMHコード列であ
り、空のない状態を示すことになる。 以上が時刻t0の状態である。 さて、時刻t1になると第6図示のHSYNC信号
601の立下がりにより第5図示フリツプ・フロ
ツプ509がリセツトされ、第6図に613で示
す信号が1となり、ANDゲート508を
介してSFTEN信号605が1となる。SFTEN
信号605が1の場合は、第6図示のカウンタ1
07がカウント・イネーブルとなる。同時に時刻
t1にはROM105のアドレスにはレジスタ10
3の保持する出力C0〜C12が与えられる。(本例
では10011XXXXXXXX)そしてRM105
の出力のうちコード・レングスCL0〜CL3はゲ
ート503及びゲート504を経てコード・レン
グス・カウンタ107に与えられている。又同時
に信号607が0であるのでカウンタ10
7はロード・モードとなりt1のクロツクにより
CL0〜CL3の値がカウンタ107にロードされ
る。本例ではランレングス8の白を示すMHコー
ドWB8のコード長5の2の補数である(−5)
がロードされる。 又、ROM105の出力RL0〜RL5及びM/
Tランレングス/ラツチ513の入力として与え
られる。同時にランレングス・ラツチ513には
フリツプ・フロツプ515のQ出力もB/−
ROM信号620として入力されている。この
時、RLCH信号608が1によりラツチ513を
ラツチ・イネーブルに制御し、t1のクロツクでD
0〜D7の値をラツチ513にラツチする。 同時に時刻t1ではフリツプ・フロツプ510は
1にセツトされる。又フリツプ・フロツプ515
は反転する。フリツプフロツプ510のQ出力で
あるBUSY信号609が1であることはラツチ
513が有効なランレングスをラツチしている事
を示す。又、フリツプフロツプ515のQ出力で
あるB/−ROM信号620が1であることは
次にレジスタ103に「頭出し完了」にすべき
MHコードの示す色が黒である事を示す。(又
B/−RM620が0であるならば該色が白
である) SFTEN信号605はゲート505、ゲート5
06を経てS信号としてマルチ・プレクサ10
2に与えられ、レジスタ103のデータが1ビツ
トシフトするようにコントロールする。これによ
りレジスタ103にあつたMHコードから必要な
データの後段への受渡しが終つたので該MHコー
ドは使用済となり、SFTEN信号605によりカ
ウント可能になつたカウンタ107の制御下で第
6図タイムチヤートに示す如くカウンタ107か
らキヤリアウト信号CRO606が発生するまで
ビツト・シフトが行なわれて、使用済のMHコー
ドがレジスタ103から掃出される。即ち本例で
は−5の設定されたカウンタ107の値が(−
1)の値になるまでレジスタ103の1ビツト・
シフトを繰返し続行する。 カウンタ107の値が(−1)になると今、使
用済となつたMHコード(本例ではランレングス
8の白を示すMHコードWB8)の掃出しが終了
し、次のMHコード(ランレングス6の黒を示す
MHコードBB6)がレジスタ103において「頭
出し完了」となるがラツチ513にはまだ前の
MHコード(WB8)のランレングスが残つてい
るためフリツプフロツプ510はセツトのままで
ある。従つて、カウンタ107のCRO信号が1
となることによりゲート511の出力は0にな
り、結局SFTEN信号605が0となることによ
り、カウンタ107が停止する。同様にSFTEN
信号605が0となることによりS0〜S2信号も
全て“0”となりレジスタ103がシフト停止し
データがホールドされる。従つて「頭出し完了」
(BB6)の状態が時刻t2まで続く。 時刻t2に於いてiNi信号603により信号
610が0となり、ラツチ513に保持されてい
たランレングス(本例では白の8ビツト)がマル
チプレクサ514を経て信号610により
カウンタ108へ移される。同時にフリツプフロ
ツプ510が信号610によりセツトされ
る。これによりラツチ513が空となり、ビジー
(BUSY)が解消される。従つて、ゲート511
の出力が1となり、前述と同様にSFTEN信号6
05が1となり、レジスタ103において「頭出
し完了」となつているMHコードによつて得られ
たランレングスがラツチ513へラツチされる。 以下同様にMHコードが順次デコードされる。 時刻t2でカウンタ108ヘロードされたランレ
ングス(本例では−5)に基づき、時刻t2の次の
ビツトから発生するVEN信号602によりカウ
ンタ108はカウントを開始する。そしてカウン
タ108の値が(−1)になつた時(本例では時
刻t3)CRI信号611を出す。又、ラツチ513
からのB/信号621により指定された画像の
色別にフリツプフロツプ109をセツトする。こ
れによりとりあえず第1番目のMHコードが画像
VIDEO(本例では白の8ビツト)に変換できたわ
けである。 尚、VEN信号602の立上り後においては、
iNi信号603は新たなHSYNC601が到来す
る迄、0のままである。従つて、VEN信号60
2の立上がり後、例えば時刻t3においてはiNi信
号603に代つて、カウンタ108のカウントア
ツプを示すCRI信号611によりフリツプ・フロ
ツプ510をリセツトし、そのビジー状態を解除
せしめ、続くMHコードのデコードにより得たラ
ンレングスのラツチ513への取込みを可能とす
る。 さて、ここまでの説明においては、MHコード
のコード長がランレングス長より等しいか、又は
短かい場合であり、MHコードを「頭出し完了」
の時点から、レジスタ103から掃出すべき使用
済MHコードをマルチプレクサ102に与えられ
る信号S0=1、S1=S2=0とすることによりシリ
アルシフトすれば、MHコードを途切れることな
くデコード続けられるわけである。しかし、一
方、MHコードのランレングス長がコード長より
短かい場合には前述の如くシリアルシフトさせる
とレジスタ103からコードを掃出している間
(シフト中)に、カウンタ108において、該
MHコードのランレングスのカウントが完了して
しまう。この時点において画像の途切れをなくす
ためには次のランレングスをラツチ513からカ
ウンタ108へ取る必要がある。しかし、レジス
タ103では次のMHコードに対する「頭出し完
了」状態となつていないので、ラツチ513には
取込むべきランレングスがROM105より出力
されていないことになる。 結局この場合、プリンタにおいて記録される画
像が途切れる事となり、リアルタイムで画像を出
力することができない事になる。この様な不都合
は前述したHSCコード、即ち、ランレングス1,
2及び3の白を示すMHコードとランレングス1
の黒を示すMHコードのデコードの際に生じる。 そこで、この様な場合は、前述の4種のHSC
コードであるMHコードだけはMHコード・デコ
ード・ロジツク104を用いて、ROM105か
らのコード長データCL0〜CL3によりデコードす
べきコードをシリアル・シフトしたと等価に後段
の回路を動作せしめる。即ち、カウンタ107に
(−1)をロードできるようにロジツク104は
HSC信号により、ロード値(−1)をつくりゲ
ート504を介してカウンタ107にロードす
る。又、このときROM105からの出力CL0〜
CL3は信号によりゲート503にてインヒ
ビツトする。又、ロジツク104からの出力SF1
とSF2にデコードしたMHコードのコード長に対
応したジヤンプ量を0〜2として出力しS0
S2を経てマルチプレクサ102を動作する。これ
により1ビツトの時間で複数ビツトのシフトを行
なうことが可能となり、換言すれば1ビツトの時
間でデコードすべき次のコードのレジスタ103
における「頭出し完了」ができるようになる。ま
た、このジヤンプ量はアキユムレータ106にも
入力され、レジスタ103の空ビツト数に累積加
算される。 以上2通りのシフト方法により「頭出し完了」
から「ランレングスラツチ」更に「ランレングス
カウント」の一連の動作を高速に繰返し、プリン
タ部に供給する画像がとぎれることなく複号を実
行する。112はEOL検出回路でレジスタ10
3の出力C0〜C11にEOLコードが現われたことを
検出すると信号0EOLを出力する。そして一ライ
ンの終了を示すEOLコードがEOL検出回路11
2で検出されると、タイミング合せ回路523を
介してEOL検出回路112からの信号0EOLによ
り、フリツプ・フロツプ509がセツトされ
EOLF信号613が0となる。これにより、結局
SFTEN信号605が0となり、次のHSYNCが
来るまで、レジスタ103は停止し、MHコード
は「頭出し完了」の状態でHSYNC待ちとなるこ
ととなる。この様に、プリンタと複号動作との同
期合せが良好に得られるものである。 以上のように各ラインごとに繰返し走査が進行
すれば画像が形成されるのである。 次に第7図を用いてデコードエラー検出法につ
いて述べる。第7図示回路は第1図又は第5図の
適当な位置に接続される。第7図上において、8
01はインバータである。また、802は加算
器、803はラツチ、804はコンパレータ、8
05はラツチ、806及び807はフリツプ・フ
ロツプである。 第7図820は第5図において、ラツチ513
からマルチプレクサ514を介して出力される信
号820と同じ信号であり、前述の如く、MHコ
ードを解読した結果のランレングスが2の補数で
表現されたものである。 さて、加算器802とラツチ803とでアキユ
ミユレータを構成する。加算器802のLSBの
下位からの桁上りは829信号(1)により1にセツ
トされており、結局加算器802の出力821は
ランレングス820の2の補数となる。従つて出
力821は該ランレングスの正整数を2進数表現
したものである。又、ラツチ803への加算は第
6図610のタイミング、即ち第5図示の
カウンタ108へカウントすべきランレングスを
ロードするタイミングで加算が続けられる。又、
ラツチ803は主走査の各ライン毎に出力される
第6図HSYNC601信号601毎にクリヤされ
る。即ちラツチ803の出力822は各ライン毎
のランレングスの累積値を2進数で表わす。一
方、ラツチ805は毎ラインの一定ランレングス
(本例では1ラインの画素数に対応する4096)を
信号824によりCPU等から知らされて保持し
ている。 コンパレータ804は今ラツチ803に累積さ
れているランレングス822(Aとする)とラツ
チ805からの正解値823(Bとする)とを比
較するコンパレータ回路である。 フリツプ・フロツプ806は第6図示のEOS
信号604の出力時、即ち各ラインの最終ビツト
に於いて、コンパレータ804よりA=Bである
ことを示す信号831が出力されていない時
ANDゲート808の出力825によりセツトさ
れる。即ち、フリツプ・フロツプ806のセツト
されることはランレングスの累積値Aが予定され
た正解値B(本例では4096)に等しくなつたこと
を示し、MHコード又はそのデコードに誤りがあ
つたことを示す。 フリツプ・フロツプ807はA>Bの状態にな
つた場合に、コンパレータ804から出力される
信号832を入力とするアンドゲート809の出
力826によりランレングスの累積途中でも直ち
にセツトされる。即ち、フリツプフロツプのQ出
力828はランレングスの累積値がラインの途中
で予定された正解値(本例では4096、即ち、
VEN602の区間の画素数)を越えてしまつた
事を示し、これは1ラインのデコードの途中にお
いて既に大巾なデコード誤りが生じたことを表わ
すものである。 又、フリツプ・フロツプ806及び807は第
6図613が“0”即ちEL(Eudof
liue)がEOL検出回路112により検出され
HSYNC610の入力がなされるまでリセツトさ
れず、HSYNC信号601の入力によりゲート8
10の出力によりリセツトされる。従つて、各フ
リツプフロツプ806,807の出力827又は
出力828を検知し別途のEOL検出回路112
により、EOL検知に専念させることによりデコ
ード誤り等による同期ズレを最小限に止める事が
できる。 尚、本例ではアキユムレータによりランレング
スを累積加算する例を示したが、これは所定数例
えば4096から順次ランレングス値を減算し減算カ
ウンタからのボロウを検出する方法等に置き換え
ることもできる。 以上の様にデコード誤まりが生じ、フリツプフ
ロツプ806又は807がセツトされると、その
出力は第9図示のプリンタプリンタ回路のバツフ
アスイツチ制御回路303に伝達される。 バツフアスイツチ制御回路303は前述した様
に、ダブルバツフア構成となつているプリンタの
ラインバツフアの入出力を交互に選択するための
バツフア選択動作を行なうものである。そして、
フリツプフロツプ806又は807よりそのセツ
ト信号、即ち、デコード誤まり検出信号を入力す
ると、デコード誤まりの発生した現ラインの画像
信号を無効にし、エラーのあつたラインに代つて
前ラインの画像信号を再利用すべく、前ラインの
画像信号の格納されているラインバツフアの再読
出しを行なう様、ラインバツフアの選択制御を行
なう。即ち、例えば第1ラインバツフア301に
復号中の画像信号を格納している時に、デコード
誤まりが発生した場合、第1ラインバツフア30
1に現在格納中の画像信号を無効にし、現在、画
像信号の読出しがなされている第2ラインバツフ
ア302の読出しの終了後再び第2ラインバツフ
ア302から同一の画像信号の読出しを行なう。 これにより、デコード誤りの生じた画像信号に
よるプリント動作はなされずに、記録画像への影
響を除去できる。尚、プリンタのラインバツフア
の数は2本以上でも同様に実行できる。又、この
誤まり補正用のラインバツフアをデコード回路側
に設けてもよい。 さて、前述の如く本例では、MHコード化され
た画像をデコードする際には、該MHコードの先
頭ELを検知し、その後に続くコードから該画
像の第1ラインとして、デコードを開始し、実際
の画像を再生する。なぜなら、MHコード化され
た画像は、本件では図示していないが第1図示の
記憶回路101の前段に存在する、例えば画像メ
モリ等に蓄積されているものである。そこから
CPU等により、画像メモリの読出し開始アドレ
スを指定し、MHコード化された画像を読出し、
記憶回路101を介しデコーダ回路に与える。 その際、画像メモリから読出されたMHコード
は例えば、画像ページの途中から読出した場合に
は必ずしも先頭にELコードが来ない。この場
合でも正しくデコードを開始できるように、デコ
ード開始前に第1図示記憶回路101をクリア状
態にしておき、次に該メモリから読出したMHコ
ードを記憶回路101が満杯(第2図の状態)に
なるまで読出し、次いでデコーダ内部へデータ
(MHコード)を送り始める。そして、第1番目
のELコードが検出できるまでは画像コードと
して扱わず、次々にデータを送り続けELコー
ドを検出することに専念する。 そしてELコードが検出できた後には以後の
コードを画像情報として扱い、コード・レングス
等によりシフト量をコントロールしながらデコー
ドしていくわけである。このようにして第1番目
のELコードを前述のEOL検出回路112に
より見つける事により、MHコードの区切りを判
定し、又画像の同期的再生が可能となるのであ
る。 さて、前述のデコード動作開始後、初めて入力
する第1のEOLコードを見つける動作を開始す
ると記憶回路101から順次レジスタ103へデ
ータが送られ来るが、その開始前にレジスタ10
3に全て“0”が存在しているとすると実際に記
憶回路101から来たMHコード又はMHコード
の一部(途中)とつながつて、EOLコード
(000000000001)と誤検知されることとなる。そ
れを避ける為、レジスタ103の初期状態は全て
“1”にセツトする。即ちレジスタ103のC0
C27を全て“1”とする。これにより前述のE
Lの誤検知を避けることができる。 レジスタ103を全て“1”にプリセツトする
方法を説明する。第12図にはレジスタ103の
構成の一例を示すもので、即ち、レジスタ103
は28個のフリツプフロツプF/Fで構成される。
従つて、その全てのフリツプフロツプF/Fのプ
リセツト端子にCPU等からプリセツトパルス9
01を入力し、全てのフリツプフロツプのQ出力
を1とする。ここではフリツプフロツプF/Fは
例えばアメリカTI社製のSN74S74N等を使用す
ることができる。 以上、本実施例はMHコードの復号を例に説明
したが、他の圧縮方法によるコードの復号装置に
適用することもできる。また、復号後の画像信号
はレーザ・ビーム・プリンタ等のプリンタで画像
記録される以外に、CRT等のデイスプレイにて
表示したり、ビツトイメージとしてフアイルした
りする等多様な用途に利用可能である。更に、本
実施例中で用いた数値はそれに限るものではな
く、用途や環境等において適宜選択されるもので
あることは言う迄もない。 以上説明した様に圧縮コードの復号動作を確実
に実行できるものであり、また、高速処理を必要
とする画像処理に対してもリアルタイムな復号動
作を可能とするものである。また、高速で且つ高
品位な画像記録を必要とするプリンタ等の出力部
に対しても効果的に圧縮コードを復号化し、供給
することが可能となるものである。 また、圧縮コードの復号動作或いは伝送に係わ
る異常を確実に検出することができ、また、それ
による影響を最小限にすることができるものであ
る。 また、圧縮コードを復号化して得た画像信号に
基づきプリント動作する際、プリンタと復号処理
部との同期が良好に得られるものである。 また、復号動作の基準となるライン同期コード
の検出を確実に行ない、復号動作の同期ずれ等の
不都合を除去できるものである。 また、1ページ或いは1ラインの途中から圧縮
コードが復号回路に供給されたとしても、復号動
作におけるライン同期を確実になさしめ復号誤ま
り等を防止できるものである。 以上説明した様に、本発明によると、記憶手段
に記憶されている複数の圧縮コードをシフトする
ことにより次に復号すべき圧縮コードを記憶手段
の所定位置にセツトし、所定位置にセツトされた
圧縮コードを復号することによりラン長データ及
び圧縮コードのコード長データを出力するととも
に、記憶手段への圧縮コードの記憶に先立つて記
憶手段に、それ自体EOLコードとして検出され
ず、且つ、他の圧縮コードと組合わさつたとして
もEOLコードとして検出されない特定データを
格納せしめる格納手段を有するので、記憶手段に
入力されたEOLコード以外の圧縮コードをEOL
コードとして誤検出してしまう不都合が防止で
き、従つて、ラインの途中、あるいは、ある圧縮
コードの途中から記憶手段への圧縮コードの記憶
が始まつた場合でも、EOLコードの検出を基準
とした圧縮コードの復号動作を確実に実行可能と
なる。
[Table] As mentioned above, the MH code is determined by monitoring the code string moving within the register 103, and the movement method is to move the code one bit at a time using the bit shifter 102 or the like. Treated as serial shift and HSC code
A jump shift of up to 6 bits occurs when an MH code is detected. In other words, the code string in register 103 is controlled so that at most no more than 6 bits can be moved in one clock time. Therefore, when the EOL code (000000000001) moves within the register 103, its LSB bit will always appear in C0 to C5 of the register 103 even if the amount of movement is incorrect due to the previous code. Generally, when decoding an MH code, detection of an EL code is extremely important due to its code system. Below, the EOL detection circuit 11 shown in FIG.
2 will be explained in detail. In other words, the EOL code is a delimiter code for each line of the image, and at the same time has the role of indicating the position of the MH code that follows it. The boundaries of the MH code become unclear, making it impossible to decode one line of the image.
Furthermore, depending on the detection method used, the EOL of each subsequent image line cannot be detected, and eventually the printed image is distorted to the extent that it is almost unusable. Therefore, it is important to develop an EOL detection method that minimizes errors in EOL code detection even if the MH code in the MH code string is slightly incorrect due to transmission/reception errors. If the MH code is reliably detected, code errors can be recovered within one line of the image. FIG. 10 is a diagram showing a detailed configuration of the EOL detection circuit 112. As shown in FIG. 10, so that the LSB of the 12-bit EL code (000000000001) can be placed anywhere from C0 to C5 of the register 103, at least the shift amount that can be shifted at one time in the register 103, that is, 6, corresponds to 6. Seed detection gates 1001 are provided in parallel. This prevents failure to detect an EL code by monitoring the data stored in the register 103. Then, from the detection gate 1001 that detected the EOL code, 0 to
A detection signal indicating the position of the EOL code in the register 103, such as 5EOL, is output. This method prevents errors in EL detection unless the EOL code itself contains error bits. Therefore, image code errors can always be recovered within one line. Furthermore, the probability that an error bit is included in an EOL code is extremely low compared to the probability that an error bit is included in an image code, considering the ratio of the number of bits, and can be ignored in practical terms. FIG. 11 shows details of the detection gate for EOL code detection. As shown in the figure, the configuration is such that 12-bit data is imported in parallel, and the MSB
The 11-bit data excluding the above is applied to the 12-input NAND gate 1002 along with the aforementioned MSB via the inverting gate INV. This decodes the EOL code. When the EOL code is decoded, the output of NAND gate 1002 becomes low level. Output 0EOL~ of the EOL detection circuit 112 in Fig. 10
5EOL is transmitted to the code length counter 107 and the accumulator 106. The accumulator 106 uses this signal to cause the register 103 to shift by the code length of the EOL code. That is, the EL detection circuit 112 shown in FIG. 10 may already detect EOL in a state where the MH code or Fi11 bit still remains in the register 103 before the EOL code, considering its detection position.
Therefore, when the EOL detection circuit 112 detects an EOL code detection signal other than signal 0, that is, an EOL code detection signal 1 to 5 among the EOL codes detected, the accumulator 106 detects the EL in the register 103.
After the remaining code in front of the code is flushed out from the register 103 by the shift operation described above,
The register 103 is caused to further shift by the code length of the code, that is, 12 bits. As a result, the EOL code has been swept out, and the state of "cueing completion" for the image MH code at the beginning of the next line to be decoded is reached. Furthermore, this also eliminates wasted time caused by decoding an EOL code that is not image information in the same way as other compressed codes. Next, a detailed explanation of the entire block diagram shown in FIG. 1 will be given using FIG. 5 and the like. Since the operation of the circuit shown in Figure 5 is complex, we will set some conditions to make it easier to explain, and we will also explain the basics of the circuit using the MH code decoding operation, which is considered to be common, as an example. The operation will be explained, and then the establishment of the setting conditions will be explained. Let us use FIG. 2b as an example of the MH code string to be decoded. The operating principle of this circuit is that, before the printer's horizontal synchronization signal HSYNC arrives, the EL code that appears earlier in FIG. 2b is swept out of the register 103 shown in FIG. next to
The MH code WB8 indicating white run length 8, which is the MH code (that is, the MH code of the first image signal of the line to be decoded), is stored in the register 103 in the state of "starting complete" as described above, and is sent from the printer. Assume that it is waiting for HSYNC. FIG. 6 is a time chart of the main parts of the circuit of FIG. In FIG. 6, HSYNC 601 is a synchronization signal in the main scanning direction of the printer described above, and is generated for each main scanning line. This is used as the reference for the time chart, and this time is set as t 0 . CK600
is the fundamental clock, whose frequency is the same as the image frequency. VEN 602 is a section signal that defines an effective image section within the main scanning line. Also, iNi
603 is one clock (1 clock) at which the section signal VEN starts.
bit) previous pulse, EOS604 is interval signal
This is the final clock (bit) pulse of VEN.
As mentioned above, when a laser beam printer performs a recording operation based on an image signal decoded from a compressed code (MH code), the horizontal synchronization signal
HSYNC is based on a beam detection signal that detects that the laser beam has reached a predetermined position on the scan line of the raster scan using the laser beam.
The section signal VEN is based on the section in which the laser beam scans the photoreceptor (drum) on which the latent image is formed. As is clear from this, the temporal relationships among the signals 600-604 in FIG. 6 should generally be fixed at constant values. And in this example,
The length between HSYNC601 and iNi603 is a fixed length of 64 clocks. Also, the section of VEN 602 has the number of pixels of one line, and in this example, it is 4096 bits (pixels). In FIG. 6, at time t0 , the circuit of FIG. 5 is set to the initial state for each main scan of image output. That is, as mentioned above, the MH code of the first image for each line (in this example, WB8 (10011) indicating white run length 8) is stored in the register 103 as "starting complete", and the outputs of the register 103 are C0 to C12.
(10011.0010.0001 in this example) is Logic 104,
It is given to ROM105 etc. Similarly, the value of the code length counter 107 is (-1)=(1111B). At this time (-
1) is defined to mean "completion of cueing." Also, each flip-flop 510, 109, 5
15 is in a reset state, and flip-flop 509 is in a set state. The fact that the flip-flop 509 is set (Q=1) means that after detecting the EOL of the MH code,
This indicates that the EOL code has been completely cleared from the register 103. Further, the state in which flip-flop 510 is set (Q=1) indicates that run-length latch 513 is busy, as will be described later. Flip-flop 515 outputs the B/-ROM signal as output Q. The output Q of this flip-flop 515
is a B/-ROM signal which indicates that the color of the MH code to be decoded is black when it is 1. Similarly, when the output Q is 0, it indicates white. It is also assumed that the run-length counter 108 is stopped and its value is zero. SFTEN6
05 is a control line, and the fact that it is 1 indicates that the register 103 can shift data (MH code). Also, for simplicity, it is assumed that the output signals Σ 0 to Σ 2 and the signal of the accumulator 106 are zero. That is, with this assumption, register 1
All 28 bits of 03 are valid MH code strings, indicating a state with no emptiness. The above is the state at time t0 . Now, at time t1 , the flip-flop 509 shown in FIG. 5 is reset by the fall of the HSYNC signal 601 shown in FIG. becomes 1. SFTEN
When the signal 605 is 1, the counter 1 shown in FIG.
07 becomes count enable. time at the same time
At t 1 , the address of ROM105 is register 10.
The outputs C0 to C12 held by the controller 3 are given. (10011XXXXXXXX in this example) and RM105
Of the outputs, code lengths CL0 to CL3 are provided to a code length counter 107 via gates 503 and 504. At the same time, since the signal 607 is 0, the counter 10
7 is in load mode and by the clock of t1
The values of CL0 to CL3 are loaded into the counter 107. In this example, it is the two's complement of the code length 5 of the MH code WB8 indicating white with a run length of 8 (-5).
is loaded. In addition, the outputs RL0 to RL5 and M/ of the ROM105
Provided as input to T run length/latch 513. At the same time, the Q output of the flip-flop 515 is also applied to the run-length latch 513.
It is input as a ROM signal 620. At this time, the RLCH signal 608 controls the latch 513 to latch enable with a 1 , and the D
The values 0 to D7 are latched in latch 513. At the same time, flip-flop 510 is set to 1 at time t1 . Also flip flop 515
is reversed. A 1 on the BUSY signal 609, the Q output of flip-flop 510, indicates that latch 513 is latching a valid run length. Also, the fact that the B/-ROM signal 620, which is the Q output of the flip-flop 515, is 1 indicates that the register 103 should indicate "cue completion".
Indicates that the color indicated by the MH code is black. (Also, if B/-RM620 is 0, the color is white) SFTEN signal 605 is gate 505, gate 5
06 to the multiplexer 10 as the S signal.
2 and controls the data in register 103 to be shifted by 1 bit. As a result, the transfer of the necessary data from the MH code in the register 103 to the subsequent stage has been completed, and the MH code is now used.The time chart in FIG. Bit shifting is performed until the carry-out signal CRO 606 is generated from the counter 107, as shown in FIG. That is, in this example, the value of the counter 107 set to -5 is (-
1) of the register 103 until it reaches the value 1).
Continue repeating the shift. When the value of the counter 107 becomes (-1), the cleaning of the currently used MH code (in this example, the MH code WB8 indicating white with run length 8) is completed, and the next MH code (run length 6) is cleared. show black
MH code BB6) is “cueing complete” in register 103, but latch 513 still contains the previous data.
Since the run length of the MH code (WB8) remains, the flip-flop 510 remains set. Therefore, the CRO signal of counter 107 is 1.
As a result, the output of the gate 511 becomes 0, and as a result, the SFTEN signal 605 becomes 0, and the counter 107 stops. Similarly SFTEN
When the signal 605 becomes 0, the S0 to S2 signals also all become 0, the register 103 stops shifting, and the data is held. Therefore, "cueing complete"
The state (BB6) continues until time t 2 . At time t2 , the iNi signal 603 causes the signal 610 to become 0, and the run length held in the latch 513 (white 8 bits in this example) is transferred to the counter 108 by the signal 610 via the multiplexer 514. At the same time, flip-flop 510 is set by signal 610. This empties the latch 513 and eliminates the BUSY condition. Therefore, gate 511
The output of becomes 1, and the SFTEN signal 6 becomes 1 as described above.
05 becomes 1, and the run length obtained by the MH code indicating "cue completion" in the register 103 is latched into the latch 513. Thereafter, the MH codes are sequentially decoded in the same manner. Based on the run length (-5 in this example) loaded into the counter 108 at time t2 , the counter 108 starts counting by the VEN signal 602 generated from the next bit at time t2 . Then, when the value of the counter 108 becomes (-1) (time t 3 in this example), a CRI signal 611 is output. Also, latch 513
The flip-flop 109 is set according to the color of the image specified by the B/signal 621 from the . As a result, the first MH code is displayed as an image.
This means that the image can be converted to VIDEO (white 8-bit in this example). Note that after the VEN signal 602 rises,
The iNi signal 603 remains at 0 until a new HSYNC 601 arrives. Therefore, the VEN signal 60
2, for example, at time t3 , the flip-flop 510 is reset by the CRI signal 611 indicating the count up of the counter 108 instead of the iNi signal 603, and the busy state is released. The obtained run length can be loaded into the latch 513. Now, in the explanation so far, the code length of the MH code is equal to or shorter than the run length length, and the MH code is "cue completion".
From the point in time, if the used MH code to be flushed out from the register 103 is serially shifted by setting the signals S 0 =1 and S 1 =S 2 =0 given to the multiplexer 102, the MH code can be decoded without interruption. That's why. However, on the other hand, if the run length of the MH code is shorter than the code length, if the serial shift is performed as described above, while the code is being flushed out from the register 103 (during the shift), the counter 108 will store the corresponding code.
The run length count of the MH code is completed. At this point, it is necessary to take the next run length from latch 513 to counter 108 in order to eliminate image discontinuity. However, since the register 103 is not in the "cue completion" state for the next MH code, the run length to be captured has not been output from the ROM 105 to the latch 513. Eventually, in this case, the image recorded by the printer will be interrupted, making it impossible to output the image in real time. This inconvenience is caused by the aforementioned HSC code, that is, run length 1,
MH code showing 2 and 3 white and run length 1
Occurs when decoding an MH code that indicates black. Therefore, in such cases, the above-mentioned four types of HSC
Only the MH code, which is a code, uses the MH code decode logic 104 to operate the subsequent circuit equivalent to serially shifting the code to be decoded using the code length data CL0 to CL3 from the ROM 105. That is, the logic 104 is configured so that the counter 107 can be loaded with (-1).
A load value (-1) is generated by the HSC signal and loaded into the counter 107 via the gate 504. Also, at this time, the output from ROM105 CL0~
CL3 is inhibited at gate 503 by a signal. Also, the output SF1 from logic 104
The jump amount corresponding to the code length of the MH code decoded to SF2 is output as 0 to 2, and S 0 to
The multiplexer 102 is operated via S2 . This makes it possible to shift multiple bits in one bit time, in other words, the register 103 of the next code to be decoded in one bit time.
You will be able to "cue complete" in . This jump amount is also input to the accumulator 106 and cumulatively added to the number of empty bits in the register 103. With the above two shift methods, "cueing is completed"
A series of operations from ``run length latch'' to ``run length count'' are repeated at high speed to perform decoding without interrupting the image supplied to the printer section. 112 is the EOL detection circuit and register 10
When it detects that the EOL code appears on the outputs C 0 to C 11 of 3, it outputs a signal 0EOL. Then, the EOL code indicating the end of one line is sent to the EOL detection circuit 11.
2, the flip-flop 509 is set by the signal 0EOL from the EOL detection circuit 112 via the timing alignment circuit 523.
The EOLF signal 613 becomes 0. This ultimately results in
The SFTEN signal 605 becomes 0, and the register 103 stops until the next HSYNC arrives, and the MH code waits for HSYNC in the state of "heading complete". In this way, good synchronization between the printer and the decoding operation can be achieved. As described above, an image is formed by repeatedly scanning each line. Next, a decoding error detection method will be described using FIG. The circuit shown in FIG. 7 is connected to the appropriate location in FIG. 1 or FIG. 5. On Figure 7, 8
01 is an inverter. Further, 802 is an adder, 803 is a latch, 804 is a comparator, and 803 is a latch.
05 is a latch, and 806 and 807 are flip-flops. FIG. 7 820 is the latch 513 in FIG.
This is the same signal as the signal 820 output from the multiplexer 514, and as described above, the run length as a result of decoding the MH code is expressed in two's complement. Now, adder 802 and latch 803 constitute an accumulator. The carry from the lower LSB of the adder 802 is set to 1 by the 829 signal (1), and as a result, the output 821 of the adder 802 becomes the two's complement of the run length 820. Therefore, the output 821 is a binary representation of the positive integer of the run length. Further, the addition to the latch 803 continues at the timing 610 in FIG. 6, that is, at the timing when the run length to be counted is loaded into the counter 108 shown in FIG. or,
The latch 803 is cleared every time the HSYNC 601 signal 601 in FIG. 6 is output for each line of main scanning. That is, the output 822 of latch 803 represents the cumulative value of the run length for each line in binary form. On the other hand, the latch 805 holds a constant run length for each line (in this example, 4096, which corresponds to the number of pixels in one line), which is informed by a signal 824 from the CPU or the like. Comparator 804 is a comparator circuit that compares the run length 822 (denoted as A) currently accumulated in latch 803 with the correct value 823 (denoted as B) from latch 805. The flip-flop 806 is the EOS shown in Figure 6.
When the signal 604 is output, that is, at the final bit of each line, the signal 831 indicating that A=B is not output from the comparator 804.
Set by output 825 of AND gate 808. That is, the setting of the flip-flop 806 indicates that the cumulative run length value A has become equal to the predetermined correct value B (4096 in this example), indicating that there was an error in the MH code or its decoding. shows. When the flip-flop 807 becomes in the state of A>B, it is immediately set by the output 826 of the AND gate 809 which receives the signal 832 output from the comparator 804 even during the run length accumulation. That is, the Q output 828 of the flip-flop is such that the cumulative value of the run length is the expected correct value in the middle of the line (4096 in this example, that is,
This indicates that a large decoding error has already occurred during the decoding of one line. In addition, flip-flops 806 and 807 have 613 in FIG. 6 "0", that is, EL (Eudof).
liue) is detected by the EOL detection circuit 112.
It is not reset until HSYNC610 is input, and gate 8 is reset by HSYNC signal 601 input.
It is reset by the output of 10. Therefore, a separate EOL detection circuit 112 detects the output 827 or 828 of each flip-flop 806, 807.
By focusing on EOL detection, it is possible to minimize synchronization errors due to decoding errors, etc. Although this example shows an example in which run lengths are cumulatively added by an accumulator, this may be replaced with a method in which run length values are sequentially subtracted from a predetermined number, for example, 4096, and borrows from the subtraction counter are detected. When a decoding error occurs as described above and the flip-flop 806 or 807 is set, its output is transmitted to the buffer switch control circuit 303 of the printer circuit shown in FIG. As described above, the buffer switch control circuit 303 performs a buffer selection operation for alternately selecting input and output of line buffers of a printer having a double buffer configuration. and,
When the set signal, that is, the decoding error detection signal, is input from the flip-flop 806 or 807, the image signal of the current line in which the decoding error has occurred is invalidated, and the image signal of the previous line is reproduced in place of the line in which the error occurred. Line buffer selection control is performed so that the line buffer in which the image signal of the previous line is stored is reread for use. That is, for example, if a decoding error occurs while storing an image signal being decoded in the first line buffer 301, the first line buffer 30
1, the image signal currently being stored is invalidated, and after the reading of the second line buffer 302 from which the image signal is currently being read is completed, the same image signal is read out from the second line buffer 302 again. As a result, the influence on the recorded image can be removed without performing a printing operation based on the image signal in which the decoding error has occurred. Incidentally, the same operation can be performed even if the number of line buffers in the printer is two or more. Further, a line buffer for error correction may be provided on the decoding circuit side. Now, as mentioned above, in this example, when decoding an MH coded image, the first EL of the MH code is detected, and decoding is started from the code that follows as the first line of the image, Play the actual image. This is because the MH-encoded image is stored in, for example, an image memory, which is not shown in the present case, but is present in the previous stage of the storage circuit 101 shown in the first diagram. From there
Specify the read start address of the image memory using the CPU, etc., read the MH coded image,
It is applied to the decoder circuit via the memory circuit 101. At this time, when the MH code read from the image memory is read from the middle of the image page, the EL code does not necessarily come at the beginning. In order to start decoding correctly even in this case, the first storage circuit 101 shown in the figure is cleared before the start of decoding, and then the storage circuit 101 is full of the MH code read from the memory (state shown in FIG. 2). The data is read until it becomes , and then the data (MH code) starts to be sent inside the decoder. Then, until the first EL code is detected, it is not treated as an image code, and the data is continued to be sent one after another and concentrated on detecting the EL code. After the EL code is detected, subsequent codes are treated as image information and decoded while controlling the amount of shift using the code length and the like. In this way, by finding the first EL code by the EOL detection circuit 112 described above, it is possible to determine the delimitation of the MH code and to reproduce the image synchronously. Now, when the operation to find the first EOL code to be input for the first time starts after the start of the decoding operation described above, data is sequentially sent from the memory circuit 101 to the register 103.
If all "0"s exist in 3, it will be connected to the MH code actually coming from the storage circuit 101 or a part (in the middle) of the MH code, and will be erroneously detected as an EOL code (000000000001). To avoid this, the initial state of register 103 is all set to "1". That is, C 0 of register 103 ~
Set all C 27 to “1”. As a result, the above E
Erroneous detection of L can be avoided. A method for presetting all registers 103 to "1" will be explained. FIG. 12 shows an example of the configuration of the register 103, that is, the register 103
consists of 28 flip-flop F/Fs.
Therefore, a preset pulse 9 is applied from the CPU, etc. to the preset terminals of all flip-flop F/Fs.
01 is input, and the Q outputs of all flip-flops are set to 1. Here, the flip-flop F/F may be, for example, SN74S74N manufactured by TI in the United States. Although this embodiment has been described above using the decoding of MH codes as an example, it can also be applied to decoding apparatuses for codes using other compression methods. In addition, the decoded image signal can be used for a variety of purposes, such as being recorded on a printer such as a laser beam printer, displaying it on a display such as a CRT, or saving it as a file as a bit image. . Furthermore, it goes without saying that the numerical values used in this example are not limited to these, and can be appropriately selected depending on the application, environment, etc. As explained above, the decoding operation of the compressed code can be reliably executed, and the decoding operation can also be performed in real time for image processing that requires high-speed processing. Furthermore, it becomes possible to effectively decode and supply compressed codes to output units such as printers that require high-speed, high-quality image recording. Further, it is possible to reliably detect abnormalities related to the decoding operation or transmission of compressed codes, and to minimize the effects thereof. Further, when performing a printing operation based on an image signal obtained by decoding a compressed code, good synchronization between the printer and the decoding processing section can be obtained. Furthermore, it is possible to reliably detect the line synchronization code that serves as a reference for decoding operations, thereby eliminating inconveniences such as out-of-synchronization of decoding operations. Further, even if the compressed code is supplied to the decoding circuit from the middle of one page or one line, line synchronization in the decoding operation can be ensured and decoding errors can be prevented. As explained above, according to the present invention, the compressed code to be decoded next is set at a predetermined position in the storage means by shifting a plurality of compressed codes stored in the storage means, and the compressed code that is set at the predetermined position is By decoding the compressed code, the run length data and the code length data of the compressed code are output, and prior to storing the compressed code in the storage means, the data that is not detected as an EOL code itself and other Since it has a storage means for storing specific data that will not be detected as an EOL code even if combined with a compressed code, the compressed code other than the EOL code input to the storage means can be stored as an EOL code.
This prevents the inconvenience of erroneously detecting a code as a code, and therefore, even if a compressed code starts to be stored in the storage device in the middle of a line or in the middle of a certain compressed code, the detection of the EOL code can be used as the standard. It becomes possible to reliably execute the decoding operation of the compressed code.

【図面の簡単な説明】[Brief explanation of the drawing]

第1図は本発明の一実施例の概略構成を示す回
路ブロツク図、第2図aは記憶回路101におけ
るMHコードの記憶型式を示す図、第2図bは複
数のMHコードの連続した状態を示す図、第3図
はビツト・シフタの構成を示す回路ブロツク図、
第4図はMHコードのデコード回路の構成を示す
回路ブロツク図、第5図は第1図示の回路ブロツ
ク図の詳細な回路図、第6図は第5図示回路の各
部動作タイミングを示すタイミングチヤート図、
第7図はデコードエラー検出回路の構成を示す回
路ブロツク図、第8図はプリンタの一構成例を示
す図、第9図は第8図示プリンタの記録動作のた
めの回路構成を示すブロツク図、第10図は
EOL検出回路の構成を示す回路ブロツク図、第
11図は第10図示の検出ゲートの構成を示す回
路図、第12図はレジスタの一構成例を示す回路
図であり、101は記憶回路、102はマルチプ
レクサ、103はレジスタ、104はMHコー
ド・デコード・ロジツク、104はMHコード・
テーブルROMである。
FIG. 1 is a circuit block diagram showing a schematic configuration of an embodiment of the present invention, FIG. 2a is a diagram showing a storage type of MH codes in the memory circuit 101, and FIG. 2b is a diagram showing a continuous state of a plurality of MH codes. Figure 3 is a circuit block diagram showing the configuration of the bit shifter.
Fig. 4 is a circuit block diagram showing the configuration of the MH code decoding circuit, Fig. 5 is a detailed circuit diagram of the circuit block diagram shown in Fig. 1, and Fig. 6 is a timing chart showing the operation timing of each part of the circuit shown in Fig. 5. figure,
FIG. 7 is a circuit block diagram showing the configuration of a decoding error detection circuit, FIG. 8 is a diagram showing an example of the configuration of the printer, and FIG. 9 is a block diagram showing the circuit configuration for recording operation of the printer shown in FIG. Figure 10 is
11 is a circuit diagram showing the configuration of the detection gate shown in FIG. 10, FIG. 12 is a circuit diagram showing an example of the configuration of a register, 101 is a storage circuit, 102 is a multiplexer, 103 is a register, 104 is MH code decode logic, 104 is MH code decode logic,
It is a table ROM.

Claims (1)

【特許請求の範囲】 1 画像の各ラインの終了を示すEOLコードを
含む不定長の圧縮コードを順次復号する圧縮コー
ドの復号装置において、 連続して入力する圧縮コードを複数連続して記
憶する記憶手段と、 前記記憶手段に記憶されている複数の圧縮コー
ドをシフトすることにより次に復号すべき圧縮コ
ードを前記記憶手段の所定位置にセツトするシフ
ト手段と、 前記記憶手段の所定位置にセツトされた圧縮コ
ードを復号することによりラン長データ及び圧縮
コードのコード長データを出力する復号手段と、 前記復号手段から出力された前記コード長デー
タに従つて前記シフト手段により実行される複数
の圧縮コードのシフト量を制御するシフト制御手
段と、 前記記憶手段に前記EOLコードが存在してい
るか否かを検出する検出手段と、 前記検出手段による前記EOLコードの検出に
基づいて前記復号手段により前記EOLコードに
続く圧縮コードを復号せしめる復号制御手段と、 前記記憶手段への圧縮コードの記憶に先立つて
前記記憶手段に、それ自体前記EOLコードとし
て検出されず、且つ、他の圧縮コードと組合わさ
つたとしても前記EOLコードとして検出されな
い特定データを格納せしめる格納手段とを有する
ことを特徴とする圧縮コードの復号装置。
[Scope of Claims] 1. In a compressed code decoding device that sequentially decodes compressed codes of undefined length including an EOL code indicating the end of each line of an image, the memory continuously stores a plurality of compressed codes that are input continuously. means for shifting a plurality of compressed codes stored in the storage means to set the next compressed code to be decoded at a predetermined position in the storage means; a decoding means for outputting run length data and code length data of the compressed code by decoding the compressed code; and a plurality of compressed codes executed by the shifting means in accordance with the code length data output from the decoding means. shift control means for controlling the shift amount of the EOL code; detection means for detecting whether or not the EOL code is present in the storage means; and based on the detection of the EOL code by the detection means, the decoding means decoding control means for decoding the compressed code following the code; and prior to storing the compressed code in the storage means, a decoding control means for decoding the compressed code following the code; 1. A compressed code decoding apparatus, comprising: storage means for storing specific data that is not detected as the EOL code even if the EOL code is detected as the EOL code.
JP59114837A 1984-06-05 1984-06-05 Decoder for compression code Granted JPS60257669A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP59114837A JPS60257669A (en) 1984-06-05 1984-06-05 Decoder for compression code

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP59114837A JPS60257669A (en) 1984-06-05 1984-06-05 Decoder for compression code

Publications (2)

Publication Number Publication Date
JPS60257669A JPS60257669A (en) 1985-12-19
JPH0584697B2 true JPH0584697B2 (en) 1993-12-02

Family

ID=14647936

Family Applications (1)

Application Number Title Priority Date Filing Date
JP59114837A Granted JPS60257669A (en) 1984-06-05 1984-06-05 Decoder for compression code

Country Status (1)

Country Link
JP (1) JPS60257669A (en)

Also Published As

Publication number Publication date
JPS60257669A (en) 1985-12-19

Similar Documents

Publication Publication Date Title
US4924509A (en) Image processing apparatus
US3471639A (en) Shift/count control circuit
JPH0127630B2 (en)
US3769453A (en) Finite memory adaptive predictor
JPH04270568A (en) Data compression system in picture processing unit
JPH0134500B2 (en)
EP0212905B1 (en) Decoding apparatus for image code
JPS59178077A (en) Method for compressing data of binary picture
US4837634A (en) Apparatus for decoding image codes obtained by compression process
US4918540A (en) System for encoding or decoding analog video signals
JPH0584697B2 (en)
JPS6031423B2 (en) Compressed data restoration method
US5280361A (en) Data processing apparatus
JPH0584698B2 (en)
JPH0646777B2 (en) Decompression device for compression code
JPH0685568B2 (en) Decompression device for compression code
JPH065890B2 (en) Decompression device for compression code
JPH0586698B2 (en)
JPH0646776B2 (en) Decompression device for compression code
JP2634793B2 (en) Color image signal encoding device
JPS6333350B2 (en)
JPS6235780A (en) Decoding device for image code
JP2774489B2 (en) Image code decoding device
JPH0439829B2 (en)
JPH07236065A (en) Binary picture compression device

Legal Events

Date Code Title Description
EXPY Cancellation because of completion of term