JP3868149B2 - Decoding method and decoding apparatus - Google Patents
Decoding method and decoding apparatus Download PDFInfo
- Publication number
- JP3868149B2 JP3868149B2 JP14506099A JP14506099A JP3868149B2 JP 3868149 B2 JP3868149 B2 JP 3868149B2 JP 14506099 A JP14506099 A JP 14506099A JP 14506099 A JP14506099 A JP 14506099A JP 3868149 B2 JP3868149 B2 JP 3868149B2
- Authority
- JP
- Japan
- Prior art keywords
- data
- code
- decoding
- code data
- waiting
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
- 238000000034 method Methods 0.000 title claims description 34
- 239000003550 marker Substances 0.000 claims description 72
- 239000000872 buffer Substances 0.000 claims description 40
- 230000015654 memory Effects 0.000 claims description 32
- 238000004891 communication Methods 0.000 claims description 18
- 230000008569 process Effects 0.000 claims description 16
- 238000012790 confirmation Methods 0.000 claims description 3
- 238000012544 monitoring process Methods 0.000 claims 1
- 238000001514 detection method Methods 0.000 description 16
- 230000005540 biological transmission Effects 0.000 description 14
- 238000012545 processing Methods 0.000 description 10
- 238000010586 diagram Methods 0.000 description 9
- 230000003111 delayed effect Effects 0.000 description 8
- 230000003139 buffering effect Effects 0.000 description 7
- 238000009825 accumulation Methods 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 230000000295 complement effect Effects 0.000 description 1
- 230000001934 delay Effects 0.000 description 1
- 230000002542 deteriorative effect Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000009467 reduction Effects 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
Images
Landscapes
- Compression Of Band Width Or Redundancy In Fax (AREA)
Description
【0001】
【発明の属する技術分野】
本発明は、JBIG(Joint Bi-level Image Coding Experts Group)方式により符号化された画像の復号化方法および復号化装置に関する。
【0002】
【従来の技術】
JBIG方式は2値画像の予測符号化に関する国際標準であり、ITU-T.82勧告あるいはITU-T.85勧告による方式が知られている。
【0003】
これらの勧告によれば、送信画像の符号化に際し、デフォルト状態では、画像データの128ラインを1ストライプとし、ストライプ単位で送受信が行われ、また、一つのストライプの終端にはSDNORMあるいはSDRSTマーカーコードが付加される。また、1画像の最後に存在する連続するゼロ(0x00)は、送信側で削除してもよいとされ、この場合、受信側で自主的に連続するゼロ(0x00)を挿入して復号化が行われる。
【0004】
また、ITU-T.85勧告によれば、JBIGデータの送信に際しては、1つの送信画像の総ライン数を付帯情報として相手に通知できるものとされ、その通知方法として、BIHと呼ばれる画像データのヘッダー部(先頭部)に総ライン数をセットする方法と、NEWLENマーカーコードを付与してここに総ライン数をセットする方法と、これらを併用する方法がある。
【0005】
NEWLENマーカーコードは、基本的には、最終ストライプに至るまでのいずれかのストライプの先頭に付与されるものであるが、ITU-T.85勧告のAmendment1(ファクシミリ装置のためのJBIG方式の修正)では、「ストライプの先頭に付与する」という条件を緩和し、「最後のストライプが終了した後に付与するという変形使用」も許容している。
【0006】
図5(a),(b)はJBIG圧縮画像を送信する際のデータフォーマットを画像イメージに即して示す図であり、(a)は、NEWLENマーカーコード(図中、NWと記載される)を最終ストライプの先頭に付与した場合を示し、(b)はNEWLENマーカーコード(NW)を最終ストライプの後に付与した場合(ITU-T.85勧告のAmendment1で許容されている変形タイプ)を示している。
【0007】
図示されるように、1画像は500ラインからなり、画像の先頭にはヘッダ(BIH)が付加されており、各ストライプ(128ライン)の終端にはSDNORMマーカーコード(図中、SDと記載される)が付加されている。
【0008】
図6は、ファクシミリで画像を読取りながら、これと並行して画像の送信を行なう場合に、JBIG圧縮データを図5(b)の形式のフォーマットで送信する場合のデータストリームの一例を示す図である。
【0009】
図6の例では、ヘッダー(BIH)には、「YD=0x00000400=(1024),L0=128,VLENGTH=1」と記載されている。これは、1画像の総ライン数(YD)として、取り得る最大値(0x00000400=1024)をとりあえず指定しておき、1ストライプのライン数(L0)を128ラインとし、そして、NEWLENマーカーコードの使用可/不可を示すVLENGTHに「1」を設定して、NEWLENマーカーコードを使用してもよいモードで送信が行なわれること意味している。そして、1ストライプ(128ライン)の終端にはSDNORMマーカーコードが付与され、全ストライプが終了した後に、NEWLENマーカーコードが付与されている。この最後のNEWLENマーカーコードの情報(NEWYD(=500))により、実際の総ライン数は500ラインであったことが明らかとなる。
【0010】
【発明が解決しようとする課題】
ITU-T.85勧告のAmendment1で許容されている、「最後のストライプが終了した後にNEWLENマーカーコードを付与するというフォーマット」を使用してファクシミリ送信をした場合、受信側において、最後に付加されているNEWLENマーカーコードの検出が遅れると、受信側では、1画像がまだ続いていると誤認識して、符号データの復号化を続行し、誤った画像が復号化されてしまうという問題が生じる。
【0011】
すなわち、図5(b)の場合を例にとると、最後のストライプは、116ラインであり、標準の128ラインに満たないが、受信側で最後のNEWLENマーカーコード(NW)の発見が遅れると、最後のストライプはまだ続いている(つまり、ストライプ端の連続するゼロ(0x00)が削除されて送信されてきた)ものと判断して、連続するゼロ(0x00)を挿入して復号化を行なうので、本来の1画像の最後に、不要な画像が付加されてしまう。
【0012】
画像をプリントする場合なら、NEWLENマーカーコードが検出された時点で1画像の正確な総ライン数が分かるから、それ以降の不要なデータを出力しないという対策をとれば、不要な画像の出力の問題はない。
【0013】
しかし、受信側(復号側)において、復号したデータをMH等の符号方式により再度、符号化したり、あるいは、復号したデータに拡大縮小処理やマスク処理を施してしまうと、1画像の最後に付加されている誤ったデータを、その後に選択的に取り除くことが困難となり、結果的に再現画像の品質が低下してしまう。
【0014】
なお、受信側において、1画像の最後に付加されているNEWLENマーカーコードの検出が遅れる要因しては、図7に示すような、受信データのバッファリングに伴う要因が考えられる。
【0015】
すなわち、図7では、モデム60を介して受信したJBIG符号データをバス(BUS)を介して2つのバッファ61,63に送り、各バッファが交互に蓄積し、その蓄積データを交互に復号化部64に出力するバッファリング方式(ダブルバッファリング方式)を採用している。
【0016】
このとき、1画像に相当する符号データがバッファ61に蓄積され、これによりバッファ61の空き容量が無くなり、最後のNEWLENマーカーコードだけがバッファ63の先頭領域に蓄積されると、バッファ63が読み出しサイクルとなるまでの間、NEWLENマーカーコードの存在を復号化部64が認識できず、その間に不要な復号化がなされることになる。なお、図7では、データの蓄積状況を視覚的に示すために、2つのバッファ61,63には、斜線を施している。
【0017】
なお、図7ではダブルバッファリングによる読み出し遅れを問題としているが、3以上のバッファをサイクリックに使用するバッファリング方式を採用する場合にも、同様の問題が生じる。
【0018】
本発明は、上述の問題点に着目してなされたものであり、ハードウエアに特別な負担をかけることなく、NEWLENマーカーコードの検出遅れに起因する不要な復号化を確実に防止することを目的とする。
【0019】
【課題を解決するための手段】
本発明では、符号データを復号器に入力する前において、NEWLENマーカーコードが遅れて到着する可能性がある場合には、待ち時間(待機期間)を設けてその到着を待つようにし、その後にデータが到着すると、その到着したのがNEWLENマーカーコードであるか否かを判定し、その後に復号器に符号データを入力するようにする。
【0020】
したがって、最後に付加されているNEWLENマーカーコードの検出が遅れる事情がある場合でも、かってに復号化が開始される事態が生じない。すなわち、1画像の終端部おいて、NEWLENマーカーコードが確実に検出された後に復号がなされるので、余分な復号化が確実に防止される。
【0021】
【発明の実施の形態】
本発明の第1の態様では、JBIG(Joint Bi-level Image Coding Experts Group)方式により符号化された符号データを復号器に入力して復号化するに際し、前記復号器への入力を待つ符号データを監視し、ストライプ端マーカーコードは検出されたが、NEWLENマーカーコードが検出されない状態が発生すると、未処理の符号データが、その後、到着する可能性の有無を判定し、到着する可能性がある場合には、その未処理の符号データが到着するのを待つ待機期間を設けると共に、その待機期間中は符号データの前記復号器への入力を停止し、前記待機期間中に前記未処理の符号データが到着すると、その符号データにNEWLENマーカーコードが含まれているかを確認し、その確認の後に前記待機期間を終了させ、待たされていた符号データを前記復号器に入力して復号を行なう。
【0022】
待機期間を設けて後続のデータの到着を待つことにより、例えば、NEWLENマーカーコードのバッファからの出力が遅延するような場合でも、その遅延を吸収することができ、NEWLENマーカーコードの検出遅れが発生しない。
【0023】
また、本発明の第2の態様では、第1の態様において、前記未処理の符号データが到着する可能性の判定を、通信回線の状況に基づく情報を用いて行う。
【0024】
第1の態様では、後続データの待ち時間を設けてNEWLENマーカーコードの到着遅れを吸収するのであるが、既に1画像の全データの通信が終了しているにもかかわらず、データの到着を待ち続けていたのでは、例えば、ヘッダ(BIH)で正確な総ライン数を指定していて、NEWLENマーカーコードを最後に付加しない場合においては、ストライプ端の符号データの復号処理がいつまでたっても開始されないという不合理が生じる。そこで、このような場合には、待つ必要がないことを外部から通知するものである。すなわち、通信回線を用いて送受信を行なう場合、送信側と受信側において、所定の通信プロトコルに従った制御情報のやり取りがなされるので、通信回線の状況から受信側(例えば、モデム)では、すでに1画像の送信が終了していることがわかるので、この場合には、復号化部に、未処理の符号データが到着する可能性がない旨を知らせるものである。
【0025】
また、本発明の第3の態様では、第1の態様または第2の態様において、復号器への入力を待つ符号データを監視し、所定の場合に待機期間を設け、到着した符号データにNEWLENマーカーコードが含まれるかを確認した後に待機期間を終了させる一連の判断と処理を、1ラインの復号化が終了してから、次の1ラインを復号化するまでの間に行なう。
【0026】
1ラインの復号化終了の後に、上述の待機動作の期間を挿入することで、ストライプ端のNEWLENマーカーコードの検出遅れが確実に防止される。
【0027】
また、本発明の第4の態様では、復号化装置は、区分けされた複数のメモリ領域を含み、かつ、前記複数のメモリ領域への入力および出力が周期的に切り替えられるバッファメモリと、このバッファメモリの前記複数のメモリ領域の各々から出力される、復号化を待つJBIG符号データを一時的に蓄積するデータバッファと、このデータバッファから出力される符号データを復号化する復号器と、前記データバッファから前記復号器へのデータの移動を制御する制御部と、を具備するデータ復号部と、を有し、前記データ復号部における前記制御部は、前記データバッファに蓄積されている符号データを監視し、ストライプ端マーカーコードは検出されたが、NEWLENマーカーコードが検出されない状態が発生すると、未処理の符号データが、その後、前記データバッファに到着する可能性の有無を判定し、到着する可能性がある場合には、その未処理の符号データが到着するのを待つ待機期間を設けると共に、その待機期間中は、前記データバッファに蓄積されている符号データの前記復号器への入力を停止させ、前記待機期間中において前記データバッファに前記未処理の符号データが到着すると、その符号データにNEWLENマーカーコードが含まれているかを確認し、その確認の後に前記待機期間を終了させ、前記データバッファに蓄積されている符号データを前記復号器へと入力させる。
【0028】
復号化待ちの符号データを蓄積するデータバッファ(待ちバッファ)を設けて、後続のデータの到着を待つことにより、NEWLENマーカーコードの到着遅れを吸収し、NEWLENマーカーコードの検出遅れを発生させないようにしたものである。構成が簡単であり、主としてソフトウエアによる判断を若干、追加,変更するだけでよく、実現が容易である。
【0029】
また、本発明の第5の態様では、第4の態様において、前記未処理の符号データが前記データバッファに到着する可能性の判定を、前記復号化装置の外部から与えられる情報に基づいて行うようにした。
【0030】
これにより、1画像の端部で、後続のデータを待つ動作が終了せずに、1画像終端部でロックしてしまうような事態が回避される。
【0031】
また、本発明の第6の態様は、第4の態様または第5の態様の復号化装置と、モデムと、を備える通信装置である。
【0032】
この通信装置によれば、ITU-T.85勧告のAmendment1で許容されている、NEWLENマーカーコードを最後に付加するようなフォーマットによる通信の場合であっても、余分な復号化を防止し、復元画像の品質が低下することを確実に防止することができる。
【0033】
次に、本発明の実施の形態について図面を参照してより具体的に説明する。
【0034】
図1は、受信側の通信装置の要部構成を示すブロック図である。
【0035】
図示されるように、受信側の通信装置20は、送信側の通信装置10から送られてくるJBIG圧縮された符号データを復調するモデム21と、受信側の通信装置20の動作を統括的に制御するホストプロセッサ22と、2つの符号バッファメモリ23,24と、符号バッファメモリのデータ転送を制御するメモリコントローラ25と、復号部26と、復号された画像データを蓄積する画像データメモリ30とを有している。
【0036】
また、復号部26は、この復号部26の動作を統括的に制御する制御部27と、FIFOメモリ28と、算術復号器29と、を具備する。
【0037】
2つの符号バッファメモリ23,24は、一方にデータがライトされている場合には他方からデータのリードが行われ、反対に、一方からデータがリードされているときには他方にデータがライトされるという相補的な関係にあり、モデム21により受信された符号データを、いわゆるダブルバッファリング形式によって一時的に蓄積するために使用されるものである。
【0038】
図7を用いて先に説明したように、メモリ領域をサイクリックに切替え使用するバッファリング方式を採用するときには、送信側で、画像を読み取りながら並行して送信をしてくる場合に、符号化された画像データと最後のNEWLENマーカーコードとが分離して各バッファに蓄積される結果を生じる危険がある。この場合には、復号部26におけるNEWLENマーカーコードの検出が遅れて、連続するゼロ(0x00)を付加した不要な復号を、NEWLENマーカーコードが検出されるまで、行なってしまうことになる。
【0039】
そこで、本実施の形態では、復号部26において、算術復号器29への入力を待つデータを一時的に蓄積するデータバッファとしてFIFOメモリ(先入れ先出しメモリ)28を設け、後続のデータが遅れて到着する可能性がある場合には、制御部27が、FIFOメモリ28のデータを算術復号器29に供給するのを中断して、後続のデータを待つようにする。これにより、NEWLENマーカーコードの到着が遅れても、その遅延を吸収することができ、NEWLENマーカーコードの検出遅れが確実に防止される。
【0040】
図2(a),(b)はそれぞれ、FIFOメモリ28におけるデータ待ち動作(待機動作)を説明するための図である。
【0041】
図2(a),(b)に示されるように、FIFOメモリ28は、B-1〜B-mのm段のレジスタからなり、(a)の状態では、B-4〜B-mには画像データが、B-3にはストライプ端に付加されるSDNORMマーカーコードがそれぞれ蓄積され、B-1とB-2にはデータが、まだ到着していない。
【0042】
この状態で、蓄積されている画像データの復号化を開始してしまうと、次にくるデータがNEWLENマーカーコードであり、しかも、そのコードが遅延して到着する場合には、その間、算術復号器29が連続するゼロ(0x00)を自発的に付加して復号を行なってしまう危険性がある。
【0043】
そこで、図2(a)の状態で、かつ、1画像分のデータが終了している旨の通知(例えば、図1のモデム21が回線状態を判定して出力するものであり、以下の明細書では符号データ入力終了通知という)が外部からない場合には、後続のデータを待つことにする。
【0044】
そして、図2(b)のように、B-1,B-2にもデータが到着すると、その到着したデータにNEWLENマーカーコードが含まれているか否かを確認し、その後、FIFOメモリ28に蓄積されているデータを算術復号器29に供給する。このような動作は、図1の制御部27によって実現される。
【0045】
図3は、本実施の形態の特徴的な一連の動作手順を示すフロー図である。図3の処理では、1ラインの復号化が終了する毎に、図2で説明したようなデータ待ちとNEWLENマーカーコードの判定処理を行なう。但し、これに限定されるものではなく、数ライン毎に行なうことも可能である。
【0046】
図3では、1ラインの復号化が終了すると(ステップ40)、まず、ストライプ端のマーカーコード(SDNORM)が検出済かどうかを調べる(ステップ41)。ストライプ端のマーカーコードが検出されていないならば、そのマーカーコードの入力を待ち(ステップ42)、マーカーコードの存在が確認されると(ステップ43)、その検出処理を行なう(ステップ44)。そして、ステップ45に移行する。また、ステップ41でストライプ端のマーカーコードが検出済であった場合にもステップ45に移行する。
【0047】
ステップ45では、NEWLENマーカーコードが検出済であるか否かを判定し、未検出のときは、符号データ入力終了通知(ここでは、図1のモデム21が、回線状態を判定して1画像分のデータの送信が完了している場合に、そのことを通知するものである)を、既に受け取っているのならばステップ48に移行し、そうでなければステップ47に移行して、後続のデータを待つループ処理(待機期間処理)を実行する。
【0048】
この後続のデータを待つ処理により、NEWLENマーカーコードが遅れて到着した場合でも、その遅延を吸収することができるのであり、この処理は極めて重要である。
【0049】
そして、後続のデータが到着すると、待機期間処理のループを抜けてステップ49に移行する。
【0050】
一方、ステップ46の判断で、すでに符号データ入力終了指定を受け取っていた場合には、後続のデータを待つループ処理を行なう必要はないため、ステップ48に移行する。このステップ46の処理があるため、後続データ待ちループ処理(ステップ46,47)が無限ループとなってしまうこと(すなわち、処理のロック)が発生しない。
【0051】
そして、未処理符号データの有無を判定し(ステップ48)、続いて、ステップ49に移行する。
【0052】
ステップ49では、後続データ待ちループ処理(ステップ46,47)中において新たに到着したデータ、あるいは、ステップ48で存在が確認された未処理の符号データに、NEWLENマーカーコードが含まれているかを検出し(ステップ49)、含まれていれば、その検出処理を行なう(ステップ50)。これにより、NEWLENマーカーコードの検出遅延が防止されたことになる。
【0053】
そして、復号化するべき次のラインデータが有れば(ステップ51)、次の復号化を開始し(ステップ53)、次のラインデータが無ければ、復号化を終了する(ステップ52)。
【0054】
このように、本実施の形態では、FIFOメモリと、ソフトウエアによる簡単な判断の追加により、1画像の最後にNEWLENマーカーコードが付加されていて、かつ、その検出が遅れる事態が生じた場合でも、その遅延を吸収して、検出遅れを防止することが可能である。また、1画像のデータが既に終了している場合には、後続のデータの到着を待つための処理ループを抜けるようになっているため、無限ループとなってロックが生じる心配もない。
【0055】
したがって、NEWLENマーカーコードの検出遅れに起因する不要な復号化を確実に防止することができ、復元画像の画質の低下が生じない。
【0056】
図4は、以上説明した構成を搭載したファクシミリ装置のハードウエア構成を示すブロック図である。
【0057】
図示されるように、ファクシミリ装置101は、ホストプロセッサ102と、MH/MR/MMR符号/復号化回路103と、解像度変換回路104と、QM(算術)符号/復号化回路105と、画像データメモリ106と、符号バッファメモリ107と、モデムなどの通信インタフェース(電話回線113等を用いた有線伝送のためのインタフェースとして機能する)108と、スキャナ等の画像入力装置111と、プリンタなどの画像記録/表示装置112と、を具備し、各ブロックは内部バス109,110を介して相互に情報の授受を行うことができる。
【0058】
本発明の復号化装置は構成が簡単であるため、小型化や低コスト化が厳しく要求されるファクシミリ装置においても十分に搭載可能である。したがって、普及型のファクシミリ装置の通信性能の向上に寄与する。なお、本発明は種々変形可能である。例えば、0x00カウンタは、出力した0x00の数をカウントするのみとし、0x00はそのまま出力するようにしてもよい。そして、ストライプ端に達したときに0x00の個数をソフトウエアに通知し、この通知を受けたソフトウエアが、符号データの末尾から、通知された個数分の0x00を削除し、末尾にストライプ端用のマーカーコードをつけるようにしてもよい。
【0059】
【発明の効果】
以上説明したように、本発明によれば、ハードウエアに特別な負担をかけることなく、NEWLENマーカーコードの検出遅れに起因する不要な復号化を確実に防止することができる。すなわち、最後に付加されているNEWLENマーカーコードの検出が遅れる事情がある場合でも、1画像の終端部おいて、NEWLENマーカーコードが検出された後に復号がなされるので、余分な復号化が確実に防止される。
【図面の簡単な説明】
【図1】本発明の実施の形態にかかる復号化装置の要部構成を示すブロック図
【図2】(a)FIFOメモリに後続のデータが到着していない状態を示す図
(b)FIFOメモリに後続のデータが到着した状態を示す図
【図3】実施の形態にかかる復号化装置の主要な動作手順を示すフロー図
【図4】本発明の構成を搭載したファクシミリ装置のハードウエア構成を示すブロック図
【図5】(a)JBIG圧縮画像を送信する際のデータフォーマット(NEWLENマーカーコードを最終ストライプの先頭に付与した例)を画像イメージに即して示す図
(b)JBIG圧縮画像を送信する際のデータフォーマット(NEWLENマーカーコードを最終ストライプの後に付与した例)を画像イメージに即して示す図
【図6】ファクシミリで画像を読取りながら、これと並行して画像の送信を行なう場合に、JBIG圧縮データを、NEWLENマーカーコードを最終ストライプの後に付与する形式のフォーマットで送信する場合のデータストリームの一例を示す図
【図7】従来技術の問題点を説明するための図
【符号の説明】
10 通信装置(送信側)
20 復号化装置(受信側通信装置)
21 モデム
22 ホストプロセッサ
23 符号バッファメモリ
24 符号バッファメモリ
25 メモリコントローラ
26 復号部
27 制御部
28 FIFOメモリ
29 算術復号部
30 画像データメモリ[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a decoding method and a decoding device for an image encoded by a JBIG (Joint Bi-level Image Coding Experts Group) method.
[0002]
[Prior art]
The JBIG system is an international standard for predictive coding of binary images, and a system based on the ITU-T.82 recommendation or the ITU-T.85 recommendation is known.
[0003]
According to these recommendations, when encoding a transmission image, in the default state, 128 lines of image data are set to one stripe, and transmission / reception is performed in units of stripes. Also, at the end of one stripe, an SDNORM or SDRST marker code is used. Is added. In addition, consecutive zeros (0x00) existing at the end of one image may be deleted on the transmission side. In this case, decoding is performed by inserting a continuous zero (0x00) on the reception side. Done.
[0004]
In addition, according to the ITU-T.85 recommendation, when transmitting JBIG data, the total number of lines of one transmission image can be notified to the other party as supplementary information. There are a method of setting the total number of lines in the header portion (leading portion), a method of assigning a NEWLEN marker code and setting the total number of lines here, and a method of using these in combination.
[0005]
The NEWLEN marker code is basically added to the beginning of one of the stripes up to the final stripe, but
[0006]
FIGS. 5A and 5B are diagrams showing a data format in transmitting a JBIG compressed image according to the image image, and FIG. 5A is a NEWLEN marker code (denoted as NW in the figure). (B) shows the case where the NEWLEN marker code (NW) is given after the last stripe (modified type allowed by
[0007]
As shown in the figure, one image consists of 500 lines, a header (BIH) is added to the head of the image, and the SDNORM marker code (SD is shown in the figure) at the end of each stripe (128 lines). Is added.
[0008]
FIG. 6 is a diagram showing an example of a data stream when JBIG compressed data is transmitted in the format of FIG. 5B when an image is transmitted in parallel with reading an image with a facsimile. is there.
[0009]
In the example of FIG. 6, “Y D = 0x00000400 = (1024), L 0 = 128, VLENGTH = 1” is described in the header (BIH). This is because the maximum number (0x00000400 = 1024) that can be taken is specified for the time being as the total number of lines (Y D ) for one image, the number of lines (L 0 ) for one stripe is set to 128 lines, and the NEWLEN marker code This means that transmission is performed in a mode in which a NEWLEN marker code may be used by setting “1” to VLENGTH, which indicates whether or not use is possible. An SDNORM marker code is assigned to the end of one stripe (128 lines), and a NEWLEN marker code is assigned after all stripes have been completed. From this last NEWLEN marker code information (NEWY D (= 500)), it becomes clear that the actual total number of lines was 500 lines.
[0010]
[Problems to be solved by the invention]
When the facsimile transmission is performed using “format that adds NEWLEN marker code after the end of the last stripe” allowed by
[0011]
That is, taking the case of FIG. 5B as an example, the last stripe is 116 lines, which is less than the standard 128 lines, but the discovery of the last NEWLEN marker code (NW) is delayed on the receiving side. Determining that the last stripe is still continuing (that is, it has been transmitted by deleting the consecutive zeros (0x00) at the end of the stripe) and performing decoding by inserting consecutive zeros (0x00) Therefore, an unnecessary image is added at the end of the original one image.
[0012]
When printing an image, the exact total number of lines in one image is known when the NEWLEN marker code is detected. If a measure is taken not to output unnecessary data after that, the problem of unnecessary image output will occur. There is no.
[0013]
However, if the receiving side (decoding side) encodes the decoded data again using a coding method such as MH, or if the decoded data is subjected to enlargement / reduction processing or mask processing, it is added to the end of one image. It is difficult to selectively remove the erroneous data that has been performed thereafter, and as a result, the quality of the reproduced image is degraded.
[0014]
As a factor that delays the detection of the NEWLEN marker code added to the end of one image on the receiving side, a factor associated with buffering received data as shown in FIG. 7 can be considered.
[0015]
That is, in FIG. 7, the JBIG code data received via the
[0016]
At this time, code data corresponding to one image is accumulated in the
[0017]
In FIG. 7, the read delay due to double buffering is a problem, but the same problem occurs when a buffering method using three or more buffers cyclically is employed.
[0018]
The present invention has been made paying attention to the above-mentioned problems, and it is an object of the present invention to reliably prevent unnecessary decoding caused by a delay in detection of a NEWLEN marker code without placing a special burden on hardware. And
[0019]
[Means for Solving the Problems]
In the present invention, when there is a possibility that the NEWLEN marker code arrives late before inputting the code data to the decoder, a waiting time (waiting period) is provided to wait for the arrival, and then the data When it arrives, it is determined whether or not the arrival is a NEWLEN marker code, and then the code data is input to the decoder.
[0020]
Therefore, even when there is a situation where the detection of the NEWLEN marker code added at the end is delayed, there is no situation in which decoding is started. That is, since decoding is performed after the NEWLEN marker code is reliably detected at the end of one image, excessive decoding is reliably prevented.
[0021]
DETAILED DESCRIPTION OF THE INVENTION
In the first aspect of the present invention, when code data encoded by JBIG (Joint Bi-level Image Coding Experts Group) is input to a decoder and decoded, the code data waits for input to the decoder. When a state occurs in which the stripe end marker code is detected but the NEWLEN marker code is not detected, it is possible that unprocessed code data will subsequently arrive, and may arrive. In this case, a waiting period is provided for waiting for the unprocessed code data to arrive, and input of code data to the decoder is stopped during the waiting period, and the unprocessed code data is stopped during the waiting period. When the data arrives, it is confirmed whether the code data includes a NEWLEN marker code, and after the confirmation, the waiting period is terminated, and the waiting code data is input to the decoder. Performs decoding.
[0022]
By waiting for the arrival of subsequent data by providing a waiting period, for example, even if the output from the buffer of the NEWLEN marker code is delayed, the delay can be absorbed and a detection delay of the NEWLEN marker code occurs do not do.
[0023]
According to a second aspect of the present invention, in the first aspect, the possibility of arrival of the unprocessed code data is determined using information based on the state of the communication line.
[0024]
In the first mode, the delay of arrival of the NEWLEN marker code is absorbed by setting a waiting time for the subsequent data, but the arrival of data is awaited even though communication of all data of one image has already been completed. For example, if the exact total number of lines is specified in the header (BIH) and the NEWLEN marker code is not added at the end, the decoding process of the code data at the stripe end will not start any time. The unreasonable that occurs. Therefore, in such a case, it is notified from the outside that there is no need to wait. That is, when transmission / reception is performed using a communication line, control information is exchanged according to a predetermined communication protocol between the transmission side and the reception side. Since it is understood that the transmission of one image has been completed, in this case, the decoding unit is notified that there is no possibility that unprocessed code data will arrive.
[0025]
Also, in the third aspect of the present invention, in the first aspect or the second aspect, the code data waiting for input to the decoder is monitored, a waiting period is provided in a predetermined case, and NEWLEN is added to the arrived code data. A series of determinations and processes for ending the waiting period after confirming whether a marker code is included are performed after the decoding of one line is completed and until the next one line is decoded.
[0026]
By inserting the period of the above-described standby operation after the end of decoding of one line, detection delay of the NEWLEN marker code at the stripe end is surely prevented.
[0027]
In the fourth aspect of the present invention, the decoding device includes a plurality of partitioned memory areas, and a buffer memory in which input and output to the plurality of memory areas are periodically switched, and the buffer A data buffer for temporarily storing JBIG code data waiting for decoding, output from each of the plurality of memory areas of the memory, a decoder for decoding code data output from the data buffer, and the data A control unit that controls movement of data from a buffer to the decoder, and the control unit in the data decoding unit stores the code data stored in the data buffer. When a state occurs in which the stripe end marker code is detected but the NEWLEN marker code is not detected, the unprocessed code data is Determining whether or not there is a possibility of arrival in the data buffer, and if there is a possibility of arrival, a waiting period is provided for waiting for the unprocessed code data to arrive, and during the waiting period, When input of the code data stored in the data buffer to the decoder is stopped and the unprocessed code data arrives in the data buffer during the waiting period, the code data includes a NEWLEN marker code. After the confirmation, the waiting period is terminated, and the code data stored in the data buffer is input to the decoder.
[0028]
By providing a data buffer (wait buffer) that stores code data that is waiting for decoding and waiting for the arrival of subsequent data, the arrival delay of the NEWLEN marker code is absorbed and the detection delay of the NEWLEN marker code is not generated. It is a thing. The configuration is simple, and it is only necessary to add or change some judgments mainly by software.
[0029]
According to a fifth aspect of the present invention, in the fourth aspect, the possibility of the unprocessed code data arriving at the data buffer is determined based on information given from outside the decoding apparatus. I did it.
[0030]
This avoids a situation in which the operation of waiting for subsequent data at the end of one image does not end and the end of one image is locked.
[0031]
According to a sixth aspect of the present invention, there is provided a communication device including the decoding device according to the fourth or fifth aspect and a modem.
[0032]
According to this communication device, even in the case of communication in a format that allows a NEWLEN marker code to be added at the end, which is permitted by
[0033]
Next, embodiments of the present invention will be described more specifically with reference to the drawings.
[0034]
FIG. 1 is a block diagram illustrating a configuration of a main part of a communication device on the receiving side.
[0035]
As shown in the figure, the
[0036]
In addition, the decoding unit 26 includes a
[0037]
The two
[0038]
As described above with reference to FIG. 7, when the buffering method in which the memory area is cyclically switched is used, the encoding is performed when the transmission side transmits in parallel while reading the image. There is a risk that the processed image data and the last NEWLEN marker code are separated and accumulated in each buffer. In this case, detection of the NEWLEN marker code in the decoding unit 26 is delayed, and unnecessary decoding with consecutive zeros (0x00) added is performed until the NEWLEN marker code is detected.
[0039]
Therefore, in the present embodiment, in the decoding unit 26, a FIFO memory (first-in first-out memory) 28 is provided as a data buffer for temporarily storing data waiting for input to the
[0040]
FIGS. 2A and 2B are diagrams for explaining a data wait operation (standby operation) in the
[0041]
As shown in FIGS. 2A and 2B, the
[0042]
If decoding of the stored image data is started in this state, the next data is a NEWLEN marker code, and if that code arrives with a delay, an arithmetic decoder is used during that time. There is a risk that decoding will be performed by spontaneously adding zeros (0x00) in which 29 continues.
[0043]
Therefore, in the state of FIG. 2A, a notification that data for one image has been completed (for example, the
[0044]
Then, as shown in FIG. 2 (b), when data arrives at B-1 and B-2, it is confirmed whether or not the NEWLEN marker code is included in the arrived data. The accumulated data is supplied to the
[0045]
FIG. 3 is a flowchart showing a series of characteristic operation procedures of the present embodiment. In the process of FIG. 3, every time decoding of one line is completed, the data wait and the NEWLEN marker code determination process as described in FIG. 2 are performed. However, the present invention is not limited to this, and it can be performed every several lines.
[0046]
In FIG. 3, when the decoding of one line is completed (step 40), it is first checked whether or not the stripe end marker code (SDNORM) has been detected (step 41). If the marker code at the stripe end is not detected, input of the marker code is awaited (step 42). When the presence of the marker code is confirmed (step 43), the detection process is performed (step 44). Then, the process proceeds to step 45. If the marker code at the stripe end has been detected in
[0047]
In
[0048]
Even if the NEWLEN marker code arrives late by this process of waiting for subsequent data, the delay can be absorbed, and this process is extremely important.
[0049]
When the subsequent data arrives, the process exits the standby period processing loop and proceeds to step 49.
[0050]
On the other hand, if it is determined in
[0051]
Then, the presence / absence of unprocessed code data is determined (step 48), and then the process proceeds to step 49.
[0052]
In
[0053]
If there is next line data to be decoded (step 51), the next decoding is started (step 53). If there is no next line data, the decoding is terminated (step 52).
[0054]
As described above, in this embodiment, even when a new memory marker code is added to the end of one image and the detection is delayed due to the addition of the FIFO memory and simple determination by software. It is possible to absorb the delay and prevent a detection delay. Further, when the data of one image has already been completed, the processing loop for waiting for the arrival of the subsequent data is exited, so that there is no concern that a lock will occur due to an infinite loop.
[0055]
Therefore, unnecessary decoding due to the detection delay of the NEWLEN marker code can be surely prevented, and the quality of the restored image does not deteriorate.
[0056]
FIG. 4 is a block diagram showing a hardware configuration of a facsimile machine equipped with the configuration described above.
[0057]
As shown in the figure, a facsimile apparatus 101 includes a
[0058]
Since the decryption apparatus of the present invention has a simple configuration, it can be sufficiently installed in a facsimile apparatus that is strictly required to be downsized and reduced in cost. Therefore, it contributes to the improvement of the communication performance of the popular facsimile machine. The present invention can be variously modified. For example, the 0x00 counter may only count the number of output 0x00 and output 0x00 as it is. When the stripe end is reached, the number of 0x00 is notified to the software, and the software that has received this notification deletes the number of 0x00 for the number of notifications from the end of the code data, and at the end for the stripe end You may make it attach the marker code of.
[0059]
【The invention's effect】
As described above, according to the present invention, it is possible to reliably prevent unnecessary decoding due to a delay in detecting the NEWLEN marker code without imposing a special burden on hardware. In other words, even when there is a situation where the detection of the NEWLEN marker code added at the end is delayed, decoding is performed after the NEWLEN marker code is detected at the end of one image, so that extra decoding is ensured. Is prevented.
[Brief description of the drawings]
FIG. 1 is a block diagram showing a main configuration of a decoding apparatus according to an embodiment of the present invention. FIG. 2 (a) is a diagram showing a state in which subsequent data has not arrived at the FIFO memory. FIG. 3 is a flowchart showing the main operation procedure of the decoding apparatus according to the embodiment. FIG. 4 shows the hardware configuration of a facsimile apparatus equipped with the configuration of the present invention. [FIG. 5] (a) A diagram showing a data format (example in which a NEWLEN marker code is added at the beginning of the last stripe) when transmitting a JBIG compressed image according to the image image. (B) A JBIG compressed image. Fig. 6 shows the data format for transmission (example in which NEWLEN marker code is added after the last stripe) in line with the image image. Fig. 6 FIG. 7 is a diagram showing an example of a data stream when JBIG compressed data is transmitted in a format in which a NEWLEN marker code is added after the last stripe when performing communication. Figure [Explanation of symbols]
10 Communication device (transmission side)
20 Decoding device (receiving side communication device)
21
Claims (6)
前記復号器への入力を待つ符号データを監視し、ストライプ端マーカーコードは検出されたが、NEWLENマーカーコードが検出されない状態が発生すると、未処理の符号データが、その後、到着する可能性の有無を判定し、到着する可能性がある場合には、その未処理の符号データが到着するのを待つ待機期間を設けると共に、その待機期間中は符号データの前記復号器への入力を停止し、前記待機期間中に前記未処理の符号データが到着すると、その符号データにNEWLENマーカーコードが含まれているかを確認し、その確認の後に前記待機期間を終了させ、待たされていた符号データを前記復号器に入力して復号を行なうことを特徴とする復号化方法。When decoding by inputting code data encoded by JBIG (Joint Bi-level Image Coding Experts Group) method to the decoder,
The code data waiting for input to the decoder is monitored, and if a stripe end marker code is detected but a NEWLEN marker code is not detected, there is a possibility that unprocessed code data will arrive later And a waiting period for waiting for the unprocessed code data to arrive, and stopping the input of the code data to the decoder during the waiting period, When the unprocessed code data arrives during the waiting period, it is confirmed whether the code data includes a NEWLEN marker code, and after the confirmation, the waiting period is ended, and the waiting code data is A decoding method, wherein the decoding is performed by inputting to a decoder.
このバッファメモリの前記複数のメモリ領域の各々から出力される、復号化を待つJBIG符号データを一時的に蓄積するデータバッファと、このデータバッファから出力される符号データを復号化する復号器と、前記データバッファから前記復号器へのデータの移動を制御する制御部と、を具備するデータ復号部と、を有し、
前記データ復号部における前記制御部は、前記データバッファに蓄積されている符号データを監視し、ストライプ端マーカーコードは検出されたが、NEWLENマーカーコードが検出されない状態が発生すると、未処理の符号データが、その後、前記データバッファに到着する可能性の有無を判定し、到着する可能性がある場合には、その未処理の符号データが到着するのを待つ待機期間を設けると共に、その待機期間中は、前記データバッファに蓄積されている符号データの前記復号器への入力を停止させ、前記待機期間中において前記データバッファに前記未処理の符号データが到着すると、その符号データにNEWLENマーカーコードが含まれているかを確認し、その確認の後に前記待機期間を終了させ、前記データバッファに蓄積されている符号データを前記復号器へと入力させることを特徴とする復号化装置。A buffer memory including a plurality of partitioned memory areas, and the input and output to the plurality of memory areas being periodically switched;
A data buffer for temporarily storing JBIG code data waiting for decoding, output from each of the plurality of memory areas of the buffer memory, and a decoder for decoding the code data output from the data buffer; A data decoding unit comprising: a control unit that controls movement of data from the data buffer to the decoder;
The control unit in the data decoding unit monitors the code data stored in the data buffer, and if a stripe end marker code is detected but a NEWLEN marker code is not detected, unprocessed code data is generated. Thereafter, it is determined whether or not there is a possibility of arrival in the data buffer, and if there is a possibility of arrival, a waiting period is provided for waiting for the unprocessed code data to arrive, and during the waiting period Stops the input of the code data stored in the data buffer to the decoder, and when the unprocessed code data arrives in the data buffer during the waiting period, a NEWLEN marker code is added to the code data. The code stored in the data buffer is confirmed after confirming whether the waiting period is ended. Decoding apparatus characterized by inputting the over data to the decoder.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP14506099A JP3868149B2 (en) | 1999-05-25 | 1999-05-25 | Decoding method and decoding apparatus |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP14506099A JP3868149B2 (en) | 1999-05-25 | 1999-05-25 | Decoding method and decoding apparatus |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2000341534A JP2000341534A (en) | 2000-12-08 |
| JP3868149B2 true JP3868149B2 (en) | 2007-01-17 |
Family
ID=15376461
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP14506099A Expired - Fee Related JP3868149B2 (en) | 1999-05-25 | 1999-05-25 | Decoding method and decoding apparatus |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP3868149B2 (en) |
Families Citing this family (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP3467216B2 (en) | 1999-10-12 | 2003-11-17 | シャープ株式会社 | Image decoding device |
| CN118368036B (en) * | 2024-06-20 | 2024-08-20 | 北京长亭科技有限公司 | Stream type self-adaptive depth decoding method and device |
-
1999
- 1999-05-25 JP JP14506099A patent/JP3868149B2/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| JP2000341534A (en) | 2000-12-08 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US6434746B1 (en) | Accounting in an image transmission system based on a transmission mode and an accounting mode based on the transmission mode | |
| JP3373130B2 (en) | Image decoding device | |
| US5105382A (en) | Frame transmitting method of a telematic terminal | |
| JP3868149B2 (en) | Decoding method and decoding apparatus | |
| KR100547146B1 (en) | Image processing apparatus and method | |
| US4792648A (en) | Telematic reception terminal | |
| JP3868148B2 (en) | Code data output device | |
| JP2000341486A (en) | Method for buffering code data and decoder | |
| JPH04301940A (en) | Data communication equipment | |
| JP3949012B2 (en) | Data transmission / reception method, transmitter, receiver, and transmitter / receiver | |
| JP3279736B2 (en) | Image communication device | |
| JPH11317946A (en) | Image communication method, image communication system, and recording medium storing image communication program | |
| JPS632393B2 (en) | ||
| JP3244793B2 (en) | Data communication device | |
| JP3635862B2 (en) | Communication terminal device | |
| JP2002077636A (en) | Decoding device, decoding device control method, encoding / decoding device, encoding / decoding device control method, and image processing device | |
| JP3685129B2 (en) | Communication terminal device | |
| JP3389699B2 (en) | Facsimile machine | |
| JP2839880B2 (en) | Facsimile machine | |
| JP3026634B2 (en) | Facsimile machine | |
| JPH04177972A (en) | Facsimile communication system | |
| JPH05115009A (en) | Color image transmitter | |
| JPS61169069A (en) | Facsimile reception data processing system | |
| JPH08307619A (en) | Image communication device | |
| JP2001245124A (en) | Image communications equipment |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20060523 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20060711 |
|
| A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20060905 |
|
| TRDD | Decision of grant or rejection written | ||
| A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20061003 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20061010 |
|
| R150 | Certificate of patent or registration of utility model |
Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20091020 Year of fee payment: 3 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20101020 Year of fee payment: 4 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20111020 Year of fee payment: 5 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20121020 Year of fee payment: 6 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20131020 Year of fee payment: 7 |
|
| LAPS | Cancellation because of no payment of annual fees |