JP4124982B2 - Image processing apparatus and method, computer program, and storage medium - Google Patents

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

Info

Publication number
JP4124982B2
JP4124982B2 JP2001184129A JP2001184129A JP4124982B2 JP 4124982 B2 JP4124982 B2 JP 4124982B2 JP 2001184129 A JP2001184129 A JP 2001184129A JP 2001184129 A JP2001184129 A JP 2001184129A JP 4124982 B2 JP4124982 B2 JP 4124982B2
Authority
JP
Japan
Prior art keywords
compression
encoded data
encoding
generated
unit
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
JP2001184129A
Other languages
Japanese (ja)
Other versions
JP2003008903A5 (en
JP2003008903A (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 JP2001184129A priority Critical patent/JP4124982B2/en
Priority to EP02254149.4A priority patent/EP1271926B1/en
Priority to US10/171,647 priority patent/US7106911B2/en
Priority to CN02122650.4A priority patent/CN1207897C/en
Publication of JP2003008903A publication Critical patent/JP2003008903A/en
Publication of JP2003008903A5 publication Critical patent/JP2003008903A5/ja
Application granted granted Critical
Publication of JP4124982B2 publication Critical patent/JP4124982B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Description

【0001】
【発明の属する技術分野】
本発明は、画像データを一定符号量以内に圧縮符号化する機能を有する画像処理装置に関するものである。
【0002】
【従来の技術】
従来,静止画像の圧縮方式には,離散コサイン変換を利用したJPEG方式や,Wavelet変換を利用した方式が多く使われている。この種の符号化方式は,可変長符号化方式であるので,符号化対象の画像毎に符号量が変化するものである。
【0003】
国際標準化方式であるJPEG方式では,画像に対して1組の量子化マトリクスしか定義できない。従って、プリスキャン無しには、符号量調整が行えず、限られたメモリに記憶するシステムで使用する場合においては、メモリオーバーを起こす危険性がある。
【0004】
これを防止するために、予定した符号量よりオーバーした場合は、圧縮率を変更して、原稿の再読み込みを行なう方法や、予めプリスキャンによる符号量見積もりを行ない、符号量を調整するために,量子化パラメータの再設定を行なう方法などがとられていた。
【0005】
また、プリスキャンを行う符号量制御方式として、例えば、プリ圧縮したデータを内部バッファメモリに入れ、これを伸長し、圧縮パラメータを変え、本圧縮し、外部記憶に出力する方式がある。このとき、本圧縮では、プリ圧縮よりも圧縮率を高めにすることになる。
【0006】
また、例えば、画素ブロックごとの許容符号量を求め、符号量を減らすために、DCT係数をn回レベルシフトした係数をハフマン符号化する方式が知られており、このシフト量nは許容符号量から決定される。
【0007】
【発明が解決しようとする課題】
しかしながら、従来は、圧縮バッファとして、目標圧縮以上の圧縮バッファが必要となり,中間的に使うバッファのオーバーフローを防ぐには,原画のデータを記録できるほどの容量が必要となることは避けられない。
【0008】
さらに、符号化処理を繰り返す方法では、圧縮した全データに対して、復号、再圧縮を行なう処理が入るため、連続処理のスピードがあがらないという問題がある。
【0009】
本発明は上記従来例に鑑みて成されたものであり、1度の画像入力により、効果的に設定したサイズに収まる符号化データを生成することを可能ならしめる画像処理装置及びその制御方法及びコンピュータプログラム及び記憶媒体を提供しようとするものである。
【0010】
【課題を解決するための手段】
かかる課題を解決するため、例えば本発明の画像処理装置は以下の構成を備える。すなわち、
画像データを圧縮符号化する画像処理装置であって、
入力された画像データを第1の圧縮率に対応する圧縮パラメータで圧縮し、生成された符号化データを記憶手段に格納する第1の圧縮手段と、
前記第1の圧縮手段により生成された符号化データを復号し、再圧縮する第2の圧縮手段と、
前記第1の圧縮手段により生成される符号化データ量を監視し、該符号化データ量が設定値に達するか否かを判断する監視手段と、
該監視手段によって前記符号化データ量が設定値に達すると判断した場合に、
前記第1の圧縮手段に適用する圧縮パラメータを前記第1の圧縮率よりも高い第2の圧縮率に対応する圧縮パラメータに更新した後、後続して入力される画像データを該第1の圧縮手段に圧縮させ、
前記第1の圧縮手段により従前に生成された符号化データを、前記第1の圧縮率よりも高い第2の圧縮率に対応する圧縮パラメータで、前記第2の圧縮手段により再圧縮させ、
該再圧縮で得られた符号化データを、前記第1の圧縮手段に適用する圧縮パラメータを更新した後の該第1の圧縮手段により生成された符号化データとして前記記憶手段に保存させ、
前記圧縮パラメータを更新した後で前記第1の圧縮手段により生成された符号化データを、後続の符号化データとして前記記憶手段に保存させる制御手段とを備える。
【0011】
【発明の実施の形態】
以下、添付図面に従って本発明に係る実施形態を詳細に説明する。
【0012】
図1は、実施形態における画像処理装置100の機能ブロック構成図である。以下、同図の各部を簡単に説明する。
【0013】
実施形態における画像処理装置100は、イメージスキャナから画像を入力する入力部101を備えている。なお、入力部101は、ページ記述言語レンダリングなどから画像データを入力しても良いし、記憶媒体に格納された画像ファイルを読込むことで実現しても良く、場合によってはネットワークより受信するようにしても良い。
【0014】
符号化部102は、入力された画像データの符号化を行なう。なお、本実施形態では、符号化方式は公知のJPEG符号化方式を用い、8×8画素単位に相当する画像データを直交変換し、後述する量子化ステップを用いた量子化、ハフマン符号化処理を行なうものである。
【0015】
第1のメモリ制御部103と第2のメモリ制御部105は、上記符号化部102から夫々に出力されてくる上記符号化データ(同じ符号化データ)を第1のメモリ104と第2のメモリ106へ格納する様に制御する。ここで、第1のメモリ104は、最終的に確定した(目標値以内のデータ量に圧縮し終わった)符号化データを、図1の基本構成の外部に接続されるネットワーク機器、画像出力装置や大容量記憶装置等へ出力するために、該符号化データを保持するためのメモリである。また、第2のメモリ106は、前記符号化データを第1のメモリ上に形成するための圧縮符号化処理を補助する作業用のメモリである。
【0016】
カウンタ107は、符号化部102によって圧縮符号化された画像データのデータ量をカウントし、該カウント値を保持すると共に、そのカウント結果を符号化シーケンスの制御を行なう符号化シーケンス制御部108に出力する。
【0017】
符号化シーケンス制御部108では、カウンタ107のカウント値がある設定値に達したかどうかを検出し、その設定値に達した(目標値を越えた)ことを検出した時にメモリ104内の格納済みのデータを廃棄するよう第1のメモリ制御部103に制御信号を出力する。上記第1のメモリ制御部103は、この制御信号に基づいて、メモリアドレスカウンタをクリアするか、あるいは符号化データ管理テーブルをクリアすることにより、前記格納データを廃棄する。また、このとき、符号化シーケンス制御部108は、第1のカウンタ107をゼロクリアする(入力部101からの入力は継続している)と共に、符号化部102に対して今までより、高い圧縮率で符号化を行なうよう制御する。すなわち、本装置の符号化処理で発生する符号化データのデータ量が最終的に例えば1/2になるように制御する。なお、ここでは、1/2としたが任意に設定できることは言うまでもない。
【0018】
そして、圧縮率変更後の符号化データも、これまでと同様、第1のメモリ制御部103と第2のメモリ制御部105を経て、第1のメモリ104と第2のメモリ106に夫々格納される。
【0019】
さらに、符号化シーケンス制御部108は、第2のメモリ制御部105に対して、これまでに第2のメモリ106に格納した符号化データを読み出し、符号化データ変換手段である再符号化部109に該符号化データを出力するよう制御信号を出す。
【0020】
再符号化部109は、入力された符号化データを復号化し、データ量を減らすための再量子化等を行なった後に再び符号化処理を行ない、圧縮率が変更された符号化部102と同じ圧縮率のデータ量を第2のカウンタ110に出力する。
【0021】
この再符号化部109から出力される符号化データは、第1のメモリ制御部103と第2のメモリ制御部105を経由して、それぞれ、第1のメモリ104と第2のメモリ106に格納される。
【0022】
再符号化処理が終了したかどうかは、第2のメモリ制御部が検出する。すなわち、再符号化処理するために読み出すデータが無くなれば、再符号化処理の終了を符号化シーケンス制御部108に知らせる。実際には、第2のメモリ制御部105の読みだし処理だけでなく、再符号化部109の処理も終了した後に、符号化処理が完了したことになる。
【0023】
第2のカウンタ110で得られるカウント値は、再符号化処理が完了した後、第1のカウンタ107で保持されているカウンタ値に加算される。この加算結果は再符号化処理が完了した直後における、第1のメモリ104内のデータ量の合計を表す。即ち、1画面分の符号化部102と再符号化部109の符号化処理が終了した時点では、上記加算後の第1のカウンタ107で保持されているカウンタ値は、1画面分を本装置が符号化した場合に発生した総データ量を表す(詳細は後述)。
【0024】
符号化部102は、再符号化処理の終了/未終了に関わらず、符号化するべき入力部101からの画像データが残っている限りは符号化処理を継続して行なう。
【0025】
カウンタ107のカウント値がある設定値に達したかどうかは入力部101から入力される1ページ分の画像データの符号化処理(符号化、再符号化)が終わるまで繰り返され、上述した符号化と再符号化の処理は、ここで得られる検出結果に応じた制御の上で実行される。
【0026】
上記、図1の構成における処理のフローを表わすフローチャートを図8に示すが、説明を簡単にするため、簡略化した図3のフローチャートに従って先ず説明する。
【0027】
既に説明したように、本発明の画像処理装置100は、スキャナ等の入力部101から入力した1ページの画像データを所定のデータ量以下に圧縮符号化する装置である。該符号化処理を実現するために、前記入力部101以外に、符号化部102、再符号化部109、第1のメモリ104、第2のメモリ106等を有する。これらの機能ブロックを用い、図3に示すフローチャートに基づいて符号化処理を行なう。
【0028】
図3のフローチャートは、大別すると、下記の3つの処理フェーズに分かれる。
(1)符号化フェーズ
(2)符号化・再符号化フェーズ
(3)転送フェーズ
上記それぞれの処理フェーズおいて、どのように画像データ、符号化データ等が流れて処理され,メモリにどのように格納されるかを視覚的に解り易く示したのが図4乃至図7である。
【0029】
図4は、図3のフローチャートにおけるステップS303とS305に対応する符号化フェーズの初期状態を表わす。また、図5はステップS307〜S315に対応する符号化・再符号化フェーズの処理状態を、図6はステップS317に対応する転送フェーズの処理状態を、図7は転送フェーズ後の符号化フェーズの処理状態を表わす。以下、各フェーズについて説明する。
【0030】
<<符号化フェーズ>>
1ページ分の画像データの符号化処理は、符号化パラメータの初期設定(ステップS301)から始まる。ここでは符号化処理する画像サイズ(スキャナ等の入力部101から読み取る用紙サイズ)から一意的に定まる符号化データ量の上限値や符号化部102(本実施形態では公知のJPEG符号化方式を用いるものとする)に適用する量子化ステップ(Q1)といったパラメータを設定する。
【0031】
そして、ステップS303にて、第1のカウンタ107は、実際の符号化処理(画像の8×8画素単位にJPEG圧縮)を行ない、出力される符号化データのデータ量を累積カウントする。
【0032】
次にステップS305にて、該データ量のカウント値が上記上限値をオーバーしたかどうかを検知し、オーバーしていなければステップS303のJPEG符号化処理を継続する。これが初期状態の符号化フェーズである。
【0033】
符号化部102から出力する符号化データは、図4に示すように第1のメモリ104と第2のメモリ106の両方に格納されていく。縦縞で示した領域が該格納した符号を表現している。
【0034】
<<符号化・再符号化フェーズ>>
符号化部102の符号化処理が進行し、前記データ量のカウント値が設定されている上限値をオーバーすると、ステップS307にて、第1のメモリ104内の符号化データを廃棄すると共に、ステップS309にて、符号化部102の量子化ステップをQ2に変更する。
【0035】
符号化データのデータ量のカウント値が設定された上限値をオーバーするという事は、圧縮後のデータ量が目標値以内に収まらないことを意味する。よって同じ量子化ステップを用いて符号化処理を継続しても意味が無いので、前よりもデータ量が少なくなるように、Q1よりも量子化ステップ幅の大きい量子化ステップQ2に変更するわけである。
【0036】
量子化ステップを変更した後、ステップS311では符号化部102の符号化処理を再開し、図5に示すように符号化データを第2のメモリ106のみに格納する。それと並行して、ステップS313の再符号化処理を行なう。再符号化処理では、第2のメモリ106に格納済みの符号化データを読み出して、再符号化部109にて再符号化処理を行ない、前記2つのメモリ104、106に格納する。そして、縦縞▲1▼の符号を全て再符号化するまで、該符号化処理と再符号化処理を継続する。再符号化部109から出力される再符号化データは、量子化ステップ変更後に符号化部102から出力される符号化データと同じ量子化ステップで符号化して得られる符号化データと全く同一の符号化データである。
【0037】
具体的にこの再符号化処理では、符号化データを一旦ハフマン復号した後の各量子化値に対して、これら値を2nで割った結果と同様の結果が出るビットシフト処理を施した後、再度ハフマン符号化を行なうことにより実現される。この方法は、ビットシフトのみで量子化ステップを変更する点と逆直交変換や再直交変換処理を行なわない点で、高速な再符号化処理が可能である。ステップ315では、再符号化処理の終了検知が行なわれる。
【0038】
再符号化後のデータ量は再符号化前の符号化データのデータ量よりも少なくなるので、図5に示すように、再符号化前の符号を格納していたメモリ領域に再符号化後の符号化データを上書きするように格納することができる。再符号化処理が終了した時点で、縦縞▲1▼の符号化データのデータ量は図6に示すの斜め縞▲1▼の符号化データのデータ量へと減少する。
【0039】
以上で説明したステップS307〜315が、符号化・再符号化フェーズで行なう処理である。
【0040】
<<転送フェーズ>>
再符号化処理が終了したら、ステップS317では転送処理が行なわれる。該転送処理では、図6に示すように、符号化・再符号化フェーズで第2のメモリ106のみに格納した斜め縞▲2▼の符号化データを、第1のメモリ104内の斜め線▲1▼の符号化データに連結されるアドレスに転送し、格納する。その一方で、第2のメモリ106上で分散してしまっている斜め縞▲1▼の符号化データと斜め縞▲2▼の符号化データが第1のメモリ104上で連続して格納される様に、前記斜め縞▲2▼の符号化データを第2のメモリ106内で転送し、連結させる。これが、転送フェーズで行なう処理である。
【0041】
上記転送フェーズが終了したら、ステップS303、S305の符号化フェーズに戻り、図7に示すように斜め縞▲4▼の符号を符号化部102から出力して2つのメモリ104,106に格納する。この符号化フェーズは、初期状態の符号化フェーズ(図4)と少し異なり、符号化部102で符号化する際の量子化ステップがQ1からQ2に変更されていると共に、2つのメモリ104,106に格納されている符号化データも様々なフェーズで処理された符号の集まりである。それらの違いを無視すれば、転送フェーズ直後の符号化フェーズと初期状態の符号化フェーズは、同じと見なせる。
【0042】
よって、符号化フェーズ、符号化・再符号化フェーズと転送フェーズの3つを繰り返すことで、最終的に1ページの画像データをデータ量設定値以下に圧縮した符号を第1のメモリに格納することが出来る。しかも、入力部101は一連の処理が終わるまで、入力を継続するだけである。すなわち、画像を再度最初から入力し直すということが無くなる。
【0043】
図3に示したフローチャートは、説明が理解しやすいように、図4、図5、及び、図6に示した各フェーズに対応する処理のみを記述した。しかしながら実際には、1ページの画像データの入力はどこかのフェーズで終了する。従って、どのフェーズで終了したかによって、それ以降の対応も多少異なる。それを考慮した流れを示したのが図8のフローチャートである。図8のフローチャートは、1ページ分の画像データの入力完了と図3で説明した各種処理との関係を考慮したものであり、ここでは図3のフローチャートに、ステップS801、S803、S805、S807を追加している。
【0044】
ステップS801、S803、S805は、それぞれ、符号化フェーズ、符号化・再符号化フェーズ、転送フェーズにおいて、入力部101からの1ページ分の画像データの入力が終了したことを検知する。
【0045】
符号化フェーズと転送フェーズで1ページ分の画像データの入力が終了したことを検知した場合(ステップS801、S805)、ステップS807へ移り、当該ページの圧縮符号化処理を終了し、次に処理すべき1ページ以上の画像データがあれば、次の1ページ分の画像データの圧縮符号化処理を開始し、無ければ停止状態に入る。
【0046】
一方、符号化・再符号化フェーズで1ページ分の画像データの入力終了を検知した場合(ステップS803)には、符号化部102では再符号化処理する画像データが無くなるまで一旦動作を止める必要があるので、ステップS311の符号化処理をパスし、ステップS313で、今までに符号化部102で符号化済みの画像データを所定の符号化データ量に抑える為の再符号化処理のみを継続して行なう。再符号化処理が全て終了して、その後の転送処理が終わらないと、1ページ分の画像データ全体の符号化データが第1のメモリ上に集まらないため、1ページ分の画像データの入力終了後も再符号化処理及びそれに続く転送処理は継続して行われる必要がある。この場合には、ステップS315にて、再符号化処理が全て終了したことを検知すると、符号化・再符号化フェーズ中に、第2のメモリ106のみに格納された符号化データを第1のメモリに転送し(ステップS317)た後、次のステップS805にて、1ページ分の画像データの入力終了が検知されてステップS807へ移ることになる。
【0047】
以上が実施形態における動作であり、図8の動作説明でもある。
【0048】
<メモリ格納方法の変形例>
図9、図10は図5、図6の概念図で示したメモリ格納方法の変形例を示す図である。
【0049】
図5の概念図においては、符号化・再符号化フェーズでは、符号化部102から出力する符号化データは第2のメモリ106のみに格納していたが、図9に示すように符号化・再符号化フェーズ中に、符号化部102から出力する符号化データを第1、第2メモリの両方に直接格納する。
【0050】
符号化部102から見ると、どのフェーズで符号化して出力する符号化データも両方のメモリへ格納することになる。また、図6の概念図とは異なり、図10に示す様に、転送フェーズでメモリ間のデータ転送が必要なくなる。またこの変形例の場合には、符号化・再符号化フェーズにおいて、符号化データと再符号化データを第1のメモリ104へ送った順序で順次格納される。そのため2種類のデータが入り混じってしまうという問題は有る。
【0051】
従って、この変形例の場合にはこれに対応する為に符号化データをある単位で区切って、ファイル或いはパケットとして管理する様にする。具体的には、ファイル管理テーブル、或いは、パケット管理テーブル等を別に作成して管理する。
【0052】
一つの手法としては、符号化部102からのデータを第1メモリ104に格納する際、適当な単位(例えば前記直交変換の単位が8×8のブロックであるので、8×i(i=1、2…の整数)ライン分のデータ)毎に、画像データの先頭から管理番号を割り当て、各管理番号に対応する符号化データの格納先頭アドレスと該符号化データ量とを、管理番号順に格納できるような管理テーブルを作成する。
【0053】
符号化部102や再符号化部109は処理中のデータの管理番号を保持し、該管理番号に基づいて、符号化データ格納時の先頭アドレスと符号化データ量とを管理テーブルに書き込む。このようにすれば、符号化部102と再符号化部109で処理した符号化データをランダムに格納したとしても、前記管理テーブルを管理番号順にアクセスし、その時読み出させる先頭アドレスと符号化データ量に基づいて、符号化データを第1メモリ104から読み出せば、画像の先頭から順番に符号化データを読み出すことができる。このような管理機構を設ければ、画像上で連続するデータをメモリ上で連続するように格納する必要性が無くなる。
【0054】
図10の概念図における転送フェーズ後の符号化フェーズは、これまで説明した2つの符号化フェーズ(図4、図7)とほとんど同じであり、第1のメモリ内における符号の格納状態が図11に示した様に若干異なるだけである。よって、先の説明と本変形例は、3つのフェーズを繰り返して処理することに変わりは無い。
【0055】
<第2の実施形態>
以下、本発明において特徴的な符号化処理を行なう為の、第2の基本構成を図2を用いて説明する。
【0056】
図2は、第2の実施形態における画像処理装置200のブロック構成図である。
【0057】
図1の画像処理装置100と大きく異なる点は、最初に符号化を行なう符号化部が2つ並列に存在する点である。画像処理装置200は、入力部201から入力される画像データを、第1の符号化部202と第2の符号化部205で並行して符号化し、互いに圧縮率の異なる2種類の符号化データを生成する。本実施形態においても、符号化方式は公知のJPEG符号化方式を用い、8×8画素単位に相当する画像データを直交変換し、後述する量子化ステップを用いた量子化、ハフマン符号化処理を行なうものである。
【0058】
なお、本第2の実施形態では第1の符号化部202よりも、第2の符号化部205の方が適用する圧縮率を高く設定する場合について説明する。具体的には、第1の符号化部202における量子化ステップをQ1、第2の符号化部205の量子化ステップをQ2(=2×Q1)とする。
【0059】
符号化部202から出力される符号化データは、第1のメモリ制御部203を経由して、第1のメモリ204に格納される。このとき、第1のカウンタ208は、符号化部202から出力される符号化データのデータ量をカウントし、これを保持すると共に、符号化シーケンス制御部209にも出力する。
【0060】
一方、符号化部205で符号化された符号化データは、第2のメモリ制御部206を経由して、第2のメモリ207に格納される。このとき、第2のカウンタ210は、符号化部205から出力される符号化データのデータ量をカウントし、これを保持する。更に、後述する第2のメモリ207に格納している符号化データを第1のメモリ204に転送する時には、それと同時に上記カウント値を、第1のカウンタ208に転送する。
【0061】
さて、第1のカウンタ208が符号化部202から出力される符号化データのデータ量をカウント中に、該カウント値がある設定値に達した時には、符号化シーケンス制御部209は、第1の実施形態と同様、メモリ制御部203に対してメモリ204に格納されているデータを廃棄するよう制御信号を出す。
【0062】
そして、符号化シーケンス制御部209は、第2のメモリ207に格納している符号化データを読み出して第1のメモリ204に転送し、第1のメモリ204に格納するよう、メモリ制御部206とメモリ制御部203に制御信号を出力する。この結果、第2のカウンタ210のカウント値が第1のカウンタ208に転送され、その値が第1のカウンタのカウント値としてロード(上書き)される。
【0063】
要するに、上記第2のカウンタ210のカウント値は、第2のメモリ207に格納している符号化データのデータ量を表わしているので、そのカウント値と符号化データを、互いの対応付けが変わらない様に、そのまま第1のカウンタと第1のメモリへコピーしたと考えれば良い。
【0064】
さらに、符号化シーケンス制御209は、第1の符号化部202および、第2の符号化部205に対して、今までよりも、符号化データが少なくなるような符号化を行なうように制御信号を出す。
【0065】
例えば、第1の符号化部202、及び、第2の符号化部205における量子化ステップSを2倍に切り替えす。この結果、第1の符号化部202は、その直前までの第2の符号化部205における量子化ステップQ2(=2×Q1)を継承することになり、第2の符号化部205は更に大きな量子化ステップQ2×2を用いて、次のオーバーフローに備えた更に高い圧縮率の符号化処理を行うことになる。
【0066】
ここでは、量子化ステップの倍率比を2倍としたがこれに限らず、任意に設定できることは示すまでもない。切り替えられた各符号化部202、205から出力された符号化データは、それぞれ、対応するメモリ制御部203、206を経由して、対応するメモリ204、207に格納される。
【0067】
そして、符号化シーケンス制御209は、メモリ制御部206に対し、既に第2のメモリ内に格納している符号化データを読み出して、再符号化部211にデータを送るよう制御信号を出す。再符号化部211は、図1の再符号化部109と同様にして符号化データの再符号化処理を行なう。
【0068】
第3のカウンタ212は、再符号化部211が出力したデータ量をカウントするもので、再符号化処理を開始する直前にゼロにリセットされ、再符号化処理中の出力データ量をカウントする。このカウンタ212は、再符号化処理が終了した時点で、そこで得られたカウント値を第2のカウンタ210に転送する。
【0069】
第2のカウンタ210は、上記転送されてきたデータ量カウント値を、第2のカウンタ210内に保持しているカウンタ値に加算することにより、再符号化処理中にメモリ207に格納した、符号化データと再符号化データの合計のデータ量を算出する。即ち、メモリ207に格納しているデータ量とカウンタ210のカウント値とが一致する。
【0070】
再符号化処理の終了/未終了に関わらず、符号化するべき入力部201からの画像データが残っていれば、2つの符号化部202と205による符号化処理を継続して行なう。そして、カウンタ208のカウント値がある設定値に達したかどうかの監視は入力部201から入力される1ページ分の画像データの符号化処理(符号化、再符号化)が終わるまで繰り返され、上述した符号化と再符号化の処理は、ここで得られる検出結果に応じた制御の上で実行される。
【0071】
上記図2の構成における処理のフローを表わすフローチャートを図12に示す。
【0072】
図2で説明したように符号化部が2つある場合は、図12に示すフローチャートに基づいて1ページ分の画像データの符号化を行なう。なお、図12の説明は、符号化部が1つの場合のフローチャートである図8とは、大半は類似しており、当業者であれば上記説明から本第2の実施形態の特徴は十分に理解できるであろうから、符号化部1つの場合と同じように3つのフェーズで処理を説明する様にし、図8と異なる点を主に説明することとする。
【0073】
上述した図8のフローと本実施形態のフローとの一番大きな違いは、ステップS317の転送処理が、ステップS307とステップS309の間に移動していることである。要するに、符号化・再符号化フェーズと転送フェーズが入れ替わったと見なせば良い(ステップS307の符号化データの廃棄処理は例外である)。
【0074】
ステップS301の符号化パラメータの初期設定では、第1の符号化部202に量子化ステップQ1を、第2の符号化部205には量子化ステップQ2(=2×Q1)を設定する。
【0075】
符号化フェーズでは、ステップS801、S303、S305を繰り返し実行する。ステップS801とステップS305は符号化部が1つの場合と同じ処理であるが、ステップS303の符号化処理だけは図13に示すように異なっている。
【0076】
第1のメモリ204へ格納する符号化データは圧縮率が段階的に高くなるようにするため、最初に格納する符号化データは圧縮率が一番低い量子化ステップQ1で符号化したデータを格納し、第2のメモリへ格納する符号化データは量子化ステップQ2で符号化したデータを格納する。
【0077】
第1のメモリ204へ格納中のデータ量が設定されている上限値をオーバーしたら(ステップS305)、直ちに、第1のメモリ204で保持していた符号化データを廃棄し(ステップS307)、第2のメモリ207で保持している圧縮率の高い符号化データを、第1のメモリ204へ転送する(ステップS317、図14参照)。これにより、第1の実施形態(図1)で説明した1回目の再符号化処理の終了を待たずに、速やかに、上限値をオーバーしない適切な2番目の候補の符号化データを第1のメモリ207内に格納出来る。これが、図1に対する、2つの符号器を持つ図2を適用することの最大の利点である。
【0078】
本第2の実施形態では、2つのメモリ204、207で同じ圧縮率の符号化データを持っていることが無駄という考え方なので、第2のメモリ207には、第1のメモリ204に格納する符号化データよりも圧縮率の高い符号化データを格納しておくようにしている。従って、それ以降の処理もこの考え方に基づき行われるものであり、第2のメモリ207内の符号化データを第1のメモリ204に転送する処理(転送フェーズ)が終了した後は、第2のメモリ207の符号化データを、更に1段階圧縮率の高い符号化データを保持する様に再符号化することとなる。
【0079】
具体的には、まず図15に示す様に、転送フェーズの次の符号化・再符号化フェーズでは、上記再符号化の前に、2つの符号化部202,205に適用される各量子化ステップQ1、Q2をそれぞれQ2、Q3へ変更し(ステップS309)、1ページの画像データの入力が終了せずに続いていれば(ステップS803)、後続の画像データは新たな量子化ステップが設定された2つの符号化部で該入力データを符号化して(ステップS311)、対応する各メモリ204,207へ格納する。そして、上記符号化処理と並行して第2のメモリに格納されている符号化データ(第1のメモリ204に転送したもの)は、第1のメモリ内の符号化データよりも1段階高い圧縮率の符号化データに変更するべく、再符号化部211にて量子化ステップQ3を用いて符号化されたデータが得られる様な再符号化処理(S313)を行ない、再符号化データを第2のメモリ207に格納し直す。
【0080】
なお、本第2の実施形態でも、第1の実施形態と同様、再符号化処理では、符号化データを一旦ハフマン復号した後の各量子化値に対して、これら値を2nで割った結果と同様の結果が出るビットシフト処理を施した後、再度ハフマン符号化を行なうことにより実現される。この方法は、ビットシフトのみで量子化ステップを変更する点と逆直交変換や再直交変換処理を行わない点で、高速な再符号化処理が可能である。
【0081】
なお、本第2の実施形態の様に符号化部が2つ有る場合には、図15に示したように、第2のメモリ207に符号化データと再符号化データを混在して格納する状況が発生する。従って、前述したように、符号化データをある単位で区切って、ファイル或いはパケットとして管理することが、第2のメモリ207に対しても必要になる。その為には、例えば第1の実施形態における変形例と同様の構成を設ければ良いであろう。
【0082】
図12において、再符号化処理の終了をステップS315で検知したら、また符号化フェーズ(ステップS801、S303)に移行する。なお、符号化・再符号化フェーズ後の符号化フェーズでは、図16に示すように、2つのメモリ204,207が保持する符号化データは圧縮率が違うだけでなく、符号化データの混在の仕方(アドレス)もかなり違ってくる。従って、再度、第1のメモリ204のデータ量が設定値をオーバーした場合には、第2のメモリ207で保持されている符号化データ(▲6▼+▲8▼の横縞の領域の符号)が第1のメモリ204へ転送される必要が出てくる。これらを考慮すると、第2のメモリ207だけでなく、第1のメモリ204でも符号化データをファイル或いはパケットとして管理する必要がある。よって、第1のメモリ204にも前述の管理テーブルを用いた管理機構が必要となる。
【0083】
図16に示された符号化フェーズの状態は、量子化ステップと符号化データの混在の仕方が、再符号化処理の前後で異なっていること以外は、初期状態の符号化フェーズ(図13)と同じである。よって、符号化フェーズ、転送フェーズと符号化・再符号化フェーズを繰り返すことで、最終的に、1ページ分の画像データを設定した上限値以下に圧縮した符号化データを確実に第1のメモリ204に格納することが出来る。
【0084】
なお、第1の実施形態の説明とは、転送フェーズと符号化・再符号化フェーズの配置順が逆であることから、図8において転送処理後に行なっていた1ページ分の画像データの入力終了検知(ステップS805)は、符号化・再符号化フェーズで行なう1ページ分の画像データの入力終了検知(ステップS803)と、ほとんど同じタイミングになってしまう。また、2つの検知処理は、機能的にはステップS805と同じで、タイミング的にはステップS803と同じである、従って、これら2つのステップは、新たな1ページ分の画像データの入力終了を検知するステップとして統合し、ステップS1201と表記しておく。
【0085】
以上説明した第1、第2の実施形態では、第1のメモリと第2のメモリは物理的に別のメモリであるとして説明をしてきた。これは、2つのメモリに対するアクセスが独立したものとすることができるので有利なためであり、本発明の特徴となす。しかしながら、第1のメモリと第2のメモリを、物理的に別のメモリとしない場合も本発明の範疇に含まれる。物理的に1つのメモリ上に、前記第1のメモリと第2のメモリに相当する2つの領域を確保して、第1のメモリを第1のメモリ領域、第2のメモリを第2のメモリ領域と言い直して、これまでの説明を読み直せば、本発明は、1つのメモリでも実現できることが分かる。
【0086】
また、1つのメモリで上記各実施形態を実現する場合には、前記転送フェーズで説明したデータ転送処理のいくつかは不要となる。その詳細はその都度容易に想像できるので説明は省略するが、前記2つの領域を厳密に別けて使用する場合、物理的に2つのメモリを持つ時と同じようにデータ転送処理が必要であるが、2つの領域間で同じデータを共有することになれば、データ転送処理が不要になるだけでなく記憶容量の削減も図れる。
【0087】
例えば、第2のメモリ領域で保持していた符号化データを、第1のメモリ領域へ転送する際、該符号化データが格納されている先頭アドレスとデータサイズの2つの情報を第2のメモリ制御部から第1のメモリ制御部へ転送するだけで、前記符号化データを転送したのと同じ効果が得られる。
【0088】
前記符号化データを、ファイル形式やパケット形式で格納している場合は、メモリ制御部の間で転送する情報は少し増え、該符号化データに関連する管理テーブル情報を転送する必要がある。それでも、符号化データを転送するよりは、効率が良い。
【0089】
<適用例>
上記第1、第2の実施形態では、イメージスキャナから画像を読み取る装置を例にし、その装置の機能動作について説明した。そして、その機能のほとんど(符号化処理も含む)は、上述した様にコンピュータプログラムによって実現できる。
【0090】
従って、本発明はパーソナルコンピュータ等の汎用情報処理装置上で動作するアプリケーションプログラムに適用しても構わない。アプリケーションプログラムに適用する場合には、圧縮元となる画像ファイルをユーザに指定させると共に、目標サイズをユーザに選択させる等のGUIを設ければ良いであろう。このときの目標値は、ユーザーが任意に設定できるものとするが、数値での設定はわかりずらいので、原稿サイズと画質(高中低等)を加味した直感的に分かりやすいメニューから選択させることで、決定するようにすれば良いであろう。
【0091】
また、第1、第2の実施形態では、符号化部の符号化パラメータとして量子化ステップを例にして説明したが、圧縮率の異なるデータが混在した際に、それらの間での画質が違和感が発生しないようにする限りは、他のパラメータを用いても良い。但し、例えば、図1の構成においては、再符号化部109からの再度符号化するデータが、パラメータ変更後の符号化部102からの符号化データと実質的に同じにするには、上記実施形態に示す如く、量子化ステップを増加する手法が好ましい。
【0092】
また、上記の通り、本発明は、汎用装置上で動作するアプリケーションプログラムによって実現できるものであるので、本発明はコンピュータプログラムをも含むものである。また、コンピュータプログラムは、通常、フロッピーディスクやCDROM等の記憶媒体を装置にセットしてコピー或いはインストールことで行われるので、かかる記憶媒体も本発明の範疇に当然に含まれる。
【0093】
また、本発明は、コンピュータプログラムと適当なハードウェア(符号化回路等)の組み合わせにも適用できる。
【0094】
以上説明したように本実施形態によれば、画像データを周波数変換した後、量子化し、可変長符号化を行なう符号化手段と、前記量子化にて利用される量子化ステップを切り替え制御する量子化ステップ制御手段と、前記符号化手段にて得られる符号化データを、該符号化データを得るのに利用された量子化ステップとは別の量子化ステップで符号化することにより得られるべき別の符号化データへと変換する、前記符号化手段とは別に設置された符号化データ変換手段と、前記符号化手段或いは、符号化データ変換手段にて得られた符号化データを少なくとも1ページ分格納する格納手段と、前記格納手段に格納された符号化データの量を監視する監視手段とを備える様にし、前記符号化データの量に応じて、前記量子化ステップ制御手段における量子化ステップの変更と、前記符号化データ変換手段の双方を連携させて制御することにより、1ページ分の画像データを所望の符号化データ量になる様にすることを1度の符号化処理により、少ない容量のメモリに確実に符号化データを格納できる。
【0095】
【発明の効果】
以上説明したように本発明によれば、1度の画像入力により、効果的に設定したサイズに収まる符号化データを生成することが可能になる。
【図面の簡単な説明】
【図1】第1の実施形態における画像処理装置のブロック構成図である。
【図2】第2の実施形態における画像処理装置のブロック構成図である。
【図3】第1の実施形態における処理を簡略化して示したフローチャートである。
【図4】第1の実施形態における初期状態の符号化フェーズにおけるデータフローとメモリ内容を表わす図である。
【図5】第1の実施形態における符号化・再符号化フェーズにおけるデータフローとメモリ内容を表わす図である。
【図6】第1の実施形態における転送フェーズにおけるデータフローとメモリ内容を表わす図である。
【図7】第1の実施形態における転送フェーズ後の符号化フェーズにおけるデータフローとメモリ内容を表わす図である。
【図8】第1の実施形態における処理の詳細を示すフローチャートである。
【図9】第1の実施形態の変形例における符号化・再符号化フェーズにおけるデータフローとメモリ内容を表わす図である。
【図10】第1の実施形態の変形例における転送フェーズにおけるデータフローとメモリ内容を表わす図である。
【図11】第1の実施形態の変形例における転送フェーズ後の符号化フェーズにおけるデータフローとメモリ内容を表わす図である。
【図12】第2の実施形態における処理手順を示すフローチャートである。
【図13】第2の実施形態における初期状態の符号化フェーズにおけるデータフローとメモリ内容を表わす図である。
【図14】第2の実施形態における転送フェーズにおけるデータフローとメモリ内容を表わす図である。
【図15】第2の実施形態における符号化・再符号化フェーズにおけるデータフローとメモリ内容を表わす図である。
【図16】第2の実施形態における符号化・再符号化フェーズ後の符号化フェーズにおけるデータフローとメモリ内容を表わす図である。
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to an image processing apparatus having a function of compressing and encoding image data within a predetermined code amount.
[0002]
[Prior art]
Conventionally, as a still image compression method, a JPEG method using discrete cosine transform and a method using Wavelet transform are often used. Since this type of encoding method is a variable length encoding method, the amount of code changes for each image to be encoded.
[0003]
In the JPEG method, which is an international standardization method, only one set of quantization matrices can be defined for an image. Accordingly, the code amount cannot be adjusted without pre-scanning, and there is a risk of memory over when used in a system that stores data in a limited memory.
[0004]
In order to prevent this, in order to adjust the code amount by changing the compression rate and re-reading the original when the code amount exceeds the planned code amount, or by estimating the code amount by pre-scanning in advance , The method of resetting the quantization parameter was taken.
[0005]
As a code amount control method for performing pre-scanning, for example, there is a method in which pre-compressed data is stored in an internal buffer memory, decompressed, changed in compression parameters, subjected to main compression, and output to an external storage. At this time, in the main compression, the compression rate is set higher than in the pre-compression.
[0006]
Further, for example, in order to obtain an allowable code amount for each pixel block and reduce the code amount, a method of performing Huffman coding on a coefficient obtained by level-shifting a DCT coefficient n times is known. This shift amount n is an allowable code amount. Determined from.
[0007]
[Problems to be solved by the invention]
However, conventionally, a compression buffer larger than the target compression is required as the compression buffer, and in order to prevent an overflow of the buffer used intermediately, it is inevitable that the capacity is sufficient to record the original image data.
[0008]
Furthermore, in the method of repeating the encoding process, there is a problem that the speed of continuous processing is not increased because a process of decoding and recompressing all compressed data is performed.
[0009]
The present invention has been made in view of the above-described conventional example, and an image processing apparatus capable of generating encoded data that fits in an effectively set size by one image input, a control method thereof, and A computer program and a storage medium are to be provided.
[0010]
[Means for Solving the Problems]
In order to solve this problem, for example, an image processing apparatus of the present invention comprises the following arrangement. That is,
An image processing apparatus for compressing and encoding image data,
First compression means for compressing input image data with a compression parameter corresponding to a first compression rate, and storing the generated encoded data in a storage means ;
Second compression means for decoding and recompressing the encoded data generated by the first compression means;
Monitoring means for monitoring the amount of encoded data generated by the first compression means, and determining whether the amount of encoded data reaches a set value;
When it is determined by the monitoring means that the encoded data amount reaches a set value,
The compression parameter applied to the first compression means is updated to a compression parameter corresponding to a second compression rate higher than the first compression rate, and subsequently input image data is subjected to the first compression. Compressed by means,
The encoded data previously generated by the first compression unit is recompressed by the second compression unit with a compression parameter corresponding to a second compression rate higher than the first compression rate,
The encoded data obtained by the recompression is stored in the storage unit as encoded data generated by the first compression unit after updating the compression parameter applied to the first compression unit,
Control means for storing the encoded data generated by the first compression means after updating the compression parameter in the storage means as subsequent encoded data.
[0011]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, embodiments according to the present invention will be described in detail with reference to the accompanying drawings.
[0012]
FIG. 1 is a functional block configuration diagram of an image processing apparatus 100 according to the embodiment. Hereafter, each part of the same figure is demonstrated easily.
[0013]
The image processing apparatus 100 according to the embodiment includes an input unit 101 that inputs an image from an image scanner. The input unit 101 may input image data from page description language rendering or the like, or may be realized by reading an image file stored in a storage medium. Anyway.
[0014]
The encoding unit 102 encodes input image data. In this embodiment, a known JPEG encoding method is used as the encoding method, image data corresponding to 8 × 8 pixel units is orthogonally transformed, and quantization and Huffman encoding processing using a quantization step described later are performed. Is to do.
[0015]
The first memory control unit 103 and the second memory control unit 105 transmit the encoded data (the same encoded data) output from the encoding unit 102 to the first memory 104 and the second memory, respectively. Control is performed so that the data is stored in 106. Here, the first memory 104 is a network device or an image output device for connecting the encoded data finally determined (compressed to the data amount within the target value) outside the basic configuration of FIG. And a memory for holding the encoded data for output to a mass storage device or the like. The second memory 106 is a working memory that assists in the compression encoding process for forming the encoded data on the first memory.
[0016]
The counter 107 counts the data amount of the image data compressed and encoded by the encoding unit 102, holds the count value, and outputs the count result to the encoding sequence control unit 108 that controls the encoding sequence. To do.
[0017]
The encoding sequence control unit 108 detects whether or not the count value of the counter 107 has reached a certain set value. When it is detected that the set value has been reached (exceeded the target value), it has been stored in the memory 104. A control signal is output to the first memory control unit 103 so as to discard the data. The first memory control unit 103 discards the stored data by clearing the memory address counter or clearing the encoded data management table based on this control signal. At this time, the encoding sequence control unit 108 clears the first counter 107 to zero (the input from the input unit 101 continues), and the encoding unit 102 has a higher compression rate than before. To control encoding. That is, control is performed so that the amount of encoded data generated in the encoding process of this apparatus is finally reduced to, for example, ½. In addition, although it set to 1/2 here, it cannot be overemphasized that it can set arbitrarily.
[0018]
The encoded data after the compression rate change is also stored in the first memory 104 and the second memory 106 via the first memory control unit 103 and the second memory control unit 105, respectively, as before. The
[0019]
Furthermore, the encoding sequence control unit 108 reads out the encoded data stored in the second memory 106 so far to the second memory control unit 105 and re-encoding unit 109 serving as encoded data conversion means. A control signal is output to output the encoded data.
[0020]
The re-encoding unit 109 decodes the input encoded data, performs re-quantization to reduce the amount of data, etc., and then performs the encoding process again, and is the same as the encoding unit 102 whose compression rate has been changed. The data amount of the compression rate is output to the second counter 110.
[0021]
The encoded data output from the re-encoding unit 109 is stored in the first memory 104 and the second memory 106 via the first memory control unit 103 and the second memory control unit 105, respectively. Is done.
[0022]
The second memory control unit detects whether or not the re-encoding process has been completed. That is, when there is no more data to be read for the re-encoding process, the encoding sequence control unit 108 is notified of the end of the re-encoding process. Actually, not only the reading process of the second memory control unit 105 but also the process of the re-encoding unit 109 is completed, the encoding process is completed.
[0023]
The count value obtained by the second counter 110 is added to the counter value held by the first counter 107 after the re-encoding process is completed. This addition result represents the total amount of data in the first memory 104 immediately after the re-encoding process is completed. That is, at the time when the encoding process of the encoding unit 102 and the re-encoding unit 109 for one screen is completed, the counter value held in the first counter 107 after the addition is equivalent to one screen. Represents the total amount of data generated when is encoded (details will be described later).
[0024]
The encoding unit 102 continues the encoding process as long as image data from the input unit 101 to be encoded remains, regardless of whether the re-encoding process is completed or not.
[0025]
Whether or not the count value of the counter 107 has reached a certain set value is repeated until the encoding process (encoding and re-encoding) of one page of image data input from the input unit 101 is completed. The re-encoding process is executed under control according to the detection result obtained here.
[0026]
FIG. 8 is a flowchart showing the process flow in the configuration shown in FIG. 1, but for the sake of simplicity, description will be given first according to the simplified flowchart shown in FIG.
[0027]
As described above, the image processing apparatus 100 of the present invention is an apparatus that compresses and encodes one page of image data input from the input unit 101 such as a scanner to a predetermined data amount or less. In order to realize the encoding process, in addition to the input unit 101, an encoding unit 102, a re-encoding unit 109, a first memory 104, a second memory 106, and the like are provided. Using these functional blocks, encoding processing is performed based on the flowchart shown in FIG.
[0028]
The flowchart of FIG. 3 is roughly divided into the following three processing phases.
(1) Encoding phase (2) Encoding / re-encoding phase (3) Transfer phase In each of the above processing phases, how image data, encoded data, etc. are processed and processed in the memory FIG. 4 to FIG. 7 show whether the data is stored visually.
[0029]
FIG. 4 shows an initial state of the encoding phase corresponding to steps S303 and S305 in the flowchart of FIG. 5 shows the processing state of the encoding / recoding phase corresponding to steps S307 to S315, FIG. 6 shows the processing state of the transfer phase corresponding to step S317, and FIG. 7 shows the encoding phase after the transfer phase. Indicates processing status. Hereinafter, each phase will be described.
[0030]
<< Encoding Phase >>
Encoding processing of image data for one page starts from initial setting of encoding parameters (step S301). Here, the upper limit value of the encoded data amount uniquely determined from the image size to be encoded (paper size read from the input unit 101 such as a scanner) or the encoding unit 102 (in this embodiment, a known JPEG encoding method is used. Parameter such as a quantization step (Q1) to be applied.
[0031]
In step S303, the first counter 107 performs actual encoding processing (JPEG compression in units of 8 × 8 pixels of the image), and cumulatively counts the amount of encoded data to be output.
[0032]
Next, in step S305, it is detected whether the count value of the data amount has exceeded the upper limit value. If not, the JPEG encoding process in step S303 is continued. This is the initial encoding phase.
[0033]
The encoded data output from the encoding unit 102 is stored in both the first memory 104 and the second memory 106 as shown in FIG. A region indicated by vertical stripes represents the stored code.
[0034]
<< Encoding / Recoding Phase >>
When the encoding process of the encoding unit 102 proceeds and the count value of the data amount exceeds the set upper limit value, in step S307, the encoded data in the first memory 104 is discarded and the step In step S309, the quantization step of the encoding unit 102 is changed to Q2.
[0035]
That the count value of the data amount of the encoded data exceeds the set upper limit value means that the data amount after compression does not fall within the target value. Therefore, since it is meaningless to continue the encoding process using the same quantization step, it is changed to the quantization step Q2 having a larger quantization step width than Q1 so that the data amount is smaller than before. is there.
[0036]
After changing the quantization step, in step S311, the encoding process of the encoding unit 102 is restarted, and the encoded data is stored only in the second memory 106 as shown in FIG. In parallel with this, the re-encoding process in step S313 is performed. In the re-encoding process, the encoded data stored in the second memory 106 is read out, re-encoded by the re-encoding unit 109, and stored in the two memories 104 and 106. Then, the encoding process and the re-encoding process are continued until all the codes of the vertical stripes (1) are re-encoded. The re-encoded data output from the re-encoding unit 109 has exactly the same code as the encoded data obtained by encoding in the same quantization step as the encoded data output from the encoding unit 102 after changing the quantization step. Data.
[0037]
Specifically, in this re-encoding process, after the Huffman decoding of the encoded data, each quantized value is subjected to a bit shift process that produces a result similar to the result obtained by dividing these values by 2 n This is realized by performing Huffman coding again. This method enables high-speed re-encoding processing in that the quantization step is changed only by bit shift and that inverse orthogonal transformation or re-orthogonal transformation processing is not performed. In step 315, the end of the re-encoding process is detected.
[0038]
Since the amount of data after re-encoding is smaller than the amount of encoded data before re-encoding, as shown in FIG. 5, after re-encoding in the memory area where the code before re-encoding was stored Can be stored so as to be overwritten. When the re-encoding process is completed, the data amount of the encoded data of the vertical stripes (1) decreases to the data amount of the encoded data of the diagonal stripes (1) shown in FIG.
[0039]
Steps S307 to 315 described above are processes performed in the encoding / recoding phase.
[0040]
<< Transfer Phase >>
When the re-encoding process is completed, a transfer process is performed in step S317. In the transfer process, as shown in FIG. 6, encoded data of diagonal stripes (2) stored only in the second memory 106 in the encoding / re-encoding phase is converted into diagonal lines ▲ in the first memory 104. It is transferred to the address linked to the encoded data 1) and stored. On the other hand, the encoded data of the diagonal stripe {circle around (1)} and the encoded data of the diagonal stripe {circle around (2)} dispersed on the second memory 106 are continuously stored on the first memory 104. Similarly, the encoded data of the diagonal stripe {circle around (2)} is transferred in the second memory 106 and connected. This is processing performed in the transfer phase.
[0041]
When the transfer phase ends, the process returns to the encoding phase of steps S303 and S305, and the code of the diagonal stripe (4) is output from the encoding unit 102 and stored in the two memories 104 and 106 as shown in FIG. This encoding phase is slightly different from the encoding phase in the initial state (FIG. 4), the quantization step at the time of encoding by the encoding unit 102 is changed from Q1 to Q2, and the two memories 104 and 106 The encoded data stored in is also a collection of codes processed in various phases. If these differences are ignored, the encoding phase immediately after the transfer phase and the initial encoding phase can be regarded as the same.
[0042]
Therefore, by repeating the encoding phase, the encoding / re-encoding phase, and the transfer phase, the code that finally compresses the image data of one page below the data amount setting value is stored in the first memory. I can do it. In addition, the input unit 101 simply continues input until a series of processing is completed. That is, it is not necessary to input the image again from the beginning.
[0043]
The flowchart shown in FIG. 3 describes only the processing corresponding to each phase shown in FIGS. 4, 5, and 6 so that the explanation can be easily understood. In practice, however, the input of image data for one page ends in some phase. Therefore, the correspondence after that is slightly different depending on which phase it is completed. FIG. 8 is a flowchart showing the flow considering this. The flowchart in FIG. 8 considers the relationship between the completion of input of image data for one page and the various processes described with reference to FIG. 3. Here, steps S801, S803, S805, and S807 are added to the flowchart in FIG. It has been added.
[0044]
Steps S801, S803, and S805 detect that the input of image data for one page from the input unit 101 has been completed in the encoding phase, the encoding / recoding phase, and the transfer phase, respectively.
[0045]
If it is detected that the input of image data for one page has been completed in the encoding phase and the transfer phase (steps S801 and S805), the process proceeds to step S807, where the compression encoding process for the page is ended, and the next process is performed. If there is more than one page of image data, the compression encoding process of the next one page of image data is started, and if there is no image data, a stop state is entered.
[0046]
On the other hand, when the end of input of image data for one page is detected in the encoding / re-encoding phase (step S803), the encoding unit 102 needs to stop operation until there is no image data to be re-encoded. Therefore, the encoding process of step S311 is passed, and in step S313, only the re-encoding process for suppressing the image data encoded by the encoding unit 102 so far to a predetermined encoded data amount is continued. And do it. When all the re-encoding processes are completed and the subsequent transfer process is not completed, the encoded data of the entire image data for one page is not collected on the first memory, so the input of the image data for one page is completed. After that, the re-encoding process and the subsequent transfer process need to be performed continuously. In this case, when it is detected in step S315 that all the re-encoding processes have been completed, the encoded data stored only in the second memory 106 is stored in the first memory during the encoding / re-encoding phase. After the transfer to the memory (step S317), in the next step S805, the input end of the image data for one page is detected, and the process proceeds to step S807.
[0047]
The above is the operation in the embodiment, and is also the operation description of FIG.
[0048]
<Modification of memory storage method>
9 and 10 are diagrams showing modifications of the memory storing method shown in the conceptual diagrams of FIGS.
[0049]
In the conceptual diagram of FIG. 5, in the encoding / re-encoding phase, the encoded data output from the encoding unit 102 is stored only in the second memory 106. However, as shown in FIG. During the re-encoding phase, the encoded data output from the encoding unit 102 is directly stored in both the first and second memories.
[0050]
When viewed from the encoding unit 102, encoded data to be encoded and output in any phase is stored in both memories. Further, unlike the conceptual diagram of FIG. 6, as shown in FIG. 10, it is not necessary to transfer data between memories in the transfer phase. In the case of this modification, the encoded data and the re-encoded data are sequentially stored in the order in which they are sent to the first memory 104 in the encoding / re-encoding phase. Therefore, there is a problem that two types of data are mixed.
[0051]
Therefore, in the case of this modification, the encoded data is divided into certain units and managed as a file or a packet in order to cope with this. Specifically, a file management table or a packet management table is created and managed separately.
[0052]
As one method, when data from the encoding unit 102 is stored in the first memory 104, an appropriate unit (for example, 8 × i (i = 1 because the unit of the orthogonal transform is an 8 × 8 block). 2) (integer) for each line), a management number is assigned from the top of the image data, and the storage start address of the encoded data corresponding to each management number and the amount of the encoded data are stored in the order of the management number. Create a management table that can be used.
[0053]
The encoding unit 102 and the re-encoding unit 109 hold the management number of the data being processed, and based on the management number, write the start address and the encoded data amount when storing the encoded data in the management table. In this way, even if the encoded data processed by the encoding unit 102 and the re-encoding unit 109 is randomly stored, the management table is accessed in the order of the management number, and the head address and the encoded data to be read at that time are read. If the encoded data is read from the first memory 104 based on the amount, the encoded data can be read sequentially from the top of the image. Providing such a management mechanism eliminates the need to store continuous data on the image so as to be continuous on the memory.
[0054]
The encoding phase after the transfer phase in the conceptual diagram of FIG. 10 is almost the same as the two encoding phases described above (FIGS. 4 and 7), and the code storage state in the first memory is shown in FIG. It is only slightly different as shown in. Therefore, the above description and this modification are the same in that the three phases are repeated.
[0055]
<Second Embodiment>
Hereinafter, a second basic configuration for performing a characteristic encoding process in the present invention will be described with reference to FIG.
[0056]
FIG. 2 is a block diagram of an image processing apparatus 200 according to the second embodiment.
[0057]
A significant difference from the image processing apparatus 100 of FIG. 1 is that two encoding units that perform encoding first exist in parallel. The image processing apparatus 200 encodes image data input from the input unit 201 in parallel with the first encoding unit 202 and the second encoding unit 205, and two types of encoded data having different compression rates. Is generated. Also in this embodiment, a known JPEG encoding method is used as the encoding method, image data corresponding to 8 × 8 pixel units is orthogonally transformed, and quantization and Huffman encoding processing using a quantization step described later are performed. To do.
[0058]
In the second embodiment, the case where the compression rate applied by the second encoding unit 205 is set higher than that of the first encoding unit 202 will be described. Specifically, the quantization step in the first encoding unit 202 is Q1, and the quantization step in the second encoding unit 205 is Q2 (= 2 × Q1).
[0059]
The encoded data output from the encoding unit 202 is stored in the first memory 204 via the first memory control unit 203. At this time, the first counter 208 counts the amount of encoded data output from the encoding unit 202, holds this, and also outputs it to the encoding sequence control unit 209.
[0060]
On the other hand, the encoded data encoded by the encoding unit 205 is stored in the second memory 207 via the second memory control unit 206. At this time, the second counter 210 counts the data amount of the encoded data output from the encoding unit 205 and holds it. Further, when the encoded data stored in the second memory 207 described later is transferred to the first memory 204, the count value is transferred to the first counter 208 at the same time.
[0061]
When the first counter 208 counts the data amount of the encoded data output from the encoding unit 202 and the count value reaches a certain set value, the encoding sequence control unit 209 As in the embodiment, a control signal is issued to the memory control unit 203 so as to discard the data stored in the memory 204.
[0062]
Then, the encoding sequence control unit 209 reads the encoded data stored in the second memory 207, transfers it to the first memory 204, and stores it in the first memory 204. A control signal is output to the memory control unit 203. As a result, the count value of the second counter 210 is transferred to the first counter 208, and the value is loaded (overwritten) as the count value of the first counter.
[0063]
In short, since the count value of the second counter 210 represents the amount of encoded data stored in the second memory 207, the correspondence between the count value and the encoded data is changed. It can be considered that the data is copied to the first counter and the first memory as it is.
[0064]
Furthermore, the encoding sequence control 209 controls the first encoding unit 202 and the second encoding unit 205 so as to perform encoding so that encoded data is smaller than before. Put out.
[0065]
For example, the quantization step S in the first encoding unit 202 and the second encoding unit 205 is switched to twice. As a result, the first encoding unit 202 inherits the quantization step Q2 (= 2 × Q1) in the second encoding unit 205 up to immediately before, and the second encoding unit 205 further Using a large quantization step Q2 × 2, an encoding process with a higher compression ratio in preparation for the next overflow is performed.
[0066]
Here, although the magnification ratio of the quantization step is set to double, it is not limited to this, and needless to say, it can be arbitrarily set. The encoded data output from the switched encoding units 202 and 205 is stored in the corresponding memories 204 and 207 via the corresponding memory control units 203 and 206, respectively.
[0067]
Then, the encoding sequence control 209 reads out the encoded data already stored in the second memory to the memory control unit 206 and sends a control signal to send the data to the re-encoding unit 211. The re-encoding unit 211 performs re-encoding processing of encoded data in the same manner as the re-encoding unit 109 in FIG.
[0068]
The third counter 212 counts the amount of data output from the re-encoding unit 211, is reset to zero immediately before starting the re-encoding process, and counts the output data amount during the re-encoding process. When the re-encoding process is completed, the counter 212 transfers the count value obtained there to the second counter 210.
[0069]
The second counter 210 adds the transferred data amount count value to the counter value held in the second counter 210 to thereby store the code stored in the memory 207 during the re-encoding process. The total data amount of the encoded data and re-encoded data is calculated. That is, the amount of data stored in the memory 207 matches the count value of the counter 210.
[0070]
Regardless of whether the re-encoding process is completed or not, if the image data from the input unit 201 to be encoded remains, the encoding process by the two encoding units 202 and 205 is continued. Then, monitoring whether the count value of the counter 208 has reached a certain set value is repeated until the encoding process (encoding, re-encoding) of image data for one page input from the input unit 201 is completed, The encoding and re-encoding processes described above are executed under control according to the detection result obtained here.
[0071]
FIG. 12 is a flowchart showing the process flow in the configuration of FIG.
[0072]
As described with reference to FIG. 2, when there are two encoding units, image data for one page is encoded based on the flowchart shown in FIG. Note that the description of FIG. 12 is mostly similar to FIG. 8, which is a flowchart in the case of one encoding unit, and those skilled in the art can fully understand the features of the second embodiment from the above description. Since it will be understood, the processing will be described in three phases as in the case of one encoding unit, and differences from FIG. 8 will be mainly described.
[0073]
The biggest difference between the flow of FIG. 8 described above and the flow of the present embodiment is that the transfer processing in step S317 is moved between step S307 and step S309. In short, it can be regarded that the encoding / re-encoding phase and the transfer phase are switched (the exception is the discarded processing of the encoded data in step S307).
[0074]
In the initial setting of the encoding parameter in step S301, the quantization step Q1 is set in the first encoding unit 202, and the quantization step Q2 (= 2 × Q1) is set in the second encoding unit 205.
[0075]
In the encoding phase, steps S801, S303, and S305 are repeatedly executed. Steps S801 and S305 are the same processing as in the case of one encoding unit, but only the encoding processing in step S303 is different as shown in FIG.
[0076]
In order to increase the compression rate of the encoded data stored in the first memory 204 in stages, the encoded data stored first stores the data encoded in the quantization step Q1 having the lowest compression rate. The encoded data stored in the second memory stores the data encoded in the quantization step Q2.
[0077]
When the amount of data stored in the first memory 204 exceeds the set upper limit value (step S305), the encoded data held in the first memory 204 is immediately discarded (step S307). The encoded data having a high compression rate held in the second memory 207 is transferred to the first memory 204 (step S317, see FIG. 14). As a result, without waiting for the end of the first re-encoding process described in the first embodiment (FIG. 1), the encoded data of the appropriate second candidate that does not exceed the upper limit value can be quickly obtained. Can be stored in the memory 207. This is the greatest advantage of applying FIG. 2 with two encoders over FIG.
[0078]
In the second embodiment, since it is a wasteful idea to have encoded data having the same compression rate in the two memories 204 and 207, the second memory 207 stores the codes stored in the first memory 204. The encoded data having a higher compression rate than the encoded data is stored. Accordingly, the subsequent processing is also performed based on this concept, and after the processing (transfer phase) for transferring the encoded data in the second memory 207 to the first memory 204 is completed, the second processing is performed. The encoded data in the memory 207 is re-encoded so as to hold encoded data with a higher one-stage compression rate.
[0079]
Specifically, first, as shown in FIG. 15, in the encoding / re-encoding phase subsequent to the transfer phase, each quantization applied to the two encoding units 202 and 205 before the re-encoding. Steps Q1 and Q2 are changed to Q2 and Q3, respectively (step S309). If the input of one page of image data is not completed (step S803), the subsequent image data is set by a new quantization step. The input data is encoded by the two encoded units (step S311) and stored in the corresponding memories 204 and 207. The encoded data (transferred to the first memory 204) stored in the second memory in parallel with the encoding process is compressed one step higher than the encoded data in the first memory. In order to change to encoded data of rate, the re-encoding unit 211 performs re-encoding processing (S313) so that the data encoded using the quantization step Q3 is obtained, and the re-encoded data is 2 is stored again in the second memory 207.
[0080]
Also in the second embodiment, as in the first embodiment, in the re-encoding process, these values are divided by 2 n for each quantized value after the encoded data is once Huffman-decoded. This is realized by performing a Huffman coding again after performing a bit shift process that produces a result similar to the result. This method is capable of high-speed re-encoding processing in that the quantization step is changed only by bit shift and the inverse orthogonal transformation or re-orthogonal transformation processing is not performed.
[0081]
When there are two encoding units as in the second embodiment, encoded data and re-encoded data are mixedly stored in the second memory 207 as shown in FIG. A situation occurs. Therefore, as described above, it is necessary for the second memory 207 to manage the encoded data as a file or a packet by dividing the encoded data into a certain unit. For this purpose, for example, a configuration similar to that of the modification in the first embodiment may be provided.
[0082]
In FIG. 12, when the end of the re-encoding process is detected in step S315, the process proceeds to the encoding phase (steps S801 and S303) again. In the encoding phase after the encoding / re-encoding phase, as shown in FIG. 16, the encoded data held in the two memories 204 and 207 not only have different compression ratios but also a mixture of encoded data. The way (address) is also quite different. Accordingly, when the data amount of the first memory 204 again exceeds the set value, the encoded data held in the second memory 207 (the code of the horizontal stripe region of (6) + (8)) Needs to be transferred to the first memory 204. Considering these, it is necessary to manage the encoded data as a file or a packet not only in the second memory 207 but also in the first memory 204. Therefore, the first memory 204 also requires a management mechanism using the above-described management table.
[0083]
The state of the encoding phase shown in FIG. 16 is the initial state of the encoding phase (FIG. 13) except that the method of mixing the quantization step and the encoded data is different before and after the re-encoding process. Is the same. Therefore, by repeating the encoding phase, the transfer phase, and the encoding / re-encoding phase, the encoded data that is finally compressed to be equal to or less than the set upper limit value of the image data for one page is surely stored in the first memory. 204 can be stored.
[0084]
Note that the description of the first embodiment is that the arrangement order of the transfer phase and the encoding / re-encoding phase is reversed, so that the input of image data for one page, which has been performed after the transfer processing in FIG. The detection (step S805) is almost the same timing as the input end detection of one page of image data (step S803) performed in the encoding / recoding phase. The two detection processes are functionally the same as step S805 and the timing is the same as step S803. Therefore, these two steps detect the end of input of image data for a new page. Are integrated as a step to be performed and described as step S1201.
[0085]
In the first and second embodiments described above, the first memory and the second memory have been described as physically separate memories. This is advantageous because access to the two memories can be independent, which is a feature of the present invention. However, the case where the first memory and the second memory are not physically separate memories is also included in the scope of the present invention. Two areas corresponding to the first memory and the second memory are secured on one physical memory, the first memory is the first memory area, and the second memory is the second memory. It can be understood that the present invention can be realized with a single memory by re-reading the above description by rephrasing the area.
[0086]
Further, when the above embodiments are realized with one memory, some of the data transfer processes described in the transfer phase are not necessary. The details can be easily imagined each time, so the explanation will be omitted. However, when the two areas are used strictly separated, data transfer processing is necessary as in the case of physically having two memories. If the same data is shared between the two areas, not only the data transfer process becomes unnecessary, but also the storage capacity can be reduced.
[0087]
For example, when the encoded data held in the second memory area is transferred to the first memory area, two pieces of information of the head address and the data size in which the encoded data is stored are stored in the second memory. The same effect as that obtained by transferring the encoded data can be obtained only by transferring the data from the control unit to the first memory control unit.
[0088]
When the encoded data is stored in a file format or a packet format, the information transferred between the memory control units is slightly increased, and it is necessary to transfer the management table information related to the encoded data. Nevertheless, it is more efficient than transferring encoded data.
[0089]
<Application example>
In the first and second embodiments, the functional operation of the apparatus has been described using the apparatus that reads an image from the image scanner as an example. Most of the functions (including the encoding process) can be realized by the computer program as described above.
[0090]
Therefore, the present invention may be applied to an application program that operates on a general-purpose information processing apparatus such as a personal computer. In the case of application to an application program, a GUI may be provided such as allowing the user to specify an image file to be compressed and allowing the user to select a target size. The target value at this time can be set arbitrarily by the user, but setting with numerical values is difficult to understand, so it should be selected from an intuitive menu that takes into account the document size and image quality (high, medium, low, etc.). It would be good to make a decision.
[0091]
In the first and second embodiments, the quantization step is described as an example of the encoding parameter of the encoding unit. However, when data having different compression ratios are mixed, the image quality between them is uncomfortable. Other parameters may be used as long as they do not occur. However, for example, in the configuration of FIG. 1, in order to make the re-encoded data from the re-encoding unit 109 substantially the same as the encoded data from the encoding unit 102 after the parameter change, the above-described implementation is required. As shown in the embodiment, a method of increasing the quantization step is preferable.
[0092]
Further, as described above, the present invention can be realized by an application program that runs on a general-purpose device, and therefore the present invention includes a computer program. In addition, since the computer program is usually performed by setting or copying or installing a storage medium such as a floppy disk or CDROM in the apparatus, such a storage medium is naturally included in the scope of the present invention.
[0093]
The present invention can also be applied to a combination of a computer program and appropriate hardware (such as an encoding circuit).
[0094]
As described above, according to the present embodiment, the image data is frequency-converted and then quantized, and variable length coding is performed. The quantization unit used for switching the quantization step used in the quantization is switched. The encoding step control means and the encoding data obtained by the encoding means are separately obtained by encoding in a quantization step different from the quantization step used to obtain the encoded data. Encoded data conversion means installed separately from the encoding means, and the encoded data obtained by the encoding means or the encoded data conversion means for at least one page. Storage means for storing; and monitoring means for monitoring the amount of encoded data stored in the storage means; and depending on the amount of encoded data, the quantization step control means The encoding step is performed once so that the image data for one page becomes a desired amount of encoded data by controlling both the change of the quantization step and the encoded data conversion means in cooperation with each other. Through the processing, the encoded data can be reliably stored in a small capacity memory.
[0095]
【The invention's effect】
As described above, according to the present invention, it is possible to generate encoded data that fits in an effectively set size by one image input.
[Brief description of the drawings]
FIG. 1 is a block configuration diagram of an image processing apparatus according to a first embodiment.
FIG. 2 is a block configuration diagram of an image processing apparatus according to a second embodiment.
FIG. 3 is a flowchart showing a simplified process according to the first embodiment.
FIG. 4 is a diagram showing a data flow and memory contents in an encoding phase in an initial state in the first embodiment.
FIG. 5 is a diagram showing a data flow and memory contents in an encoding / re-encoding phase in the first embodiment.
FIG. 6 is a diagram illustrating a data flow and memory contents in a transfer phase in the first embodiment.
FIG. 7 is a diagram illustrating a data flow and memory contents in an encoding phase after a transfer phase in the first embodiment.
FIG. 8 is a flowchart showing details of processing in the first embodiment.
FIG. 9 is a diagram illustrating a data flow and memory contents in an encoding / re-encoding phase according to a modification of the first embodiment.
FIG. 10 is a diagram illustrating a data flow and memory contents in a transfer phase in a modification of the first embodiment.
FIG. 11 is a diagram illustrating a data flow and memory contents in an encoding phase after a transfer phase in a modification of the first embodiment.
FIG. 12 is a flowchart showing a processing procedure in the second embodiment.
FIG. 13 is a diagram illustrating a data flow and memory contents in an encoding phase in an initial state according to the second embodiment.
FIG. 14 is a diagram illustrating a data flow and memory contents in a transfer phase according to the second embodiment.
FIG. 15 is a diagram showing a data flow and memory contents in an encoding / re-encoding phase in the second embodiment.
FIG. 16 is a diagram illustrating a data flow and memory contents in an encoding phase after an encoding / re-encoding phase in the second embodiment.

Claims (13)

画像データを圧縮符号化する画像処理装置であって、
入力された画像データを第1の圧縮率に対応する圧縮パラメータで圧縮し、生成された符号化データを記憶手段に格納する第1の圧縮手段と、
前記第1の圧縮手段により生成された符号化データを復号し、再圧縮する第2の圧縮手段と、
前記第1の圧縮手段により生成される符号化データ量を監視し、該符号化データ量が設定値に達するか否かを判断する監視手段と、
該監視手段によって前記符号化データ量が設定値に達すると判断した場合に、
前記第1の圧縮手段に適用する圧縮パラメータを前記第1の圧縮率よりも高い第2の圧縮率に対応する圧縮パラメータに更新した後、後続して入力される画像データを該第1の圧縮手段に圧縮させ、
前記第1の圧縮手段により従前に生成された符号化データを、前記第1の圧縮率よりも高い第2の圧縮率に対応する圧縮パラメータで、前記第2の圧縮手段により再圧縮させ、
該再圧縮で得られた符号化データを、前記第1の圧縮手段に適用する圧縮パラメータを更新した後の該第1の圧縮手段により生成された符号化データとして前記記憶手段に保存させ、
前記圧縮パラメータを更新した後で前記第1の圧縮手段により生成された符号化データを、後続の符号化データとして前記記憶手段に保存させる制御手段と
を備えることを特徴とする画像処理装置。
An image processing apparatus for compressing and encoding image data,
First compression means for compressing input image data with a compression parameter corresponding to a first compression rate, and storing the generated encoded data in a storage means ;
Second compression means for decoding and recompressing the encoded data generated by the first compression means;
Monitoring means for monitoring the amount of encoded data generated by the first compression means, and determining whether the amount of encoded data reaches a set value;
When it is determined by the monitoring means that the encoded data amount reaches a set value,
The compression parameter applied to the first compression means is updated to a compression parameter corresponding to a second compression rate higher than the first compression rate, and subsequently input image data is subjected to the first compression. Compressed by means,
The encoded data previously generated by the first compression unit is recompressed by the second compression unit with a compression parameter corresponding to a second compression rate higher than the first compression rate,
The encoded data obtained by the recompression is stored in the storage unit as encoded data generated by the first compression unit after updating the compression parameter applied to the first compression unit,
An image processing apparatus comprising: control means for storing encoded data generated by the first compression means after updating the compression parameter in the storage means as subsequent encoded data.
前記第1及び第2の圧縮手段に適用する圧縮パラメータは、各圧縮手段で実行する量子化処理において用いる量子化ステップであることを特徴とする請求項1に記載の画像処理装置。  The image processing apparatus according to claim 1, wherein the compression parameter applied to the first and second compression units is a quantization step used in a quantization process executed by each compression unit. 前記記憶手段は、第1,第2のメモリで構成され、
前記第1の圧縮手段で生成した符号化データは、第1、第2のメモリに同時に書き込まれ、
前記制御手段は、前記監視手段によって設定値に達すると判断した場合、前記第1のメモリをクリアすると共に、前記第2のメモリに格納されている符号化データを前記第2の圧縮手段で再圧縮させ、得られた符号化データを前記第1のメモリに格納することを特徴とする請求項1に記載の画像処理装置。
The storage means includes first and second memories,
The encoded data generated by the first compression means is simultaneously written in the first and second memories,
When the control unit determines that the set value is reached by the monitoring unit, the control unit clears the first memory and re-encodes the encoded data stored in the second memory by the second compression unit. The image processing apparatus according to claim 1, wherein the encoded data obtained by compression is stored in the first memory.
画像データを圧縮符号化する画像処理装置の制御方法であって、
入力された画像データを第1の圧縮率に対応する圧縮パラメータで圧縮し、生成された符号化データを記憶手段に格納する第1の圧縮工程と、
前記第1の圧縮工程により生成された符号化データを復号し、再圧縮する第2の圧縮工程と、
前記第1の圧縮工程により生成される符号化データ量を監視し、該符号化データ量が設定値に達するか否かを判断する監視工程と、
該監視工程によって前記符号化データ量が設定値に達すると判断した場合に、
前記第1の圧縮工程に適用する圧縮パラメータを前記第1の圧縮率よりも高い第2の圧縮率に対応する圧縮パラメータに更新した後、後続して入力される画像データを該第1の圧縮工程に圧縮させ、
前記第1の圧縮工程により従前に生成された符号化データを、前記第1の圧縮率よりも高い第2の圧縮率に対応する圧縮パラメータで、前記第2の圧縮工程により再圧縮させ、
該再圧縮で得られた符号化データを、前記第1の圧縮工程に適用する圧縮パラメータを更新した後の該第1の圧縮工程により生成された符号化データとして前記記憶手段に保存させ、
前記圧縮パラメータを更新した後で前記第1の圧縮工程により生成された符号化データを、後続の符号化データとして前記記憶手段に保存させる制御工程と
を備えることを特徴とする画像処理装置の制御方法。
A control method of an image processing apparatus for compressing and encoding image data,
A first compression step of compressing input image data with a compression parameter corresponding to a first compression rate, and storing the generated encoded data in a storage unit ;
A second compression step of decoding and recompressing the encoded data generated by the first compression step;
Monitoring the amount of encoded data generated by the first compression step, and determining whether the amount of encoded data reaches a set value;
When it is determined by the monitoring step that the encoded data amount reaches a set value,
After updating a compression parameter applied to the first compression step to a compression parameter corresponding to a second compression rate higher than the first compression rate, subsequently input image data is subjected to the first compression. Compressed into the process,
The encoded data previously generated by the first compression step is recompressed by the second compression step with a compression parameter corresponding to a second compression rate higher than the first compression rate,
The encoded data obtained by the recompression is stored in the storage means as encoded data generated by the first compression step after updating the compression parameter applied to the first compression step,
A control step of storing the encoded data generated by the first compression step after updating the compression parameter in the storage means as subsequent encoded data. Method.
コンピュータが読込み実行することで、画像データを圧縮符号化する画像処理装置として機能するコンピュータプログラムであって、
入力された画像データを第1の圧縮率に対応する圧縮パラメータで圧縮し、生成された符号化データを記憶手段に格納する第1の圧縮手段と、
前記第1の圧縮手段により生成された符号化データを復号し、再圧縮する第2の圧縮手段と、
前記第1の圧縮手段により生成される符号化データ量を監視し、該符号化データ量が設定値に達するか否かを判断する監視手段と、
該監視手段によって前記符号化データ量が設定値に達すると判断した場合に、
前記第1の圧縮手段に適用する圧縮パラメータを前記第1の圧縮率よりも高い第2の圧縮率に対応する圧縮パラメータに更新した後、後続して入力される画像データを該第1の圧縮手段に圧縮させ、
前記第1の圧縮手段により従前に生成された符号化データを、前記第1の圧縮率よりも高い第2の圧縮率に対応する圧縮パラメータで、前記第2の圧縮手段により再圧縮させ、
該再圧縮で得られた符号化データを、前記第1の圧縮手段に適用する圧縮パラメータを更新した後の該第1の圧縮手段により生成された符号化データとして前記記憶手段に保存させ、
前記圧縮パラメータを更新した後で前記第1の圧縮手段により生成された符号化データを、後続の符号化データとして前記記憶手段に保存させる制御手段
として機能することを特徴とするコンピュータプログラム。
A computer program that functions as an image processing apparatus that compresses and encodes image data by being read and executed by a computer,
First compression means for compressing input image data with a compression parameter corresponding to a first compression rate, and storing the generated encoded data in a storage means ;
Second compression means for decoding and recompressing the encoded data generated by the first compression means;
Monitoring means for monitoring the amount of encoded data generated by the first compression means, and determining whether the amount of encoded data reaches a set value;
When it is determined by the monitoring means that the encoded data amount reaches a set value,
The compression parameter applied to the first compression means is updated to a compression parameter corresponding to a second compression rate higher than the first compression rate, and subsequently input image data is subjected to the first compression. Compressed by means,
The encoded data previously generated by the first compression unit is recompressed by the second compression unit with a compression parameter corresponding to a second compression rate higher than the first compression rate,
The encoded data obtained by the recompression is stored in the storage unit as encoded data generated by the first compression unit after updating the compression parameter applied to the first compression unit,
A computer program that functions as control means for storing encoded data generated by the first compression means after updating the compression parameter in the storage means as subsequent encoded data.
請求項5に記載のコンピュータプログラムを格納したことを特徴とするコンピュータ可読記憶媒体。  A computer-readable storage medium storing the computer program according to claim 5. 画像データを圧縮符号化する画像処理装置であって、
入力された画像データを第1の圧縮率に対応する圧縮パラメータで圧縮し、生成された符号化データを記憶手段に格納する第1の圧縮手段と、
入力された画像データを第1の圧縮率より高い第2の圧縮率に対応する圧縮パラメータで圧縮し、生成された符号化データを前記記憶手段に格納する第2の圧縮手段と、
前記第2の圧縮手段により生成された符号化データを復号し、再圧縮する第3の圧縮手段と、
前記第1の圧縮手段により生成される符号化データ量を監視し、該符号化データ量が設定値に達するか否かを判断する監視手段と、
該監視手段によって前記符号化データ量が設定値に達すると判断した場合に、
前記第1の圧縮手段に適用する圧縮パラメータを前記第1の圧縮率よりも高い第2の圧縮率に対応する圧縮パラメータに更新した後、後続して入力される画像データを該第1の圧縮手段に圧縮させ、
前記第2の圧縮手段に適用する圧縮パラメータを前記第2の圧縮率よりも高い第3の圧縮率に対応する圧縮パラメータに更新した後、後続して入力される画像データを該第2の圧縮手段に圧縮させ、
前記第2の圧縮手段により従前に生成された符号化データを、圧縮パラメータを更新した後の前記第1の圧縮手段で生成された符号化データとして前記記憶手段に保存させ、
前記第2の圧縮手段により従前に生成された符号化データを、前記第2の圧縮率よりも高い第3の圧縮率に対応する圧縮パラメータで、第3の圧縮手段により再圧縮させ、
当該第3の圧縮手段で生成された符号化データを、圧縮パラメータを更新した後の前記第2の符号化手段で生成された符号化データとして前記記憶手段に保存させ、
前記圧縮パラメータを更新した後に前記第1の圧縮手段により生成された符号化データを、後続の符号化データとして前記記憶手段に保存させる制御手段と
を備えることを特徴とする画像処理装置。
An image processing apparatus for compressing and encoding image data,
First compression means for compressing input image data with a compression parameter corresponding to a first compression rate, and storing the generated encoded data in a storage means ;
Second compression means for compressing input image data with a compression parameter corresponding to a second compression ratio higher than the first compression ratio, and storing the generated encoded data in the storage means ;
Third compression means for decoding and recompressing the encoded data generated by the second compression means;
Monitoring means for monitoring the amount of encoded data generated by the first compression means, and determining whether the amount of encoded data reaches a set value;
When it is determined by the monitoring means that the encoded data amount reaches a set value,
The compression parameter applied to the first compression means is updated to a compression parameter corresponding to a second compression rate higher than the first compression rate, and subsequently input image data is subjected to the first compression. Compressed by means,
After updating a compression parameter applied to the second compression means to a compression parameter corresponding to a third compression rate higher than the second compression rate, subsequently input image data is subjected to the second compression. Compressed by means,
The encoded data previously generated by the second compression means is stored in the storage means as the encoded data generated by the first compression means after updating the compression parameter,
The encoded data previously generated by the second compression unit is recompressed by the third compression unit with a compression parameter corresponding to a third compression rate higher than the second compression rate,
The encoded data generated by the third compression means is stored in the storage means as encoded data generated by the second encoding means after updating the compression parameter,
An image processing apparatus comprising: control means for storing the encoded data generated by the first compression means after updating the compression parameter in the storage means as subsequent encoded data.
前記第1乃至第3の圧縮手段に適用する圧縮パラメータは、各圧縮手段で実行する量子化処理において用いる量子化ステップであることを特徴とする請求項7に記載の画像処理装置。  The image processing apparatus according to claim 7, wherein the compression parameter applied to the first to third compression units is a quantization step used in a quantization process executed by each compression unit. 画像データを圧縮符号化する画像処理装置の制御方法であって、
入力された画像データを第1の圧縮率に対応する圧縮パラメータで圧縮し、生成された符号化データを記憶手段に格納する第1の圧縮工程と、
入力された画像データを第1の圧縮率より高い第2の圧縮率に対応する圧縮パラメータで圧縮し、生成された符号化データを前記記憶手段に格納する第2の圧縮工程と、
前記第2の圧縮工程により生成された符号化データを復号し、再圧縮する第3の圧縮工程と、
前記第1の圧縮工程により生成される符号化データ量を監視し、該符号化データ量が設定値に達するか否かを判断する監視工程と、
該監視工程によって前記符号化データ量が設定値に達すると判断した場合に、
前記第1の圧縮工程に適用する圧縮パラメータを前記第1の圧縮率よりも高い第2の圧縮率に対応する圧縮パラメータに更新した後、後続して入力される画像データを該第1の圧縮工程に圧縮させ、
前記第2の圧縮工程に適用する圧縮パラメータを前記第2の圧縮率よりも高い第3の圧縮率に対応する圧縮パラメータに更新した後、後続して入力される画像データを該第2の圧縮工程に圧縮させ、
前記第2の圧縮工程により従前に生成された符号化データを、圧縮パラメータを更新した後の前記第1の圧縮工程で生成された符号化データとして前記記憶手段に保存させ、
前記第2の圧縮工程により従前に生成された符号化データを、前記第2の圧縮率よりも高い第3の圧縮率に対応する圧縮パラメータで、第3の圧縮工程により再圧縮させ、
当該第3の圧縮工程で生成された符号化データを、圧縮パラメータを更新した後の前記第2の符号化工程で生成された符号化データとして前記記憶手段に保存させ、
前記圧縮パラメータを更新した後に前記第1の圧縮工程により生成された符号化データを、後続の符号化データとして前記記憶手段に保存させる制御工程と
を備えることを特徴とする画像処理装置の制御方法。
A control method of an image processing apparatus for compressing and encoding image data,
A first compression step of compressing input image data with a compression parameter corresponding to a first compression rate, and storing the generated encoded data in a storage unit ;
A second compression step of compressing the input image data with a compression parameter corresponding to a second compression rate higher than the first compression rate, and storing the generated encoded data in the storage means ;
A third compression step of decoding and recompressing the encoded data generated by the second compression step;
Monitoring the amount of encoded data generated by the first compression step, and determining whether the amount of encoded data reaches a set value;
When it is determined by the monitoring step that the encoded data amount reaches a set value,
After updating a compression parameter applied to the first compression step to a compression parameter corresponding to a second compression rate higher than the first compression rate, subsequently input image data is subjected to the first compression. Compressed into the process,
After updating a compression parameter applied to the second compression step to a compression parameter corresponding to a third compression rate higher than the second compression rate, subsequently input image data is subjected to the second compression. Compressed into the process,
The encoded data previously generated by the second compression step is stored in the storage means as the encoded data generated by the first compression step after updating the compression parameter,
The encoded data previously generated by the second compression step is recompressed by the third compression step with a compression parameter corresponding to a third compression rate higher than the second compression rate,
The encoded data generated in the third compression step is stored in the storage means as encoded data generated in the second encoding step after updating the compression parameter,
A control step of storing the encoded data generated by the first compression step after updating the compression parameter in the storage means as subsequent encoded data. .
コンピュータが読込み実行することで、画像データを圧縮符号化する画像処理装置として機能するコンピュータプログラムであって、
入力された画像データを第1の圧縮率に対応する圧縮パラメータで圧縮し、生成された符号化データを記憶手段に格納する第1の圧縮手段と、
入力された画像データを第1の圧縮率より高い第2の圧縮率に対応する圧縮パラメータで圧縮し、生成された符号化データを前記記憶手段に格納する第2の圧縮手段と、
前記第2の圧縮手段により生成された符号化データを復号し、再圧縮する第3の圧縮手段と、
前記第1の圧縮手段により生成される符号化データ量を監視し、該符号化データ量が設定値に達するか否かを判断する監視手段と、
該監視手段によって前記符号化データ量が設定値に達すると判断した場合に、
前記第1の圧縮手段に適用する圧縮パラメータを前記第1の圧縮率よりも高い第2の圧縮率に対応する圧縮パラメータに更新した後、後続して入力される画像データを該第1の圧縮手段に圧縮させ、
前記第2の圧縮手段に適用する圧縮パラメータを前記第2の圧縮率よりも高い第3の圧縮率に対応する圧縮パラメータに更新した後、後続して入力される画像データを該第2の圧縮手段に圧縮させ、
前記第2の圧縮手段により従前に生成された符号化データを、圧縮パラメータを更新した後の前記第1の圧縮手段で生成された符号化データとして前記記憶手段に保存させ、
前記第2の圧縮手段により従前に生成された符号化データを、前記第2の圧縮率よりも高い第3の圧縮率に対応する圧縮パラメータで、第3の圧縮手段により再圧縮させ、
当該第3の圧縮手段で生成された符号化データを、圧縮パラメータを更新した後の前記第2の符号化手段で生成された符号化データとして前記記憶手段に保存させ、
前記圧縮パラメータを更新した後に前記第1の圧縮手段により生成された符号化データを、後続の符号化データとして前記記憶手段に保存させる制御手段
として機能することを特徴とするコンピュータプログラム。
A computer program that functions as an image processing apparatus that compresses and encodes image data by being read and executed by a computer,
First compression means for compressing input image data with a compression parameter corresponding to a first compression rate, and storing the generated encoded data in a storage means ;
Second compression means for compressing input image data with a compression parameter corresponding to a second compression ratio higher than the first compression ratio, and storing the generated encoded data in the storage means ;
Third compression means for decoding and recompressing the encoded data generated by the second compression means;
Monitoring means for monitoring the amount of encoded data generated by the first compression means, and determining whether the amount of encoded data reaches a set value;
When it is determined by the monitoring means that the encoded data amount reaches a set value,
The compression parameter applied to the first compression means is updated to a compression parameter corresponding to a second compression rate higher than the first compression rate, and subsequently input image data is subjected to the first compression. Compressed by means,
After updating a compression parameter applied to the second compression means to a compression parameter corresponding to a third compression rate higher than the second compression rate, subsequently input image data is subjected to the second compression. Compressed by means,
The encoded data previously generated by the second compression means is stored in the storage means as the encoded data generated by the first compression means after updating the compression parameter,
The encoded data previously generated by the second compression unit is recompressed by the third compression unit with a compression parameter corresponding to a third compression rate higher than the second compression rate,
The encoded data generated by the third compression means is stored in the storage means as encoded data generated by the second encoding means after updating the compression parameter,
A computer program that functions as a control unit that stores the encoded data generated by the first compression unit after updating the compression parameter in the storage unit as subsequent encoded data.
請求項10に記載のコンピュータプログラムを格納したことを特徴とするコンピュータ可読記憶媒体。  A computer-readable storage medium storing the computer program according to claim 10. 前記設定値は、入力される画像データに相当する原稿サイズに基づいて選択されることを特徴とする請求項1または7に記載の画像処理装置。  The image processing apparatus according to claim 1, wherein the setting value is selected based on a document size corresponding to input image data. 前記設定値は、ユーザによりGUIを介して設定されることを特徴とする請求項1または7に記載の画像処理装置。  The image processing apparatus according to claim 1, wherein the setting value is set by a user via a GUI.
JP2001184129A 2001-06-18 2001-06-18 Image processing apparatus and method, computer program, and storage medium Expired - Fee Related JP4124982B2 (en)

Priority Applications (4)

Application Number Priority Date Filing Date Title
JP2001184129A JP4124982B2 (en) 2001-06-18 2001-06-18 Image processing apparatus and method, computer program, and storage medium
EP02254149.4A EP1271926B1 (en) 2001-06-18 2002-06-13 Image processing method, apparatus and computer program for compression-encoding
US10/171,647 US7106911B2 (en) 2001-06-18 2002-06-17 Image processing apparatus and control method for inputting image data and encoding the data
CN02122650.4A CN1207897C (en) 2001-06-18 2002-06-18 Image processing method and device, computer program and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2001184129A JP4124982B2 (en) 2001-06-18 2001-06-18 Image processing apparatus and method, computer program, and storage medium

Publications (3)

Publication Number Publication Date
JP2003008903A JP2003008903A (en) 2003-01-10
JP2003008903A5 JP2003008903A5 (en) 2006-10-12
JP4124982B2 true JP4124982B2 (en) 2008-07-23

Family

ID=19023953

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2001184129A Expired - Fee Related JP4124982B2 (en) 2001-06-18 2001-06-18 Image processing apparatus and method, computer program, and storage medium

Country Status (1)

Country Link
JP (1) JP4124982B2 (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4418762B2 (en) 2004-05-07 2010-02-24 キヤノン株式会社 Image encoding apparatus, image decoding apparatus, control method thereof, computer program, and computer-readable storage medium
JP4533035B2 (en) 2004-08-02 2010-08-25 キヤノン株式会社 Image encoding apparatus and method, computer program, and computer-readable storage medium
JP4533043B2 (en) 2004-08-25 2010-08-25 キヤノン株式会社 Image encoding apparatus and method, computer program, and computer-readable storage medium
JP4440051B2 (en) 2004-09-08 2010-03-24 キヤノン株式会社 Image encoding apparatus and method, computer program, and computer-readable storage medium
JP4393319B2 (en) 2004-09-08 2010-01-06 キヤノン株式会社 Image encoding apparatus and method, computer program, and computer-readable storage medium
JP4693603B2 (en) 2004-11-15 2011-06-01 キヤノン株式会社 Image encoding apparatus, control method therefor, computer program, and computer-readable storage medium
JP4721039B2 (en) * 2005-03-09 2011-07-13 富士フイルム株式会社 Image processing method and apparatus
JP2006340045A (en) * 2005-06-02 2006-12-14 Olympus Imaging Corp Image processor and image processing method
US7925098B2 (en) 2006-03-02 2011-04-12 Canon Kabushiki Kaisha Image encoding apparatus and method with both lossy and lossless means

Also Published As

Publication number Publication date
JP2003008903A (en) 2003-01-10

Similar Documents

Publication Publication Date Title
EP1271926B1 (en) Image processing method, apparatus and computer program for compression-encoding
JP3902968B2 (en) Image processing apparatus, control method therefor, computer program, and storage medium
US7257264B2 (en) Image processing apparatus and method for compression-encoding image area information
JP4533043B2 (en) Image encoding apparatus and method, computer program, and computer-readable storage medium
US7454070B2 (en) Image encoding apparatus and method, computer program, and computer-readable storage medium
US7468803B2 (en) Image processing apparatus and image processing method
US7627181B2 (en) Image encoding apparatus and method, computer program, and computer-readable storage medium
US7561749B2 (en) Apparatus, method, and computer-readable storage medium for lossy and lossless encoding of image data in accordance with an attribute of the image data
JP4124982B2 (en) Image processing apparatus and method, computer program, and storage medium
JP3902953B2 (en) Image processing apparatus and method, computer program, and storage medium
JP4065522B2 (en) Image processing apparatus and control method thereof
JP3984813B2 (en) Image processing apparatus and method, computer program, and storage medium
JP3902954B2 (en) Image processing apparatus and method, computer program, and storage medium
JP4693309B2 (en) Image processing apparatus, control method therefor, computer program, and storage medium
JP3902983B2 (en) Image processing apparatus, control method therefor, computer program, and storage medium
JP4035475B2 (en) Image processing apparatus, control method therefor, computer program, and storage medium
JP3840076B2 (en) Image processing apparatus and method, computer program, and storage medium
JP4035471B2 (en) Image processing apparatus, control method therefor, computer program, and storage medium
JP3998115B2 (en) Image processing apparatus and image processing method
JP2000228772A (en) Moving picture data quantity reduction device and storage medium storing moving picture data quantity reduction program
Razavi et al. Low-cost still-picture compression chip set
JPH0879477A (en) Image processing method and device therefor
JP2002290242A (en) Image processor, image processing method, computer program and storage medium for storing the computer program
JPH09312772A (en) Printer

Legal Events

Date Code Title Description
A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20060830

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20060830

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20080131

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20080205

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20080325

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

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20080507

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

Ref document number: 4124982

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20110516

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20120516

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20120516

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20130516

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20140516

Year of fee payment: 6

LAPS Cancellation because of no payment of annual fees