JP4006351B2 - Image processing method, image processing apparatus, computer program, and computer-readable storage medium - Google Patents

Image processing method, image processing apparatus, computer program, and computer-readable storage medium Download PDF

Info

Publication number
JP4006351B2
JP4006351B2 JP2003092823A JP2003092823A JP4006351B2 JP 4006351 B2 JP4006351 B2 JP 4006351B2 JP 2003092823 A JP2003092823 A JP 2003092823A JP 2003092823 A JP2003092823 A JP 2003092823A JP 4006351 B2 JP4006351 B2 JP 4006351B2
Authority
JP
Japan
Prior art keywords
encoding
pixel block
unit
data
pixel
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2003092823A
Other languages
Japanese (ja)
Other versions
JP2004304361A (en
JP2004304361A5 (en
Inventor
清 梅田
信孝 三宅
信二郎 堀
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
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 JP2003092823A priority Critical patent/JP4006351B2/en
Publication of JP2004304361A publication Critical patent/JP2004304361A/en
Publication of JP2004304361A5 publication Critical patent/JP2004304361A5/ja
Application granted granted Critical
Publication of JP4006351B2 publication Critical patent/JP4006351B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Description

【0001】
【発明の属する技術分野】
本発明は画像データを圧縮符号化技術に関するものである。
【0002】
【従来の技術】
従来より、画像情報を複数の領域に分割し、それぞれの領域に対して適した符号化法(ハイブリッド符号化法)を適用することにより、符号化効率の向上を実現する方法が数多く提案されている。
【0003】
ここで、ハイブリッド符号化で採用する符号化の種類としては、デジタルカメラで撮像された自然画等の中間調領域についてはJPEG符号化、文字・線画といった領域についてはランレングス符号化を行うのが一般的であろう。
【0004】
【発明が解決しようとする課題】
ところで、昨今のプリンタは記録解像度が1000dpiを越えるものが存在し、ホストコンピュータからプリンタへ出力する画像データの情報量は大きなものとなる。特に、カラープリンタの場合には、色成分の数だけ増えることになり、その情報量は膨大なものとなる。従って、かかるプリントシステムに上記のようなハイブリッド符号化法を適用することが望まれる。
【0005】
かかるシステムを考察した場合に問題となるのは、例えば、プリンタがインクジェットプリンタのような場合、基本的には記録ヘッドを搭載したキャリッジを走査運動を行ない印刷するものであるから、少なくともそのプリンタには1走査分の記録イメージを展開するメモリを必要とするのは勿論であるが、復号処理に十分なバッファメモリを必要とする。
【0006】
本発明は可逆符号化データ及び不可逆符号化データの混在した符号化画像データの復号に要するメモリ量を削減する技術を提供しようとするものである。
【0007】
【課題を解決するための手段】
かかる課題を解決するため、例えば本発明の画像処理方法は以下の工程を備える。すなわち、
画像データを画素ブロック単位に符号化する画像処理方法であって、
画像データを第1の符号化アルゴリズムで符号化する第1の符号化工程と、
前記画像データの画素ブロック単位に前記第1の符号化工程を行うか否かを判定工程と、
該判定工程で前記第1の符号化工程で符号化すると判定した場合、前記第1の符号化工程により符号化して得られた画素ブロックの符号化データを一時的に蓄積する第1の蓄積工程と、
前記第1の符号化工程で符号化の対象となった画素ブロック内の全画素値を予め設定された値で置換える置換え工程と、
該置換え後の画素ブロック、及び、前記判定工程で第1の符号化工程で行わないと判定された画素ブロックを第2の符号化アルゴリズムで符号化する第2の符号化工程と、
前記第1の蓄積工程で蓄積された符号化データを、前記第2の符号化工程により符号化して得られた符号化データよりも、予め設定された単位だけ遅らせて出力する出力工程とを備える。
【0008】
【発明の実施の形態】
以下、添付図面に従って本発明に係る実施形態を詳細に説明する。
【0009】
先ず、本願発明者が検討したハイブリッド符号化法の概要を説明することとする。
【0010】
図1は本願発明者によるハイブリッド符号化法のブロック図を示している。同図では、画像に適用する複数の符号化法として、可逆符号化法であるランレングス符号化102と、非可逆符号化法であるJPEG符号化部103の2種類を用意している。入力端子100から入力された画像は、まずプレーン分割部101においてプレーン分割処理が行われる。具体的には、画像を任意サイズの小ブロック(例えば8×8の正方ブロックで、以降画素ブロックと言う)に分割し、この画素ブロックをあらかじめ定められた条件に従って、前記2種類の符号化法のうち、どちらの符号化を行うべきかという判定を行う。例えば、ブロック内の最大、最小濃度値の差を求め、この差がある一定値より大きい場合、ブロック内には文字部やエッジ部が含まれていると考え、このようなブロックには無歪符号化(可逆符号化)、すなわち図1の例であればランレングス符号化部102による符号化を行わせる。また上記条件に適合しない場合は、非可逆であるものの、より圧縮率の高いJPEG符号化を行う。なお、ランレングス符号化やJPEG符号化のアルゴリズムに関しては、広く知られるところであるため、ここでの詳細な説明は省略する。
【0011】
図2はプレーン分割処理の概念図を示している。図1の例ではJPEGを用いるため、図2では画像を画素ブロックに分割し、各ブロック単位でプレーン分割処理を行っている。同図において、斜線で示したブロックが、前記判定により、JPEG符号化を行うべきであると判断されたブロックである。このようなブロックは原画像から抽出され、原画像とは別の201に示すようなJPEGプレーンを構成する。なお、ブロックが抽出された原画像の該当する領域(8×8画素領域)は、任意の値、たとえば(R,G,B)=(255,255,255)で埋めることでランレングスプレーンとする。これにより、JPEGで符号化すると判定された画素ブロック位置の領域については、ランレングス符号化の効率を極限まで高める。
【0012】
このような処理により生成された2つの画像情報(プレーン)は、それぞれランレングス符号化部102とJPEG符号化部103に入力され、圧縮符号化される。
【0013】
圧縮符号化されたデータはフォーマット形成部110に入力され、図3に示したようなフォーマットを形成した後、出力端子から出力する。同図に示したフォーマットでは、図2に示したラスターユニット(同図では8ライン単位)毎に、ランレングスデータ、JPEGブロック位置情報、JPEGデータの3種類のデータを交互に転送するようになっている。ここでJPEGブロック位置情報とは、図2において示された各ブロックに対して割り当てられた1ビットの識別情報であり、プレーン分割部101でJPEGプレーンに分類されたブロックには“1”を、ランレングスプレーンに分類されたブロックには“0”を割り当てる。この1ビットの情報により、復号化側では、復号したJPEGブロックをランレングスプレーン上に合成することが可能となる。
【0014】
出力された画像情報はメモリやハードディスク等の記憶装置に保存されたり、通信路を介して別のコンピュータやデバイスに転送される。
【0015】
上記処理で生成された符号化データを受信し、復号する装置としては、例えば図4のような構成のプリンタを考えた。ここで、400はプリンタ装置であり、401は装置全体の制御を司るCPU、402は印刷処理(復号処理を含む)を行うためのプログラムを格納しているROMである。403は各種バッファ及びCPU401のワークエリアとして使用するRAMである。404はホストコンピュータからの印刷データ(ハイブリッド符号化法で圧縮符号化された画像データ)を受信するためのインタフェース、405はインク液滴を吐出するプリンタエンジンである。ただし、印刷方式はこれに限らず、他の方式でも構わない。
【0016】
図5は図4の構成における、復号処理に係る機能を模試的に示す構成である。以下に説明する構成は、プログラムモジュールであると考えると分かり易いが、ハードウェアでもって実現しても構わないのは勿論である。
【0017】
図5において、入力端子500から入力された符号化情報のうち、ランレングス、およびJPEGの符号化データは、それぞれの復号化部に入力され、各プレーンの復号化処理が行われる。次にプレーン合成部509において、復号化されたランレングスプレーンに対し、復号化されたJPEGプレーンの各ブロックを合成することにより、原画像を再構成する。
【0018】
上記ハイブリッド符号化及びその復号方法は様々な用途に応用でき、例としてはホストコンピュータにおけるプリンタドライバの一部に上記符号化方法を適用し、プリンタ内では上記復号方法を適用した処理を行うことが考えられ、それら2者間に流れる画像データに適用して、情報量を削減することが可能となる。
【0019】
ところで、ランレングス符号化の中には、符号化したい注目画素と同一か否かの比較を行う参照画素の位置が、図6に示すように左方に加え上方に持つものも存在する。すなわち、左方だけでなく、上方のある任意の位置と注目画素を比較し、同一濃度値であれば、連続する画素の数を符号として出力するようなランレングス符号化も存在する。さらに、参照画素位置は注目画素と隣接しているとは限らず、同図に示すように、数画素離れている場合も考えられる。このような場合には、復号装置内で合成結果の画像を保存するためのバッファメモリとは別に、復号化したJPEGブロックを保存するためのバッファメモリも必要となる。
【0020】
上記問題点について図示したものが図7である。同図は復号化装置内部のバッファメモリの利用状況を示しており、700が最終的な合成画像を保存するためのバッファメモリ、701が復号化したJPEGブロックを保存しておくためのバッファメモリである。図3に示したようなフォーマットで符号化装置から復号化装置に画像情報が転送された場合、復号化側ではまず「01」ラスターユニットのランレングス符号化データを復号化し、バッファメモリ700の先頭から格納する。次に、「01」ラスターユニットのJPEGデータを復号化することになるが、復号化した画像ブロックを直ちにバッファメモリ700上に合成することはできない。なぜなら、「02」ラスターユニットのランレングスデータが上方参照を用いて符号化されている場合、JPEGブロックを合成する前の「01」ラスターユニットを参照する必要があるからである。よって、「01」ラスターユニットのJPEGブロックは、「02」ラスターユニットのランレングスデータを復号化した後に合成される必要があるため、その間、一時的に図7に示したJPEG復号化用のバッファメモリ701に蓄積しておく必要がある。より分かりやすく説明すると、JPEG符号を行うと判断された画素ブロックの存在していた領域は、所定値で置き換わっており、この所定値を参照してランレングス符号化を行っていることが有り得るからである。
【0021】
このようなハイブリッド符号化法を、例えばホストコンピュータとプリンタ間に流れる画像情報に適用した場合、復号化装置はプリンタ内部に組み込む必要がある。ここで、プリンタがインクジェットプリンタであって、印字可能幅を20cmとし、印刷解像度を600dpiとした場合、図7に示したJPEG復号化用のメモリバッファは、約111KB必要ということになり、復号化装置が使用可能なリソース(メモリ)が少ない場合に適用できないことになる。
【0022】
また、図7によれば、JPEG復号化モジュールから出力されたJPEGブロックを一度バッファメモリ701に蓄積しておき、さらに合成するためにバッファメモリ700にコピーする処理が必要があるため、処理速度の観点からも問題と成り得る。
【0023】
本実施形態では、かかる問題点も一掃する。このため、図1のフォーマット形成部110においては、図8に示すようなフォーマットのデータを形成する。
【0024】
同図では、データ系列の先頭にヘッダ部が生成されている。このヘッダ部には圧縮符号化対象となる画像のサイズや画素あたりの階調数、一つのラスターユニットが何ラインで構成されているか等の情報が含まれている。続いて符号化後の2種類の画像情報が格納されるが、本実施形態の特徴として、ランレングスデータのみ、他の情報に対して1ラスターユニット分先行している。このようにフォーマットを形成することにより、前記問題点を解決することが可能となる。尚、1ラスターユニットだけ先行させるのは、注目画素を符号化する際に、参照する画素位置が1ラスタユニット以内にあるとした場合である。
【0025】
図9は、本実施形態における復号化装置内部のメモリの使用状況を示すものである。復号化手順を以下に説明する。
【0026】
図8に示すデータ系列を受信した復号化装置は、まずヘッダ部を解析し、次に「01」ラスターユニットのランレングスデータの復号化を行う。復号化された画像は、図9に示すバッファメモリ900の先頭部に格納する。次に復号化装置は、後続する「02」ラスターユニットのランレングスデータの復号化を行う。この際に「01」ラスターユニットの画素を参照(上方参照)する可能性があるが、「01」ラスターユニット内にはJPEGブロックが合成されていないため、問題なく復号することが可能である。その結果、得られた画像情報は、合成画像用バッファメモリに上記「01」ラスターユニットの復号化画像情報に続いて格納される。次に復号化装置は、後続する「01」ラスターユニットのJPEGデータを復号化し、「01」ラスターユニットのJPEGブロック位置情報を参照しながら、合成画像用バッファの「01」ラスターユニット部分にブロック単位で合成してゆく。このように、JPEGブロックの合成を、ランレングスデータの復号化に対して、常に1ラスターユニット分遅延させて行う。この結果、復号処理を行う側(実施形態ではプリンタ)では、受信したJPEGのデータを、復号してダイレクトにバッファ900の該当する位置に上書きできることなり、従来必要であったJPEG復号化用バッファメモリが不要、もしくは少なくできる。また、特に、合成画像用バッファメモリにJPEGブロックを直接合成する場合には、1画素ブロックのJPEG符号化データを格納するメモリがあれば良くなり、JPEG復号化用の別途バッファメモリは不要になり、尚且つ、そこからのコピー処理も不要とすることができるようになる。
【0027】
以上の説明からもわかるように、復号する側(実施形態ではプリンタ)では、1ラスタユニットだけ先行して受信したランレングス符号化データを受信することになるので、基本的には、受信した順にランレングス符号化データについてはランレングス復号処理し、JPEG符号化した位置については、その後に受信するJPEG符号化データに従って復号結果をダイレクトに該当する位置に上書きするだけで良い。換言すれば、上記処理の特徴となる処理の主要部分は符号化する側にあると言える。
【0028】
符号化する側の処理は、先に説明したようにホストコンピュータ上で動作するコンピュータプログラムで実現できる。そこで、上記機能を実現する具体的な構成と処理手順を図13、図14に従って以下に説明する。なお、以下の説明では、プリンタドライバに適用した例について説明することとする。
【0029】
図13はホストコンピュータのブロック構成図であり、一般のパーソナルコンピュータ等の汎用情報処理装置の構成で構わない。図示において、1301は装置全体の制御を司るCPUであり、1302はブートプログラム及びBIOS等を記憶しているROMである。1303はCPU1301のワークエリアとして使用するRAMであって、ここにOSやアプリケーション、並びにプリンタドライバがロードされ実行されることになる(図示のランレングスバッファ、JPEGバッファ、flagバッファについては、図14のフローチャートの説明で明らかにする)。1304はOS、アプリケーション、各種データファイル、プリンタドライバを記憶しているハードディスクである。1305はキーボードやポインティングデバイス(PD)であり、1306はビデオメモリを内蔵し、表示しようとするイメージのビデオメモリへの描画並びにビデオメモリからのデータを読み込みビデオ信号として出力する表示制御部、1307はビデオ信号に従って画像を表示する表示装置である。そして、1308はI/Oインタフェースであり、プリンタと接続するためのものである。なお、プリンタがネットワークに上に存在する場合には、同インタフェースはネットワークインタフェースとなる。
【0030】
さて、上記構成において、アプリケーションを実行させ、印刷処理を行うと、、プリンタドライバは印刷イメージを生成し、その生成した印刷イメージの圧縮符号化を行ない、その結果をOSに渡すことで、I/Oインタフェース1308を介してプリンタに図8に示す形式のデータを出力することになる。
【0031】
図14は、このプリンタドライバの圧縮処理の手順を示すフローチャートである。なお、この圧縮符号化処理を開始するに当たって、RAM1303にランレングス符号化したデータを一時的に格納するためのランレングスバッファ、JPEG圧縮したデータを一時的に格納するためのJPEGバッファ、及び、位置情報(該当する画素ブロックがランレングス符号化する場合には0、JPEG符号化する場合には1)を格納するflagバッファが確保される。
【0032】
また、各ランレングスバッファは1ラスタユニット分だけ確保し、flagバッファ及びJPEGバッファは2ラスタ分だけ確保すれば十分である。また、着目しているラスタに対する符号化する順序は1次元である。以下の説明ではflag(i,j)等と2次元として説明するが、これは便宜的なものであることに注意されたい。
【0033】
先ず、ステップS1401において、ヘッダ部を生成し、その出力する処理を行う。次いで、ステップS1402、S1403で変数i、jを共に1に初期化する。変数iは何番目のラスタユニットであるかを示す情報を格納し、変数jは着目している画素ブロックがラスタユニット中の何番目かを示す情報を格納するものである。
【0034】
次いで、ステップS1404に進んで、flagバッファ中の(i,j)を0に初期化する。要するに、注目画素ブロックの位置は(i,j)と表現できるので、その画素ブロックについてはランレングス符号化したものとしてセットすることを意味する。
【0035】
次いで、ステップS1405に進み、注目画素ブロックはJPEG符号化すべきか、ランレングス符号化すべきかを判断する。この判断は先に説明したようにして行うこととし、ここでの詳述は省略する。
【0036】
JPEG符号化すべきであると判断した場合には、ステップS1406に進み、flag(i,j)を1にセットし直し、ステップS1407でJPEG圧縮符号化を行う。生成された符号化データは、JPEGバッファに格納(蓄積)する。この結果、オリジナル画像中の注目画素ブロックの領域は、用済みであるのでRGBそれぞれの値を所定値(実施形態では255)で埋める(ステップS1408)。
【0037】
この後、ステップS1409に進み、注目画素ブロックについてラインレングス符号化を行う。ここで注意したい点は、このステップS1409の処理は、ステップS1405でNoと判断した場合と、ステップS1408から以降した場合の2種類あることである。後者の場合、画素ブロック内の全ての画素値が一律同じ値になっているので、ランレングス符号化の符号化効率は最大限となる。
【0038】
処理がステップS1409に進むと、注目画素ブロックの位置がラスタユニットの終端位置にあるか否かを変数jを調べることで判定する。途中であると判断した場合には、ステップS1411に進み、次の位置の画素ブロックに対する処理を行うべく、変数jを1つインクリメントし、ステップS1404に戻ることになる。
【0039】
また、ステップS1410で、1ラスタユニット分の符号化処理が完了したと判断した場合には、ステップS1412に進み、ランレングスバッファには1ラスタユニット分のランレングス符号化データが格納されていることになるので、その符号データを出力する。
【0040】
ステップS1413に処理が進むと、変数iは1であるか否か、すなわち、s最初のラスターユニットの符号化処理であったか否かを判断する。最初のラスタユニットのデータの場合、図8に示すようにランレングス符号化データのみを出力することになるので、ステップS1416に進み、次のラスタユニットの符号化を行うべく、変数iを1だけインクリメントし、ステップS1403に戻る。このとき、flagバッファ、JPEGバッファには、前回、すなわち、i−1番目のラスターユニットに対応するデータが格納されていることになることに注意されたい。
【0041】
上記のようにして2番目以降のラスタユニットの符号化を行ない、そのランレングス符号化データの出力処理が完了すると、ステップS1413での判定処理ではiは1以外となり、ステップS1414に進むことになる。このステップS1414に処理が進むと、ステップS1412で第i番目のランレングス符号化データの出力に続いて、第i−1番目に生成されたflagデータ並びに第i−1番目のJPEG符号化データを出力することになる。
【0042】
処理がステップS1415に進むと、変数iを調べて最終ラスタユニットに対する処理が終了したか否かを判断し、否の場合には、ステップSステップS1416を経て、ステップS1403に戻ることになる。
【0043】
また、ステップS1415において、変数iが最終ラスタを示すと判定された場合、flagバッファ、JPEGバッファには第i番目のデータが未出力状態で残っていることになるので、ステップS1417でその出力処理を行い、本処理を終了することになる。
【0044】
以上の結果、図8に示したデータフォーマットに従った印刷データの出力がなされることになる。なお、ランレングス符号化は、画素ブロック単位に行うのではなく、ラスタユニット単位に行っても構わない。この場合には、ステップS1409の処理をステップS1401の直後で行えば良い。
【0045】
<第2の実施形態>
上記第1の実施形態では、JPEGの処理単位が8画素正方ブロックであるため、1つのラスターユニットが8ラインで構成されていた。これに対し、本第2の実施形態では図10に示すように、1つのラスターユニットが8×3=24ラインで構成されている場合のデータ系列生成方法について述べる。つまり、記録ヘッドが縦24のノズルを有している場合である。なお、第1の実施形態で一つのラスターユニットを構成していた8ラインを、本実施形態ではバンドと呼ぶこととする。
【0046】
本第2の実施形態では、図6に示すランレングス符号化の上方参照画素の位置が、注目画素と8画素以上離れないこととする。この場合、図10に示す「02」ラスターユニットの01バンドを正しく復号化するためには、復号化時に「01」ラスターユニットの「03」バンド上にJPEGブロックが合成されていないことが条件となる。そこで本第2の実施形態では、図1のフォーマット形成部110において図11に示すようなデータ系列を生成する。図11のデータ系列では、第1の実施形態と同様、先頭にヘッダ部が存在し、次に「01」ラスターユニットの「01」バンドから「03」バンドまでのランレングスデータが続く。なお、同図中(01RU:01B)〜(01RU:03B)は、「01」ラスターユニットの「01」バンドから「03」バンドを意味する。
【0047】
また、図11のフォーマットでは、(01RU:01B)から(01RU:02B)のJPEGブロック位置情報とJPEGデータが続いている。すなわち、(01RU:03B)のJPEGブロック位置情報とJPEGデータはここには含まれていない。次に(02RU:01B)から(02RU:03B)のランレングスデータが続き、その後に(01RU:03B)〜(02RU:02B)のJPEGブロック位置情報およびJPEGデータが続く。すなわち、JPEGブロック位置情報およびJPEGデータが、ランレングスデータに対して1バンド分遅延してフォーマットが形成されることになる。
【0048】
図11に示すデータ系列を受け取った復号化装置では、まずヘッダ部の解析を行った後、(01RU:01B)から(01RU:03B)のランレングスデータを復号化する。復号化した結果得られた画像情報を図12に示す合成画像用バッファメモリ1200の先頭部分に格納する。次に、(01RU:01B)から(01RU:02B)のJPEGデータを復号化し、JPEGブロック位置情報を参照しながら、合成画像用バッファメモリ1200の所定位置にブロック単位で合成を行う。ここまで復号化が終了した際のメモリ使用状況が図12に示されている。
【0049】
次に、復号化装置では(02RU:01B)から(02RU:03B)のランレングスデータの復号化を行い、その結果得られた画像情報をバッファメモリ1200の未使用領域の先頭部に格納する。この際に、(01RU:03B)にはJPEGブロックが合成されていないため、(02RU:01B)のランレングスデータは問題なく復号化することが可能である。
【0050】
次に、復号化装置では(01RU:03B)から(02RU:02B)のJPEGデータを復号化し、JPEGブロック位置情報を参照しながら、バッファメモリ1200上の所定の位置にブロック単位で合成を行う。
【0051】
以上述べたように、図11で示すようなフォーマットでデータ系列を生成することにより、復号化装置で従来必要であったJPEG復号化用バッファメモリがなくても画像情報を復号化することが可能となる。また、上記処理により、従来必要であったJPEG復号化用バッファから合成画像用バッファへのJPEGブロックのコピー処理が不要となる。以上が、第2の実施形態を説明した。
【0052】
また、本第2の実施形態においても、復号する側(実施形態ではプリンタ)では、受信したランレングス符号化データに基づき復号処理し、JPEG符号化した位置については、JPEG符号化データに従って復号結果をダイレクトに合成しているだけでよく、その主要部分は符号化する側にあると言える。
【0053】
第2の実施形態における符号化側の処理手順は、1つのラスタユニットが複数のバンドで構成される点を除けば、先に説明した第1の実施形態と実質的に同じであり、図14のフローチャートからすれば当業者にとっては自明のものであるので、その説明は省略することとする。
【0054】
以上であるが、本実施形態での記載からも明らかなように、本発明の特徴の主要部分は画像データを圧縮符号化する側にある。圧縮符号化する側では、上記の如く、プリンタドライバ等のコンピュータプログラムで実現しているわけであるから、本発明はコンピュータプログラムをもその範疇とすることも明らかである。また、通常、コンピュータプログラムはCDROM等のコンピュータ可読記憶媒体をコンピュータにセットし、システムにコピーもしくはインストールすることで実行可能となるわけであるから、本発明はかかるコンピュータ可読記憶媒体をもその範疇とすることも明らかである。
【0055】
更にまた、上記処理を実現するためのコンピュータプログラムであるが、そのプログラムの指示に基づき、コンピュータ上で稼働しているオペレーティングシステム(OS)などが実際の処理の一部または全部を行い、その処理によって前述した実施形態の機能が実現される場合も含まれることは言うまでもない。
【0056】
以上説明したように、第1の実施形態によれば、JPEGブロックの合成を、ランレングスデータの復号化に対して、常に1ラスターユニット分遅延させて行うことにより、JPEG復号化用バッファメモリが不要、もしくは少なくできるようになる。また、合成画像用バッファメモリにJPEGブロックを直接合成することもできるので、JPEG復号化用バッファメモリからのコピー処理も不要にできるようになる。
【0057】
また、第2の実施形態によれば、図11で示すようなフォーマットでデータ系列を生成することにより、JPEG復号化用バッファメモリがなくても画像情報を復号化することが可能となり、第1の実施形態と同様の効果を奏することも可能になる。
【0058】
なお、実施形態では符号化の種類として、ランレングス符号化とJPEG符号化を例にして説明したが、これによって本願発明が限定されるものではないし、符号化単位も8×8画素に限るものではない。要するに、ランレングス符号化の如く可逆符号化と、JPEG等の不可逆符号化の2種類を用いるものであれば良い。
【0059】
以上であるが、本実施形態に対応する実施態様を列挙すると次の通りである。
【0060】
[実施態様1] 画像データを所定サイズの画素ブロック単位に符号化する画像処理方法であって、
画像データを不可逆符号化する第1の符号化工程と、
画像データを可逆符号化する第2の符号化工程と、
前記画像データの画素ブロック単位に前記第1の符号化工程を行うか否かを判定工程と、
該判定工程で前記第1の符号化工程で符号化すると判定した場合、前記第1の符号化工程による符号化して得られた画素ブロックの符号データを一時的に蓄積する第1の蓄積工程と、
前記第1の符号化工程で符号化した対象となった画素ブロック内の全画素値を所定値で置換える置換え工程と、
該置換え工程による置換え後の画素ブロック、及び、前記判定工程で第1の符号化工程で行わないと判定された画素ブロックに対し、前記第2の符号化工程で符号化を行わせ、得られた符号データを一時的に蓄積する第2の蓄積工程と、
前記第1の蓄積工程で蓄積された符号化データを、前記第2の蓄積工程で蓄積された符号化データよりも、所定単位だけ遅らせて出力する出力工程と
を備えることを特徴とする画像処理方法。
【0061】
[実施態様2] 前記所定単位は、前記第1の符号化工程における符号化対象画素の位置と、参照する画素位置との距離を隔てた距離を有することを特徴とする実施態様1に記載の画像処理方法。
【0062】
[実施態様3] 前記第1の符号化工程はJPEG符号化による符号化工程、前記第2の符号化工程はランレングス符号化工程による符号化工程であることを特徴とする実施態様1又は2に記載の画像処理方法。
【0063】
[実施態様4] 前記出力工程による出力先は、印刷装置であることを特徴とする実施態様1乃至3のいずれか1項に記載の画像処理方法。
【0064】
[実施態様5] 画像データを所定サイズの画素ブロック単位に符号化する画像処理装置であって、
画像データを不可逆符号化する第1の符号化手段と、
画像データを可逆符号化する第2の符号化手段と、
前記画像データの画素ブロック単位に前記第1の符号化手段を行うか否かを判定手段と、
該判定手段で前記第1の符号化手段で符号化すると判定した場合、前記第1の符号化手段による符号化して得られた画素ブロックの符号データを一時的に蓄積する第1の蓄積手段と、
前記第1の符号化手段で符号化した対象となった画素ブロック内の全画素値を所定値で置換える置換え手段と、
該置換え手段による置換え後の画素ブロック、及び、前記判定手段で第1の符号化手段で行わないと判定された画素ブロックに対し、前記第2の符号化手段で符号化を行わせ、得られた符号データを一時的に蓄積する第2の蓄積手段と、
前記第1の蓄積手段で蓄積された符号化データを、前記第2の蓄積手段で蓄積された符号化データよりも、所定単位だけ遅らせて出力する出力手段と
を備えることを特徴とする画像処理装置。
【0065】
[実施態様6] 画像データを所定サイズの画素ブロック単位に符号化する画像処理装置として機能するコンピュータプログラムであって、
画像データを不可逆符号化する第1の符号化手段と、
画像データを可逆符号化する第2の符号化手段と、
前記画像データの画素ブロック単位に前記第1の符号化手段を行うか否かを判定手段と、
該判定手段で前記第1の符号化手段で符号化すると判定した場合、前記第1の符号化手段による符号化して得られた画素ブロックの符号データを一時的に蓄積する第1の蓄積手段と、
前記第1の符号化手段で符号化した対象となった画素ブロック内の全画素値を所定値で置換える置換え手段と、
該置換え手段による置換え後の画素ブロック、及び、前記判定手段で第1の符号化手段で行わないと判定された画素ブロックに対し、前記第2の符号化手段で符号化を行わせ、得られた符号データを一時的に蓄積する第2の蓄積手段と、
前記第1の蓄積手段で蓄積された符号化データを、前記第2の蓄積手段で蓄積された符号化データよりも、所定単位だけ遅らせて出力する出力手段と
して機能することを特徴とするコンピュータプログラム。
【0066】
[実施態様7] 前記コンピュータプログラムはプリンタドライバの一部であることを特徴とする実施態様6に記載のコンピュータプログラム。
【0067】
[実施態様8] 実施態様6又は7に記載のコンピュータプログラムを記憶することを特徴とするコンピュータ可読記憶媒体。
【0068】
【発明の効果】
以上説明したように本発明によれば、可逆符号化データ及び不可逆符号化データの混在した符号化画像データの復号に要するメモリ量を削減することが可能になる。
【図面の簡単な説明】
【図1】実施形態における符号化処理のブロック構成図である。
【図2】実施形態におけるプレーン分割の概念図である。
【図3】課題となるデータフォーマットを示す図である。
【図4】実施形態におけるプリンタのハードウェア構成図である。
【図5】図4の構成における復号処理に係る機能ブロック図である。
【図6】ランレングス符号化の参照位置を示す図である。
【図7】図3のデータフォーマット時の復号化装置内部でのメモリ使用状態を示す図である。
【図8】第1の実施形態におけるデータフォーマットを示す図である。
【図9】第1の実施形態における復号化装置内部でのメモリ使用例を示す図である。
【図10】第2の実施形態におけるラスターユニットを説明するための図である。
【図11】第2の実施形態におけるデータフォーマットを示す図である。
【図12】第2の実施形態における復号化装置内部でのメモリ使用例を示す図である。
【図13】第1の実施形態におけるホストコンピュータのハードウェア構成図である。
【図14】第1の実施形態における符号化処理手順を示すフローチャートである。
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a technique for compressing and encoding image data.
[0002]
[Prior art]
Conventionally, many methods have been proposed for improving the coding efficiency by dividing image information into a plurality of regions and applying a coding method (hybrid coding method) suitable for each region. Yes.
[0003]
Here, as the type of encoding employed in hybrid encoding, JPEG encoding is performed for halftone areas such as natural images captured by a digital camera, and run-length encoding is performed for areas such as characters and line drawings. It will be general.
[0004]
[Problems to be solved by the invention]
Incidentally, some recent printers have a recording resolution exceeding 1000 dpi, and the amount of image data output from the host computer to the printer is large. In particular, in the case of a color printer, the number of color components increases and the amount of information becomes enormous. Therefore, it is desirable to apply the hybrid encoding method as described above to such a printing system.
[0005]
When considering such a system, for example, when the printer is an ink jet printer, for example, the carriage on which the recording head is mounted is basically scanned and printed, so at least the printer is used. Needless to say, a memory for developing a recorded image for one scan is required, but a buffer memory sufficient for decoding processing is required.
[0006]
The present invention intends to provide a technique for reducing the amount of memory required for decoding encoded image data in which lossless encoded data and lossy encoded data are mixed.
[0007]
[Means for Solving the Problems]
In order to solve this problem, for example, the image processing method of the present invention includes the following steps. That is,
An image processing method for encoding image data in units of pixel blocks,
A first encoding step of encoding the image data with a first encoding algorithm;
A step of determining whether or not to perform the first encoding step for each pixel block of the image data;
A first accumulating step of temporarily accumulating encoded data of the pixel block obtained by encoding in the first encoding step when it is determined in the determining step that encoding is performed in the first encoding step; When,
A replacement step of replacing all pixel values in the pixel block to be encoded in the first encoding step with a preset value;
A second encoding step of encoding the pixel block after the replacement and a pixel block determined not to be performed in the first encoding step in the determination step with a second encoding algorithm;
An output step of outputting the encoded data accumulated in the first accumulation step after being delayed by a preset unit from the encoded data obtained by encoding in the second encoding step. .
[0008]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, embodiments according to the present invention will be described in detail with reference to the accompanying drawings.
[0009]
First, the outline of the hybrid coding method examined by the present inventors will be described.
[0010]
FIG. 1 shows a block diagram of a hybrid encoding method by the present inventors. In the figure, as a plurality of encoding methods applied to an image, two types of run-length encoding 102 which is a lossless encoding method and JPEG encoding unit 103 which is an irreversible encoding method are prepared. An image input from the input terminal 100 is first subjected to plane division processing in the plane division unit 101. Specifically, the image is divided into small blocks of arbitrary size (for example, 8 × 8 square blocks, hereinafter referred to as pixel blocks), and the pixel blocks are divided into the two kinds of encoding methods according to predetermined conditions. Of these, it is determined which encoding should be performed. For example, the difference between the maximum and minimum density values in a block is obtained, and if this difference is greater than a certain value, it is considered that the block contains a character part or an edge part, and such a block has no distortion. Encoding (reversible encoding), that is, in the example of FIG. 1, the run-length encoding unit 102 performs encoding. If the above conditions are not met, JPEG encoding with a higher compression ratio is performed although it is irreversible. Note that the run-length encoding and JPEG encoding algorithms are widely known, and thus detailed description thereof is omitted here.
[0011]
FIG. 2 shows a conceptual diagram of plane division processing. Since JPEG is used in the example of FIG. 1, in FIG. 2, an image is divided into pixel blocks, and plane division processing is performed for each block. In the figure, blocks indicated by diagonal lines are blocks that are determined to be subjected to JPEG encoding by the determination. Such a block is extracted from the original image, and forms a JPEG plane as indicated by 201 different from the original image. Note that the corresponding region (8 × 8 pixel region) of the original image from which the block is extracted is filled with an arbitrary value, for example, (R, G, B) = (255,255,255) to be a run-length plane. As a result, the efficiency of run-length encoding is increased to the limit for the region at the pixel block position determined to be encoded by JPEG.
[0012]
Two pieces of image information (planes) generated by such processing are input to the run-length encoding unit 102 and the JPEG encoding unit 103, respectively, and compressed and encoded.
[0013]
The compression-coded data is input to the format forming unit 110, and after the format as shown in FIG. 3 is formed, it is output from the output terminal. In the format shown in the figure, three types of data, run-length data, JPEG block position information, and JPEG data, are alternately transferred for each raster unit shown in FIG. 2 (in units of 8 lines). ing. Here, the JPEG block position information is 1-bit identification information assigned to each block shown in FIG. 2, and “1” is assigned to the blocks classified as JPEG planes by the plane dividing unit 101. “0” is assigned to a block classified as a run-length plane. With this 1-bit information, the decoding side can synthesize the decoded JPEG block on the run-length plane.
[0014]
The output image information is stored in a storage device such as a memory or a hard disk, or transferred to another computer or device via a communication path.
[0015]
As an apparatus for receiving and decoding the encoded data generated by the above processing, for example, a printer having a configuration as shown in FIG. 4 is considered. Here, 400 is a printer apparatus, 401 is a CPU that controls the entire apparatus, and 402 is a ROM that stores a program for performing printing processing (including decoding processing). A RAM 403 is used as various buffers and a work area for the CPU 401. Reference numeral 404 denotes an interface for receiving print data (image data compressed and encoded by the hybrid encoding method) from the host computer, and reference numeral 405 denotes a printer engine that discharges ink droplets. However, the printing method is not limited to this, and other methods may be used.
[0016]
FIG. 5 schematically shows a function related to the decoding process in the configuration of FIG. The configuration described below is easy to understand when it is considered to be a program module, but of course, it may be realized by hardware.
[0017]
In FIG. 5, among the encoded information input from the input terminal 500, run-length and JPEG encoded data are input to the respective decoding units, and the decoding process of each plane is performed. Next, the plane synthesis unit 509 reconstructs the original image by synthesizing each block of the decoded JPEG plane with the decoded run-length plane.
[0018]
The hybrid encoding and decoding method can be applied to various applications. For example, the encoding method is applied to a part of a printer driver in a host computer, and processing using the decoding method is performed in a printer. It is possible to reduce the amount of information by applying to image data flowing between the two.
[0019]
By the way, in some run-length encodings, there is one in which the position of a reference pixel for comparing whether or not it is the same as a target pixel to be encoded has an upper position in addition to the left as shown in FIG. That is, there is a run-length encoding that compares the target pixel with an arbitrary position above not only on the left side but outputs the number of consecutive pixels as a code if they have the same density value. Furthermore, the reference pixel position is not necessarily adjacent to the target pixel, and as shown in FIG. In such a case, a buffer memory for storing the decoded JPEG block is also required in addition to the buffer memory for storing the composite result image in the decoding device.
[0020]
FIG. 7 illustrates the above problem. This figure shows the use status of the buffer memory inside the decoding apparatus. 700 is a buffer memory for storing the final composite image, and 701 is a buffer memory for storing the decoded JPEG block. is there. When image information is transferred from the encoding device to the decoding device in the format shown in FIG. 3, the decoding side first decodes the run-length encoded data of the “01” raster unit, and starts the buffer memory 700. Store from. Next, JPEG data of the “01” raster unit is decoded, but the decoded image block cannot be immediately synthesized on the buffer memory 700. This is because when the run length data of the “02” raster unit is encoded using the upper reference, it is necessary to refer to the “01” raster unit before the JPEG block is synthesized. Therefore, since the JPEG block of the “01” raster unit needs to be synthesized after the run-length data of the “02” raster unit is decoded, the JPEG decoding buffer temporarily shown in FIG. It is necessary to store in the memory 701. To explain more clearly, an area where a pixel block determined to be subjected to JPEG coding has been replaced with a predetermined value, and run-length encoding may be performed with reference to the predetermined value. It is.
[0021]
When such a hybrid encoding method is applied to, for example, image information flowing between the host computer and the printer, the decoding device needs to be incorporated in the printer. Here, if the printer is an ink jet printer, the printable width is 20 cm, and the print resolution is 600 dpi, the JPEG decoding memory buffer shown in FIG. 7 will require approximately 111 KB. This is not applicable when there are few resources (memory) that the device can use.
[0022]
Further, according to FIG. 7, it is necessary to store the JPEG block output from the JPEG decoding module once in the buffer memory 701 and copy it to the buffer memory 700 for further synthesis. It can be a problem from a viewpoint.
[0023]
In the present embodiment, such problems are also eliminated. For this reason, the format forming unit 110 in FIG. 1 forms data in a format as shown in FIG.
[0024]
In the figure, a header part is generated at the head of the data series. This header portion includes information such as the size of the image to be compressed and encoded, the number of gradations per pixel, and how many lines each raster unit is composed of. Subsequently, two types of encoded image information are stored. As a feature of the present embodiment, only run-length data precedes other information by one raster unit. By forming the format in this way, the above problem can be solved. Note that the reason why only one raster unit precedes is when the pixel position to be referred to is within one raster unit when the pixel of interest is encoded.
[0025]
FIG. 9 shows the usage status of the memory inside the decoding apparatus according to this embodiment. The decoding procedure will be described below.
[0026]
The decoding device that has received the data series shown in FIG. 8 first analyzes the header part, and then decodes run-length data of the “01” raster unit. The decoded image is stored at the head of the buffer memory 900 shown in FIG. Next, the decoding apparatus decodes the run-length data of the subsequent “02” raster unit. At this time, the pixel of the “01” raster unit may be referenced (upward reference), but since no JPEG block is synthesized in the “01” raster unit, decoding can be performed without any problem. As a result, the obtained image information is stored in the composite image buffer memory following the decoded image information of the “01” raster unit. Next, the decoding device decodes the JPEG data of the subsequent “01” raster unit, and refers to the JPEG block position information of the “01” raster unit, while referring to the “01” raster unit portion of the composite image buffer in block units. I will synthesize with. In this way, JPEG block synthesis is always delayed by one raster unit with respect to decoding of run-length data. As a result, on the decoding side (the printer in the embodiment), the received JPEG data can be decoded and directly overwritten in the corresponding position of the buffer 900, and the JPEG decoding buffer memory conventionally required Is unnecessary or can be reduced. In particular, when a JPEG block is directly synthesized in the synthesized image buffer memory, a memory for storing JPEG encoded data of one pixel block is sufficient, and a separate buffer memory for JPEG decoding is not required. In addition, it is possible to dispense with copy processing from there.
[0027]
As can be seen from the above description, the decoding side (printer in the embodiment) receives the run-length encoded data received in advance by one raster unit, so basically, in the order received. For run-length encoded data, run-length decoding processing is performed, and for JPEG-encoded positions, it is only necessary to directly overwrite the corresponding positions in accordance with JPEG encoded data received thereafter. In other words, it can be said that the main part of the process, which is a feature of the above process, is on the encoding side.
[0028]
The processing on the encoding side can be realized by a computer program that runs on the host computer as described above. A specific configuration and processing procedure for realizing the above functions will be described below with reference to FIGS. In the following description, an example applied to a printer driver will be described.
[0029]
FIG. 13 is a block diagram of the host computer, and may be a general-purpose information processing apparatus such as a general personal computer. In the figure, reference numeral 1301 denotes a CPU that controls the entire apparatus, and reference numeral 1302 denotes a ROM that stores a boot program, BIOS, and the like. Reference numeral 1303 denotes a RAM used as a work area of the CPU 1301, and an OS, an application, and a printer driver are loaded and executed therein (for the run length buffer, JPEG buffer, and flag buffer shown in FIG. 14). (Clarified in the description of the flowchart). A hard disk 1304 stores an OS, applications, various data files, and a printer driver. Reference numeral 1305 denotes a keyboard and a pointing device (PD). 1306 has a built-in video memory. A display control unit 1307 draws an image to be displayed on the video memory and reads data from the video memory and outputs it as a video signal. A display device that displays an image according to a video signal. Reference numeral 1308 denotes an I / O interface for connection with a printer. When the printer exists on the network, this interface is a network interface.
[0030]
Now, in the above configuration, when an application is executed and print processing is performed, the printer driver generates a print image, performs compression encoding of the generated print image, and passes the result to the OS, so that I / Data in the format shown in FIG. 8 is output to the printer via the O interface 1308.
[0031]
FIG. 14 is a flowchart showing the procedure of the compression process of the printer driver. In starting the compression encoding process, a run-length buffer for temporarily storing run-length encoded data in the RAM 1303, a JPEG buffer for temporarily storing JPEG-compressed data, and a position A flag buffer for storing information (0 when the corresponding pixel block is run-length encoded, 1 when JPEG-encoded) is secured.
[0032]
In addition, it is sufficient to secure one raster unit for each run length buffer and two rasters for the flag buffer and the JPEG buffer. Also, the order of encoding for the raster of interest is one-dimensional. In the following description, flag (i, j) and the like are described as two-dimensional, but it should be noted that this is for convenience.
[0033]
First, in step S1401, a header part is generated and output. Next, variables i and j are both initialized to 1 in steps S1402 and S1403. The variable i stores information indicating the number of the raster unit, and the variable j stores information indicating the number of the pixel block in the raster unit.
[0034]
In step S1404, (i, j) in the flag buffer is initialized to zero. In short, since the position of the pixel block of interest can be expressed as (i, j), this means that the pixel block is set to be run-length encoded.
[0035]
In step S1405, it is determined whether the pixel block of interest should be JPEG encoded or run-length encoded. This determination is made as described above, and a detailed description thereof is omitted here.
[0036]
If it is determined that JPEG encoding should be performed, the process proceeds to step S1406, flag (i, j) is reset to 1, and JPEG compression encoding is performed in step S1407. The generated encoded data is stored (accumulated) in the JPEG buffer. As a result, since the region of the target pixel block in the original image has been used, the values of RGB are filled with predetermined values (255 in the embodiment) (step S1408).
[0037]
Thereafter, the process proceeds to step S1409, and line length encoding is performed on the target pixel block. The point to be noted here is that there are two types of processing in step S1409, that is, a case where it is determined No in step S1405 and a case where processing is performed after step S1408. In the latter case, since all the pixel values in the pixel block are uniformly the same value, the encoding efficiency of run-length encoding is maximized.
[0038]
When the process proceeds to step S1409, whether or not the position of the pixel block of interest is at the end position of the raster unit is determined by examining the variable j. If it is determined that the process is in progress, the process proceeds to step S1411, where the variable j is incremented by one to perform the process for the pixel block at the next position, and the process returns to step S1404.
[0039]
If it is determined in step S1410 that the encoding process for one raster unit has been completed, the process proceeds to step S1412, and the run-length buffer stores run-length encoded data for one raster unit. Therefore, the code data is output.
[0040]
When the process proceeds to step S1413, it is determined whether or not the variable i is 1, that is, whether or not the encoding process of the first raster unit is performed. In the case of the data of the first raster unit, only run-length encoded data is output as shown in FIG. 8, so the process proceeds to step S1416, and the variable i is set to 1 in order to encode the next raster unit. Increment and return to step S1403. At this time, it should be noted that the flag buffer and the JPEG buffer store data corresponding to the previous time, that is, the (i−1) th raster unit.
[0041]
When the second and subsequent raster units are encoded as described above and the output processing of the run-length encoded data is completed, i is other than 1 in the determination process in step S1413, and the process proceeds to step S1414. . When the process proceeds to step S1414, the output of the i-1th run-length encoded data and the i-1th JPEG encoded data are output after the output of the i-th runlength encoded data in step S1412. Will be output.
[0042]
When the process proceeds to step S1415, the variable i is checked to determine whether or not the process for the final raster unit has been completed. If not, the process returns to step S1403 via step S1416.
[0043]
If it is determined in step S1415 that the variable i indicates the final raster, the i-th data remains in the flag buffer and JPEG buffer in an unoutput state, so that the output processing is performed in step S1417. This process is terminated.
[0044]
As a result, print data according to the data format shown in FIG. 8 is output. Note that run-length encoding may be performed in units of raster units rather than in units of pixel blocks. In this case, the process of step S1409 may be performed immediately after step S1401.
[0045]
<Second Embodiment>
In the first embodiment, since a JPEG processing unit is an 8-pixel square block, one raster unit is composed of 8 lines. On the other hand, in the second embodiment, as shown in FIG. 10, a data sequence generation method in the case where one raster unit is composed of 8 × 3 = 24 lines will be described. That is, this is a case where the recording head has 24 vertical nozzles. In addition, suppose that 8 lines which comprised one raster unit in 1st Embodiment are called a band in this embodiment.
[0046]
In the second embodiment, it is assumed that the position of the upper reference pixel in the run-length encoding shown in FIG. 6 is not separated from the target pixel by 8 pixels or more. In this case, in order to correctly decode the 01 band of the “02” raster unit shown in FIG. 10, the JPEG block is not synthesized on the “03” band of the “01” raster unit at the time of decoding. Become. Therefore, in the second embodiment, a data series as shown in FIG. 11 is generated in the format forming unit 110 of FIG. In the data series of FIG. 11, as in the first embodiment, a header portion is present at the head, followed by run-length data from “01” band to “03” band of the “01” raster unit. In the figure, (01RU: 01B) to (01RU: 03B) mean the “01” band to the “03” band of the “01” raster unit.
[0047]
Further, in the format of FIG. 11, the JPEG block position information and JPEG data from (01RU: 01B) to (01RU: 02B) are continued. That is, the (01RU: 03B) JPEG block position information and JPEG data are not included here. Next, run length data from (02RU: 01B) to (02RU: 03B) follows, followed by JPEG block position information and JPEG data from (01RU: 03B) to (02RU: 02B). That is, the format is formed by delaying the JPEG block position information and JPEG data by one band with respect to the run-length data.
[0048]
The decoding apparatus that receives the data series shown in FIG. 11 first analyzes the header part and then decodes run length data from (01RU: 01B) to (01RU: 03B). The image information obtained as a result of decoding is stored in the head portion of the composite image buffer memory 1200 shown in FIG. Next, the JPEG data from (01RU: 01B) to (01RU: 02B) is decoded and synthesized in a block unit at a predetermined position in the synthesized image buffer memory 1200 while referring to the JPEG block position information. FIG. 12 shows the memory usage status when the decoding is completed so far.
[0049]
Next, the decoding apparatus decodes the run length data from (02RU: 01B) to (02RU: 03B), and stores the resulting image information at the head of the unused area of the buffer memory 1200. At this time, since no JPEG block is synthesized in (01RU: 03B), the run-length data in (02RU: 01B) can be decoded without any problem.
[0050]
Next, the decoding apparatus decodes the JPEG data from (01RU: 03B) to (02RU: 02B), and synthesizes the data at a predetermined position on the buffer memory 1200 while referring to the JPEG block position information.
[0051]
As described above, by generating a data sequence in the format as shown in FIG. 11, it is possible to decode image information without a JPEG decoding buffer memory that is conventionally required in a decoding apparatus. It becomes. In addition, the above processing eliminates the need for JPEG block copy processing from the JPEG decoding buffer to the composite image buffer, which has been conventionally required. This completes the description of the second embodiment.
[0052]
Also in the second embodiment, the decoding side (the printer in the embodiment) performs decoding processing based on the received run-length encoded data, and the JPEG encoded position is decoded according to the JPEG encoded data. It can be said that the main part is on the encoding side.
[0053]
The processing procedure on the encoding side in the second embodiment is substantially the same as that of the first embodiment described above except that one raster unit is composed of a plurality of bands. From this flowchart, it will be obvious to those skilled in the art, and the description thereof will be omitted.
[0054]
As described above, as is clear from the description in the present embodiment, the main part of the feature of the present invention is on the side for compressing and encoding image data. As described above, since the compression encoding is realized by a computer program such as a printer driver, it is obvious that the present invention also includes a computer program. In general, a computer program can be executed by setting a computer readable storage medium such as a CDROM in a computer and copying or installing the computer program in a system. It is also clear to do.
[0055]
Furthermore, the computer program for realizing the above processing is based on the instructions of the program, and an operating system (OS) operating on the computer performs part or all of the actual processing, and the processing Needless to say, the case where the functions of the above-described embodiment are realized is also included.
[0056]
As described above, according to the first embodiment, JPEG block synthesis is performed by always delaying one raster unit with respect to decoding of run-length data, so that the JPEG decoding buffer memory It becomes unnecessary or can be reduced. Further, since the JPEG block can be directly synthesized in the synthesized image buffer memory, the copy processing from the JPEG decoding buffer memory can be made unnecessary.
[0057]
Further, according to the second embodiment, by generating a data sequence in a format as shown in FIG. 11, it becomes possible to decode image information without a JPEG decoding buffer memory. It is also possible to achieve the same effect as the embodiment.
[0058]
In the embodiment, run length coding and JPEG coding have been described as examples of coding types. However, the present invention is not limited by this, and the coding unit is also limited to 8 × 8 pixels. is not. In short, what is necessary is just to use two types of lossless encoding such as run-length encoding and irreversible encoding such as JPEG.
[0059]
As described above, the embodiments corresponding to the present embodiment are listed as follows.
[0060]
[Embodiment 1] An image processing method for encoding image data in units of pixel blocks of a predetermined size,
A first encoding step of irreversibly encoding image data;
A second encoding step for lossless encoding of the image data;
A step of determining whether or not to perform the first encoding step for each pixel block of the image data;
A first accumulating step for temporarily accumulating code data of pixel blocks obtained by encoding in the first encoding step when it is determined in the determining step that encoding is performed in the first encoding step; ,
A replacement step of replacing all pixel values in the pixel block to be encoded in the first encoding step with a predetermined value;
The pixel block after replacement in the replacement step and the pixel block determined not to be performed in the first encoding step in the determination step are encoded in the second encoding step, and obtained. A second accumulation step for temporarily accumulating the encoded data;
An output step of outputting the encoded data accumulated in the first accumulation step with a delay by a predetermined unit from the encoded data accumulated in the second accumulation step;
An image processing method comprising:
[0061]
[Embodiment 2] The embodiment according to Embodiment 1, wherein the predetermined unit has a distance that is a distance between a position of a pixel to be encoded in the first encoding step and a pixel position to be referred to. Image processing method.
[0062]
[Embodiment 3] Embodiment 1 or 2, wherein the first encoding step is an encoding step by JPEG encoding, and the second encoding step is an encoding step by a run-length encoding step. An image processing method described in 1.
[0063]
[Embodiment 4] The image processing method according to any one of Embodiments 1 to 3, wherein an output destination in the output step is a printing apparatus.
[0064]
[Embodiment 5] An image processing apparatus for encoding image data in units of pixel blocks of a predetermined size,
First encoding means for irreversibly encoding image data;
A second encoding means for losslessly encoding image data;
A determination unit that determines whether or not to perform the first encoding unit for each pixel block of the image data;
A first accumulator that temporarily accumulates code data of a pixel block obtained by encoding by the first encoder when the determination unit determines that the first encoder encodes; ,
Replacement means for replacing all pixel values in the pixel block to be encoded by the first encoding means with a predetermined value;
The pixel block after replacement by the replacement unit and the pixel block determined not to be performed by the first encoding unit by the determination unit are encoded by the second encoding unit. Second storage means for temporarily storing the encoded data,
Output means for outputting the encoded data stored in the first storage means with a predetermined unit delay from the encoded data stored in the second storage means;
An image processing apparatus comprising:
[0065]
[Embodiment 6] A computer program that functions as an image processing apparatus that encodes image data in units of pixel blocks of a predetermined size,
First encoding means for irreversibly encoding image data;
A second encoding means for losslessly encoding image data;
A determination unit that determines whether or not to perform the first encoding unit for each pixel block of the image data;
A first accumulator that temporarily accumulates code data of a pixel block obtained by encoding by the first encoder when the determination unit determines that the first encoder encodes; ,
Replacement means for replacing all pixel values in the pixel block to be encoded by the first encoding means with a predetermined value;
The pixel block after replacement by the replacement unit and the pixel block determined not to be performed by the first encoding unit by the determination unit are encoded by the second encoding unit. Second storage means for temporarily storing the encoded data,
Output means for outputting the encoded data stored in the first storage means with a predetermined unit delay from the encoded data stored in the second storage means;
A computer program that functions as a computer program.
[0066]
[Embodiment 7] The computer program according to Embodiment 6, wherein the computer program is a part of a printer driver.
[0067]
[Embodiment 8] A computer-readable storage medium storing the computer program according to Embodiment 6 or 7.
[0068]
【The invention's effect】
As described above, according to the present invention, it is possible to reduce the amount of memory required for decoding encoded image data in which lossless encoded data and lossy encoded data are mixed.
[Brief description of the drawings]
FIG. 1 is a block configuration diagram of an encoding process in an embodiment.
FIG. 2 is a conceptual diagram of plane division in the embodiment.
FIG. 3 is a diagram showing a data format to be a problem.
FIG. 4 is a hardware configuration diagram of a printer according to the embodiment.
FIG. 5 is a functional block diagram relating to a decoding process in the configuration of FIG. 4;
FIG. 6 is a diagram illustrating reference positions for run-length encoding.
7 is a diagram showing a memory usage state in the decoding device at the time of the data format of FIG. 3; FIG.
FIG. 8 is a diagram showing a data format in the first embodiment.
FIG. 9 is a diagram illustrating an example of memory use inside the decoding device according to the first embodiment;
FIG. 10 is a diagram for explaining a raster unit according to a second embodiment.
FIG. 11 is a diagram showing a data format in the second embodiment.
FIG. 12 is a diagram illustrating an example of memory use in the decoding device according to the second embodiment.
FIG. 13 is a hardware configuration diagram of a host computer in the first embodiment.
FIG. 14 is a flowchart illustrating an encoding processing procedure according to the first embodiment.

Claims (8)

画像データを画素ブロック単位に符号化する画像処理方法であって、
画像データを第1の符号化アルゴリズムで符号化する第1の符号化工程と、
前記画像データの画素ブロック単位に前記第1の符号化工程を行うか否かを判定工程と、
該判定工程で前記第1の符号化工程で符号化すると判定した場合、前記第1の符号化工程により符号化して得られた画素ブロックの符号化データを一時的に蓄積する第1の蓄積工程と、
前記第1の符号化工程で符号化の対象となった画素ブロック内の全画素値を予め設定された値で置換える置換え工程と、
該置換え後の画素ブロック、及び、前記判定工程で第1の符号化工程で行わないと判定された画素ブロックを第2の符号化アルゴリズムで符号化する第2の符号化工程と、
前記第1の蓄積工程で蓄積された符号化データを、前記第2の符号化工程により符号化して得られた符号化データよりも、予め設定された単位だけ遅らせて出力する出力工程と
を備えることを特徴とする画像処理方法。
An image processing method for encoding image data in units of pixel blocks,
A first encoding step of encoding the image data with a first encoding algorithm;
A step of determining whether or not to perform the first encoding step for each pixel block of the image data;
A first accumulating step of temporarily accumulating encoded data of the pixel block obtained by encoding in the first encoding step when it is determined in the determining step that encoding is performed in the first encoding step; When,
A replacement step of replacing all pixel values in the pixel block to be encoded in the first encoding step with a preset value;
A second encoding step of encoding the pixel block after the replacement and a pixel block determined not to be performed in the first encoding step in the determination step with a second encoding algorithm;
An output step of outputting the encoded data stored in the first storage step after being delayed by a preset unit from the encoded data obtained by encoding in the second encoding step. An image processing method.
前記第2の符号化工程は、周囲画素を参照することにより符号化を行う工程であることを特徴とする請求項1に記載の画像処理方法。  The image processing method according to claim 1, wherein the second encoding step is a step of performing encoding by referring to surrounding pixels. 前記第1の符号化工程は非可逆符号化による符号化工程であり、前記第2の符号化工程は可逆符号化による符号化工程であることを特徴とする請求項1又は2に記載の画像処理方法。  The image according to claim 1 or 2, wherein the first encoding step is an encoding step by lossy encoding, and the second encoding step is an encoding step by lossless encoding. Processing method. 前記出力工程による出力先は、印刷装置であることを特徴とする請求項1乃至3のいずれか1項に記載の画像処理方法。  The image processing method according to claim 1, wherein an output destination in the output step is a printing apparatus. 画像データを画素ブロック単位に符号化する画像処理装置であって、
画像データを第1の符号化アルゴリズムで符号化する第1の符号化手段と、
前記画像データの画素ブロック単位に前記第1の符号化手段を行うか否かを判定手段と、
該判定手段で前記第1の符号化手段で符号化すると判定した場合、前記第1の符号化手段により符号化して得られた画素ブロックの符号化データを一時的に蓄積する第1の蓄積手段と、
前記第1の符号化手段で符号化の対象となった画素ブロック内の全画素値を予め設定された値で置換える置換え手段と、
該置換え後の画素ブロック、及び、前記判定手段で第1の符号化手段で行わないと判定された画素ブロックを第2の符号化アルゴリズムで符号化する第2の符号化手段と、
前記第1の蓄積手段で蓄積された符号化データを、前記第2の符号化手段により符号化して得られた符号化データよりも、予め設定された単位だけ遅らせて出力する出力手段と
を備えることを特徴とする画像処理装置。
An image processing apparatus that encodes image data in units of pixel blocks,
First encoding means for encoding image data with a first encoding algorithm;
A determination unit that determines whether or not to perform the first encoding unit for each pixel block of the image data;
First storage means for temporarily storing the encoded data of the pixel block obtained by encoding by the first encoding means when the determination means determines that the encoding is performed by the first encoding means. When,
Replacement means for replacing all pixel values in a pixel block to be encoded by the first encoding means with a preset value;
A second encoding unit that encodes the pixel block after the replacement, and a pixel block determined not to be performed by the first encoding unit by the determination unit using a second encoding algorithm;
Output means for outputting the encoded data accumulated by the first accumulating means after being delayed by a preset unit from the encoded data obtained by encoding by the second encoding means. An image processing apparatus.
コンピュータが読み込み実行することで、画像データを予め設定されたサイズの画素ブロック単位に符号化する画像処理装置として機能するコンピュータプログラムであって、
画像データを第1の符号化アルゴリズムで符号化する第1の符号化手段と、
前記画像データの画素ブロック単位に前記第1の符号化手段を行うか否かを判定手段と、
該判定手段で前記第1の符号化手段で符号化すると判定した場合、前記第1の符号化手段により符号化して得られた画素ブロックの符号化データを一時的に蓄積する第1の蓄積手段と、
前記第1の符号化手段で符号化の対象となった画素ブロック内の全画素値を予め設定された値で置換える置換え手段と、
該置換え後の画素ブロック、及び、前記判定手段で第1の符号化手段で行わないと判定された画素ブロックを第2の符号化アルゴリズムで符号化する第2の符号化手段と、
前記第1の蓄積手段で蓄積された符号化データを、前記第2の符号化手段で符号化して得られた符号化データよりも、予め設定された単位だけ遅らせて出力する出力手段
としてコンピュータに機能させることを特徴とするコンピュータプログラム。
A computer program that functions as an image processing device that encodes image data in units of pixel blocks of a preset size by being read and executed by a computer,
First encoding means for encoding image data with a first encoding algorithm;
A determination unit that determines whether or not to perform the first encoding unit for each pixel block of the image data;
First storage means for temporarily storing the encoded data of the pixel block obtained by encoding by the first encoding means when the determination means determines that the encoding is performed by the first encoding means. When,
Replacement means for replacing all pixel values in a pixel block to be encoded by the first encoding means with a preset value;
A second encoding unit that encodes the pixel block after the replacement, and a pixel block determined not to be performed by the first encoding unit by the determination unit using a second encoding algorithm;
Output means for outputting the encoded data stored in the first storage means after being delayed by a preset unit from the encoded data obtained by encoding in the second encoding means. A computer program characterized by functioning.
前記コンピュータプログラムはプリンタドライバの一部であることを特徴とする請求項6に記載のコンピュータプログラム。  The computer program according to claim 6, wherein the computer program is a part of a printer driver. 請求項6又は7に記載のコンピュータプログラムを記憶することを特徴とするコンピュータ可読記憶媒体。  A computer-readable storage medium storing the computer program according to claim 6 or 7.
JP2003092823A 2003-03-28 2003-03-28 Image processing method, image processing apparatus, computer program, and computer-readable storage medium Expired - Fee Related JP4006351B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003092823A JP4006351B2 (en) 2003-03-28 2003-03-28 Image processing method, image processing apparatus, computer program, and computer-readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003092823A JP4006351B2 (en) 2003-03-28 2003-03-28 Image processing method, image processing apparatus, computer program, and computer-readable storage medium

Publications (3)

Publication Number Publication Date
JP2004304361A JP2004304361A (en) 2004-10-28
JP2004304361A5 JP2004304361A5 (en) 2006-03-23
JP4006351B2 true JP4006351B2 (en) 2007-11-14

Family

ID=33405757

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003092823A Expired - Fee Related JP4006351B2 (en) 2003-03-28 2003-03-28 Image processing method, image processing apparatus, computer program, and computer-readable storage medium

Country Status (1)

Country Link
JP (1) JP4006351B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4994902B2 (en) * 2007-03-16 2012-08-08 京セラドキュメントソリューションズ株式会社 Image compression apparatus, image forming apparatus, and still image compression method

Also Published As

Publication number Publication date
JP2004304361A (en) 2004-10-28

Similar Documents

Publication Publication Date Title
US6337747B1 (en) System to adaptively compress raster image data
US8300956B2 (en) Lossless compression of color image data using entropy encoding
US8411942B2 (en) Method and apparatus for hybrid image compression
JP3063957B2 (en) Image processing device
JP4249265B2 (en) Apparatus and method for hybrid compression of raster data
US20030107753A1 (en) Image processing apparatus and method, program, and storage medium
KR20120065394A (en) Image processing apparatus and processing method therefor
AU2012201684A1 (en) Image compression
US7167259B2 (en) System and method for merging line work objects using tokenization and selective compression
US20070064275A1 (en) Apparatus and method for compressing images
JP2000295113A (en) Huffman coded data compressor
US8014622B2 (en) Image processing apparatus and method for attribute data encoding
EP0506482A2 (en) Image processing
US20040150840A1 (en) Methods and systems for structuring a raster image file for parallel streaming rendering by multiple processors
US8804185B2 (en) Image processing device and image processing method for reducing image degradation
US20110032552A1 (en) Data processing apparatus and data processing method
JP4164257B2 (en) Image processing apparatus, image processing method, program, and storage medium
US20160358046A1 (en) Image decoding apparatus and method therefor
JP4006351B2 (en) Image processing method, image processing apparatus, computer program, and computer-readable storage medium
US8134742B2 (en) Output device and method for outputting density data corresponding to a color material to a printing unit
US8824011B2 (en) Method for processing rasterized image data
JP2003046789A (en) Image coding apparatus and image decoding apparatus
US20090284766A1 (en) Image Synthesis Method, Print System and Image Synthesis Program
US7391535B2 (en) Raster image processing
JP3211545B2 (en) Image processing device

Legal Events

Date Code Title Description
A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20060206

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20060206

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: 20070813

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20070827

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: 20100831

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20110831

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20120831

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20120831

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20130831

Year of fee payment: 6

LAPS Cancellation because of no payment of annual fees