JP4034385B2 - Multi-color image encoding apparatus and method, and multi-color image decoding apparatus and method - Google Patents

Multi-color image encoding apparatus and method, and multi-color image decoding apparatus and method Download PDF

Info

Publication number
JP4034385B2
JP4034385B2 JP27025297A JP27025297A JP4034385B2 JP 4034385 B2 JP4034385 B2 JP 4034385B2 JP 27025297 A JP27025297 A JP 27025297A JP 27025297 A JP27025297 A JP 27025297A JP 4034385 B2 JP4034385 B2 JP 4034385B2
Authority
JP
Japan
Prior art keywords
pixel data
color
pixel
data
pixels
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
JP27025297A
Other languages
Japanese (ja)
Other versions
JPH10262154A (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.)
Seiko Epson Corp
Original Assignee
Seiko Epson Corp
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 Seiko Epson Corp filed Critical Seiko Epson Corp
Priority to JP27025297A priority Critical patent/JP4034385B2/en
Publication of JPH10262154A publication Critical patent/JPH10262154A/en
Application granted granted Critical
Publication of JP4034385B2 publication Critical patent/JP4034385B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Description

【0001】
【発明の属する技術分野】
本発明は、マルチカラー画像の符号化装置およびその方法ならびにマルチカラー画像の復号化装置およびその方法に関する。そして、さらに詳細に述べれば、特にマルチカラー画像を符号化および復号化する際のその対象画像の区切り方の改良に関する。
【0002】
【従来の技術】
従来からパソコンやゲーム機器等では、マルチカラー画像と呼ばれる画像が使用されている。このマルチカラー画像とは、代表色画像とか限定色画像等とも呼ばれているもので、図22に示すように、特定の色、すなわち特定のR(赤)、G(緑)、B(青)の値を持つ色に対してインデックスを付与し、そのインデックスのデータを利用して、16色や256色等の限定された代表色で表現するようにした画像のことである。
【0003】
このようなマルチカラー画像のデータは、仮にR、G、Bの各色が8ビット(256種)で表されるとしたら、合計24ビット必要になるのであるが、インデックスそのものも例えば8ビットで表示するようにしているので、相当な圧縮率となっている。しかし、圧縮はされているが、それでも情報量が多いため、何の工夫もせず、そのままの形で処理すると、メモリ容量が大きくなり、また通信速度も遅くなり実用的でない。したがって、マルチカラー画像も他の画像データと同様にその圧縮技術は極めて重要なものとなる。特に、マルチカラー画像は、その色の数が限定されていることから、ロスレスでの符号化および復号化、すなわち可逆的な圧縮技術が必要とされている。
【0004】
一方、近年、データ圧縮の手法の一つとして、エントロピー符号器および復号器を用いた技術が注目されている。このエントロピー符号化および復号化技術の一つとして、例えば、算術符号化および復号化の技術を用いたものがある。この技術の概要は、例えば、特開昭62−185413号公報、特開昭63−74324号公報、特開昭63−76525号公報等に記載されている。
【0005】
図16に、このような技術を用いた従来のマルチカラー画像の符号化システム50および復号化システム60を示す。この符号化システム50は、ラインバッファ51と、エントロピー符号器52とを含むものである。入力されるインデックスのデータ、すなわちカラー画素データ100Aは、ラインバッファ51およびエントロピー符号器52へ入力される。このカラー画素データ100Aは、図17に示すように、いずれもラスタースキャンされ水平走査順に順次画素データとして入力される。なお、このインデックスのデータ、すなわちカラー画素データ100Aを作成する方法としては、入力する色の順番にインデックスを付与する方法が一般的であり、図22に示すように、インデックスの番号が近いもの、例えば「1」と「2」でもその色が大きく異なったり、インデックスの番号が遠いもの、例えば「100」と「200」でもその色は近似している現象が生じている。このような現象を避けるため、特開平5−328142に示されるように、色の近いものに連続番号を付与するようにしたものも現れている。
【0006】
符号化システム50中のラインバッファ51は、参照画素生成手段として、既に入力されたカラー画素データ100Aから、符号化対象画素Xに対する参照画素データA,B,C,Dを作成する。すなわち、ラインバッファ51は、画像をスキャンするときにnライン(1〜5ライン程度が多い)分の履歴を記憶しておく。そして、符号化対象画素Xのカラー画素データ100Aが入力されるごとに、この直前の画素Aと、周辺の画素B,C,Dとからなる一連の画素データを参照画素データ110としてエントロピー符号器52へ向けて出力する。
【0007】
このエントロピー符号器52は、例えば、算術符号化またはハフマン符号化などの手法を用いて形成される。そして、参照画素データ110を状態信号として用い、対象カラー画素データ100Aを符号化データ200に変換出力する。
【0008】
一方、復号化システム60は、ラインバッファ61とエントロピー復号器62を含んで構成される。ここにおいて、ラインバッファ61とエントロピー復号器62は、入力される符号化データ200を符号化システム50のラインバッファ51、エントロピー符号器52とは全く逆の手順で復号化出力するように形成されている。
【0009】
このようにして、符号化システム50と、復号化システム60とは、互いに全く逆のアルゴリズムを用いて、カラー画素データ100Aを符号化データ200に符号化し、さらにこの符号化データ200をカラー画素データ100Bに復号化して出力することができる。したがって、このシステムは、各種用途に幅広く用いることができる。
【0010】
ところで、このようなシステムでは、カラー画素データ100Aの値、すなわちインデックスの番号が一定の番号付近に偏るとそのデータの圧縮率が向上する。また、このシステムでは、参照画素データ110を、エントロピー符号器52、エントロピー復号器62の状態信号として使用している。したがって、その状態数、すなわち、参照画素数を多くとれば、同様にデータ圧縮率は向上する。すなわち、算術符号化またはハフマン符号化などの手法を用いてエントロピー符号器52および復号器62を構成する場合には、0または1のシンボルの発生確率に大きな偏りがあると、データの圧縮率を高めることができる。これは、エントロピー符号化技術では、発生確率の高い入力データには短い符号化データを割り当て、発生率の低い入力データには相対的に長い符号化データを割り当てるからである。
【0011】
シンボル、すなわちインデックスの番号の発生確率の大きな偏りを得るために、従来より、入力データをいくつかの状態に分類して符号化することが行われている。なぜなら、分類をしないと、良い圧縮率は得られないからである。例えば、図16に示す従来の手法では、ラインバファ51,61を用い、参照画素データを作成し、これを分類用の状態信号としてエントロピー符号器52およびエントロピー復号器62へ入力している。そして、これらエントロピー符号器52およびエントロピー復号器62は、前記状態信号を用いることにより入力データを分類し、符号化および復号化を行っている。すなわち、参照画素データの各状態の発生確率を計算し、その発生確率の高い組み合わせのものに短い符号化データを割り当てている。そして、これによりデータの圧縮率を高めている。
【0012】
しかし、前述したエントロピー符号器52およびエントロピー復号器62では、参照画素データの状態数に対応した数の符号化パラメータテーブルが必要となる。このため、圧縮率を高めるために参照画素数を大きくとればとるほど、符号化および復号化のパラメータテーブルが大きくなる。このため、エントロピー符号器52およびエントロピー復号器62が大型化かつ高価となってしまうという問題がある。
【0013】
例えば、カラー画素データ、すなわちインデックスの番号を4ビットデータ(16種)で構成し、しかも参照画素データ110の画素数が4である場合を想定する。この場合には、符号化および復号化パラメータテーブルの状態数は、4画素×4ビット=16ビット分の状態数、すなわち216の状態数をとる。このため、216=65536通りのパラメータテーブルを用意しなければならない。このことからも、参照画素を1つ増やすごとに、その分、符号化および復号化パラメータテーブルが極めて大きくなり、エントロピー符号器52およびエントロピー復号器62を構成するハードウェアが大型化してしまうことが理解される。しかも、対象画素も4ビット、すなわち、4プレーンで構成され、各プレーンに1ビットずつの信号が割り当てられ、結果として4ビットで16通りの値(色)をとるので、パラメータテーブルは65536×16の大きさを持つテーブルとなる(図18参照)。
【0014】
このような問題に対し、対象画素のカラーシンボル、すなわち色に対応するインデックスの番号の出現頻度の偏りを計算し、出現頻度順位に対応して、インデックスの番号を並び替える色順位変換の方法(特開平6−276041号)がある。すなわち、これにより出現頻度の高いものに短い符号化データを割り当て、さらに、圧縮率を高めている。また、この公開公報には、エントロピー符号器52およびエントロピー復号器62の中に縮退した状態数に応じてパラメータテーブルを小さくさせる技術も開示されている。
【0015】
この特開平6−276041号公報に示されている状態数を縮退するシステムの特徴は、図19に示すように、従来の符号化システム50や復号化システム60と同様にエントロピー符号器52およびエントロピー復号器62に参照画素データ110を状態信号として入力するわけであるが、その入力に際し、その状態信号140を、ラインバッファ51,61から出力される参照画素データ110を縮退する状態縮退器53,63によって生成する点にある。
【0016】
この状態縮退器53、63は、入力される参照画素データ110を、より少ないビット数の状態信号140に縮退し、対応するエントロピー符号器52およびエントロピー復号器62へ向け出力するように構成されている。なお、予測器54,64は、それぞれカラーシンボルの出現頻度に基づいてカラー画素データを色順位に変換するためおよびその逆を行うための色順位テーブル(詳細は後述)をそのメモリーに保有しているものである。
【0017】
なお、縮退とは、縮退後の状態数に、元の状態を分類する操作である。この分類は、分類後のエントロピー(1つのシンボルを表示するための平均情報量)が最少となるように、その組み合わせを選択して行う。そして、縮退後の状態数、すなわち、分類された後の状態数に対して識別ビットを付加する。これが状態信号140である。
【0018】
ところで、状態縮退器53,63に用いる縮退テーブルとしては、参照画素データ110のカラーシンボルの組み合わせパターンと、縮退データとの関係を特定する縮退テーブルを設定し、この縮退テーブルを用い、入力される参照画素データ110のカラーシンボルの組み合わせパターンを、縮退データに変換出力する方法がある。
【0019】
図20には、このような手法を用いて行われる縮退動作の一例が示されている。ここでは、説明を簡単にするために、図20(A)に示すよう、符号化対象画素Xに対し、A,B,Cの3つの画素から形成されるマルコフモデルを参照画素パターンとして用いる場合を例にとり説明する。
【0020】
参照画素が、図20(A)に示すように、3つの画素から構成される場合には、そのカラーシンボルの組み合わせパターンは、図20(B)に示すように5通りとなる。すなわち、3つに画素のカラーシンボルが全て一致するパターンと、2つのカラーシンボルのみが一致する場合に該当する3つのパターンと、全ての画素のカラーシンボルが異なるパターンの計5つのパターンに分類される。
【0021】
したがって、図20(B)に示すテーブルを状態縮退器53,63の縮退テーブルとして用いることにより、本来3つの画素の組み合わせが取りうる212パターンの状態を、図20(B)に示す5つの状態S1〜S5に縮退することができる。このようにすることによって、参照画素データ110を効果的に縮退し、エントロピー符号器52およびエントロピー復号器62の状態数を大幅に少なくすることができる。
【0022】
ところで、このような算術符号化および復号化の一般的な手法は、既に1画像符号化標準JBIG(インターナショナルスタンダードISO/IEC11544)のp26〜44およびp44〜p50に詳細に述べられているが、ここでは後述する本発明を展開する際の前提技術として簡単に説明する。
【0023】
図16に用いられる算術符号型のエントロピー符号器52の一例を図21に示す。なお、算術復号型のエントロピー復号器62の構成は、エントロピー符号器52の構成と実質的に同一であるので、ここではその説明は省略する。
【0024】
このエントロピー符号器52は、算術演算部55と、状態記憶器として機能する発生確率生成手段56とを含んで構成される。この発生確率生成手段56内には、符号化に必要なシンボル発数確率を決定するために必要な状態パラメータテーブルが書き込まれている。上記の状態パラメータは、入力される状態信号によって特定される。そして、この状態信号によって特定された状態パラメータのテーブルに対し、発生確率生成手段56の発生確率演算パラメータが算術演算部55へ向けて出力される。算術演算部55は、このようにして入力される発生確率に基づき、エントロピー符号化を行い、入力される色順位データ120を符号化データ200に変換出力する。そして、符号化した色順位データ120の値により、状態信号に対する発生確率を再計算し、演算パラメータ更新値として、発生確率生成手段56へ入力する。この更新結果が次データの発生確率としてテーブルに記憶されることで、エントロピー符号器52の圧縮効率が向上することとなる。
【0025】
なお、色順位データ120を生成するために、先に述べたように予測器54,64内に色順位テーブルが配置されている。この色順位テーブルの一例として、図23に示されるものが知られている(特開平6ー276041号公報参照)。この例では、符号化対象画素Xに対しての色順位テーブルを決める際、2次元的な周辺画素データR0,R1,R2,R3を上位の色順位データとして使用し、符号化対象画素Xと同一ラインの1次元テーブルを下位の色順位データとして使用するものである。このとき、1次元テーブルから周辺画素データR0,R1,R2,R3のカラーシンボルを除去した後、上位と下位の色順位データをドッキングさせ符号化対象画素Xの色順位テーブルとしている。
【0026】
具体的にどのように色順位テーブルができあがるかを図23に基づき説明する。符号化されるカラーシンボルが16色の場合を考える。仮に、色順位を図23(A)に示すように、各画素の位置R0,R1,R2…R8… で固定したとき、それぞれのカラーシンボルが図23(B)に示すように、C4,C3,C6,C5,C2,C2…のとき、できあがる最新出現表となる色順位テーブルは、図23(C)に示すようになる。すなわち、最上位はR0のC4,2番目はR1のC3,3番目はR2のC6,4番目はR3のC5,5番目はR4のC2,6番目はR5にあるC2となるが、C2は既に発生しており、さらにR6のC4も既に発生しているので、第6番目はR7のC0となる。このようにして既に上位にある色すなわち、R0〜R3に出現するカラーシンボルを除いた色順位データがR0〜R3のデータに加わり、16色のカラーシンボルの第1番目から16番目までが決められる。なおこのとき、上位4つの周辺画素を学習により可変とすることもできる。
【0027】
【発明が解決しようとする課題】
図23に示される2次元の色順位変換を行うための色順位テーブルは、そのテーブルを作成する際、2次元的な周辺画素と1次元テーブルとの重複したカラーシンボルを1次元テーブルから削除する作業が必要となっている。1次元テーブルから重複したカラーシンボルを削除するこの処理は、カラーシンボルのインデックスコードのビット数が増加すると、莫大な処理量になってしまう。すなわち、図23に示すように全カラーシンボルの数が16色、すなわちインデックスコードとしては4ビットあれば十分な場合には、重複するカラーシンボルを検索し、該当するカラーシンボルを1次元テーブルから削除する作業もそれ程の負荷にはならないが、インデックスコードが8ビットとなると256色となり、重複するカラーシンボルを検索し、削除する作業は莫大となる。
【0028】
例えば、周辺画素データR0,R1,R2,R3が全部異なる色であったとき、4色それぞれについて1次元テーブル中の256色から検索し、同じ色が見つかったところで、そのカラーシンボルを削除し、それ以後の順位を詰めて最後のカラーシンボルに256番目の順位を付ける作業を行う。このため、最高256×4回の比較を行わなければならない。この作業量は極めて莫大なものである。さらに、図23に示す色順位テーブルを構成する1次元テーブルや、特開平6ー276041の図45に示すような1次元テーブルのみから構成する色順位テーブルでは、複数のレジスタからなるFIFOを利用した、いわゆる先頭移動処理(Move to Front)の最新出現表作成処理を行っている。この最新出現表作成時のソーティング処理も、インデックスコードのビット数の増加に伴い演算量が増大し、その処理量が増加する。このため、ビット数が多いインデックスコードを扱う場合には、マルチカラー画像の符号化や復号化の際の処理速度が低下してしまう。
【0029】
また、図16や図19に示すような符号化システム50のラインバッファ51や復号化システム60のラインバッファ61は、参照画素や周辺画素を生成するために、多数の画素が保存できるものとなっている。このため、ラインバッファ51,61が大型化し、その結果、装置が大型化すると共に高価格なものとなる。また、図16や図19に示す従来の装置では、画像の横方向の長さを固定したサイズにして圧縮したり復号しているため、任意の画像サイズを効率良く圧縮したり復号化できないものとなっている。
【0030】
本発明は、以上のような問題に対処してなされたものであり、符号化や復号化に際し、低容量のラインバッファ等の周辺画素生成手段を使用できるマルチカラー画像の符号化装置およびその方法ならびにマルチカラー画像の復号化装置およびその方法を提供することを目的とする。
【0031】
【課題を解決するための手段】
かかる目的を達成するため、請求項1記載の発明では、入力される対象カラー画素データを符号化データに符号化し、出力するマルチカラー画像の符号化装置において、符号化の対象となる対象画像を、限定した画素数の横幅を有する短冊に区切り、前記短冊に対応する画素データを出力する短冊生成手段と、前記短冊に対応する画素データに基づき、当該画素データに対応する2次元の周辺画素に対する周辺画素データおよび符号化対象画素の直前の画素を除いた周辺の4画素の参照画素に対する参照画素データを生成し、前記周辺画素データおよび参照画素データを出力するラインバッファ手段と、を有し、前記周辺画素データに基づいて、色順位テーブルを作成し、前記参照画素データに基づいてマルコフモデルのコンテクストを作成し、前記色順位テーブルおよび前記コンテクストに基づいて、前記各短冊内に位置する前記符号化対象画素を順次符号化する。
【0032】
このように、対象画像を限定した画素数の横幅を有する短冊に区切っているので、ラインバッファ手段を具体化したラインバッファにより周辺画素生成や参照画素生成するに際し、回路規模やメモリ量を削減できる。この結果、装置の小型化、低コスト化が可能となる。
さらに、マルチカラー画像の符号化を行うにあたって、マルコフモデルのコンテクスト作成を直前の画素を除いた周辺の4画素である参照画素に基づいて行うので、符号化処理の高速化を図ることができる。
【0033】
さらに請求項2記載の発明では、入力される対象カラー画素データを符号化データに符号化し、出力するマルチカラー画像の符号化方法において、符号化の対象となる対象画像を、限定した画素数の横幅を有する短冊に区切り、前記短冊に対応する画素データを出力する短冊生成工程と、前記短冊に対応する画素データに基づき、当該画素データに対応する2次元の周辺画素に対する周辺画素データおよび符号化対象画素の直前の画素を除いた周辺の4画素である参照画素に対する参照画素データを生成し、前記周辺画素データおよび参照画素データを出力するラインバッファ工程と、を有し、前記周辺画素データに基づいて、色順位テーブルを作成し、前記参照画素データに基づいてマルコフモデルのコンテクストを作成し、前記色順位テーブルおよび前記コンテクストに基づいて、前記各短冊内に位置する前記符号化対象画素を順次符号化している。
【0034】
このように、対象画像を限定した画素数の横幅を有する短冊に区切っているので、ラインバッファ工程に用いられる周辺画素生成工程や参照画素生成工程に使用されるラインバッファ等の回路規模、メモリ量を削減できる。この結果、この方法を具体化する装置の小型化や低コスト化が可能となる。
さらに、マルチカラー画像の符号化を行うにあたって、マルコフモデルのコンテクスト作成を直前の画素を除いた周辺の4画素である参照画素に基づいて行うので、符号化処理の高速化を図ることができる。
【0035】
さらに、請求項3記載の発明では、入力される対象符号化データを復号化データに復号化し出力するマルチカラー画像の復号化装置において、復号化の対象となる対象画像を、限定した画素数の横幅を有する短冊に区切って復号する短冊合成手段と、前記短冊に対応する画素データに基づき、当該画素データに対応する2次元の周辺画素データおよび参照画素データを生成し、前記周辺画素データおよび前記参照画素データを出力するラインバッファ手段と、を有し、前記周辺画素データに基づいて、色順位テーブルを作成し、直前の画素を除いた周辺の4画素の復号化データに基づいてマルコフモデルのコンテクストを作成し、前記色順位テーブルおよび前記コンテクストに基づいて、短冊状に前記復号化の対象となる対象画像を順次復号化している。
【0036】
このように、対象画像を限定した画素数の横幅を有する短冊に区切っているので、ラインバッファ手段を具体化したラインバッファにより周辺画素生成や参照画素生成を行う際の回路規模、メモリ量を削減できる。この結果、装置の小型化、低コスト化が可能となる。
さらに、マルチカラー画像の復号化を行うにあたって、マルコフモデルのコンテクスト作成を直前の画素を除いた周辺の4画素である参照画素に基づいて行うので、復号化処理の高速化を図ることができる。
【0037】
加えて、請求項4記載の発明では、入力される対象符号化データを復号化データに復号化し出力するマルチカラー画像の復号化方法において、復号化の対象となる対象画像を、限定した画素数の横幅を有する短冊に区切って復号する短冊合成工程と、前記短冊に対応する画素データに基づき、当該画素データに対応する2次元の周辺画素データおよび参照画素データを生成し、前記周辺画素データおよび前記参照画素データを出力するラインバッファ工程と、を有し、前記周辺画素データに基づいて、色順位テーブルを作成し、直前の画素を除いた周辺の4画素の復号化データに基づいてマルコフモデルのコンテクストを作成し、前記色順位テーブルおよび前記コンテクストに基づいて、短冊状に前記復号化の対象となる対象画像を順次復号化している。
【0038】
このように、対象画像を限定した画素数の横幅を有する短冊に区切っているので、ラインバッファ工程に用いられる周辺画素生成や参照画素生成に使用されるラインバッファ等の回路規模やメモリ量を削減できる。この結果、この方法を具体化する装置の小型化、低コスト化が可能となる。
さらに、マルチカラー画像の復号化を行うにあたって、マルコフモデルのコンテクスト作成を直前の画素を除いた周辺の4画素の参照画素に基づいて行うので、復号化処理の高速化を図ることができる。
【0065】
【発明の実施の形態】
本発明の実施の形態を図1から図15に基づき説明する。なお、従来技術中のデータと対応する各データには、同一符号を付して説明する。
【0066】
図1に、本発明に係るマルチカラー画像の符号化システム1の好適な実施の形態を示す。また、図2に、図1の符号化システム1に対応するマルチカラー画像の復号化システム3の好適な実施の形態を示す。
【0067】
この符号化システム1は、短冊生成手段5と、周辺画素生成手段および参照画素生成手段となるラインバッファ10と、縮退手段となるマルコフモデル生成部11と、エントロピー符号化手段となるエントロピー符号器12と、予測手段となる予測器13とを含み、入力されるカラー画素データ100Aのデータストリームを符号化データ200のデータストリームに変換して出力するように構成されている。
【0068】
予測器13は、色順位生成部14と、エスケープ符号発生手段を兼ねる判別部15とから構成される。また、色順位生成部14は、上位の色順位を決める2次元色順位生成部16と、下位の色順位を決める1次元色順位生成部17と、両生成部16,17からの出力を入力し合成された色順位テーブル23と生成する予測表合成部18とから構成される。さらに、2次元色順位生成部16は、優先順位切替部19と、2次元色順位テーブル20とから構成され、1次元色順位生成部17は、テーブル更新部21と、1次元色順位テーブル22とから構成されている。
【0069】
この実施の形態において、符号化の対象とするカラー画素データ100Aは、マルチカラーの画素であり、1画素当たり8ビットのインデックスコードのデータで構成され、256色分のカラーシンボルを表示できる。
【0070】
入力されたカラー画素データ100Aは、ラインバッファ10と、予測器13内のテーブル更新部21へ供給される。
【0071】
ラインバッファ10は、図3に示すように、対象となる画像を、限定した画素数の短冊に区切った部分の画素データを入力し保存する機能を有するものである。具体的には、図3に示すような全体画像をメモリ(図示省略)に取り込み、その後、そのメモリにアクセスしてデータを取りだす。その際、CPUなどの短冊生成手段5によって、データを図3に示す短冊L1〜L5の形状に取り出している。そして、ラインバッファ10は、横幅16画素に区切ったその各短冊L1〜L5中の少なくとも最新に入力された17画素を保存するものである。そして、その値を周辺画素として2次元色順位生成部16に入力し、2次元色順位テーブル20を作成すると共に参照画素としてマルコフモデル生成部11に入力し、状態信号Cxを生成している。
【0072】
マルコフモデル生成部11は、図4に示すように、符号化対象画素Xに対して参照画素として直前の画素(「ー」で表示)を除いた周辺の4画素(A,B,C,Dで表示)を取り入れ、状態信号Cxを発生させている。ここで、直前の画素を採用せず、画素前の画素であるAを参照画素としたのは、次の理由による。従来どおりに直前の画素を参照画素として採用すると、その画素のカラーシンボルが確定するまでエントロピー符号器12やエントロピー復号器32に入力する状態信号Cx,すなわちマルコフモデルのコンテクストが確定せず、符号化や復号化の処理動作を高速化できない。本実施の形態では高速化の要請のため、2画素前の画素であるAを参照画素として採用している。
【0073】
エントロピー符号器12は、図21に示す算術型のエントロピー符号器となっている。すなわち、その内部に状態パラメータ毎の変換テーブル(図示省略)を有するものとなっている。
【0074】
予測器13は、予測手段として機能するものである。そして、符号化の対象となるカラー画素データ100Aが予測器13内の色順位生成部14と判別部15にそれぞれ入力する。また、色順位生成部14には、ラインバッファ10から周辺画素データが入力される。
【0075】
ラインバッファ10から入力される周辺画素データは、優先順位切替部19に入力される。この周辺画素データは、図5に示すように符号化対象画素Xの周辺の画素P0,P1,P2,P3としている。ここで、先に示したマルコフモデルの参照画素A,B,C,Dとは、B=P1,C=P2,D=P3となり、画素Aのみが異なるものとなっている。
【0076】
優先順位切替部19は、2次元色順位テーブル20を生成するための優先順位を所定の切り替え指令に基づき変更するように形成されるものである。しかし、この実施の形態では、P0,P1,P2,P3の順位と位置は、図5および図7に示すように固定されている。固定せずに切り替える方法としては、例えば、符号化の対象となる画像に対しプリスキャンを行い、良好な圧縮率が得られる周辺画素の優先順位パターンを予め求めておいたり、符号化や復号化の動作中にカラーシンボルの一致回数を計算し、一致回数の多い位置の画素を上位にもってくるような切り替え指令を出力するような方法が採用できる。
【0077】
この優先順位切替部19の指令に基づき、予測表合成部18中の色順位テーブルの上位となる2次元色順位テーブル20(図6参照)が作成される。予測表合成部18中の色順位テーブルは図8に示すような、いわば最新出現表で、その上位、この実施の形態では、最高第0位から第3位までの上位4つを2次元色順位テーブル20から求めている。なお、この2次元色順位テーブル20は、メモリ(図示省略)に記憶される。
【0078】
1次元色順位生成部17中のテーブル更新部21にカラー画素データ100Aが入力されると、テーブル更新部21は、メモリに記憶されている1次元色順位テーブル22内を検索し、入力カラー画素データに対応したカラーシンボルの色順位を、第0位に繰り上げる最新出現表作成動作を行う。例えば、図5のT0の位置のカラーシンボルC4が入力されると、テーブル更新部21は、1次元色順位テーブル22内を検索し、該当するカラーシンボルC4を取り出し、そのC4の色順位を第0位に繰り上げ、以前第0位であったC2を第1位に、第1位であったC0を第2位というように順次繰り下げる。そして、その更新された1次元色順位テーブル22をメモリ(図示省略)に記憶させる。
【0079】
1次元色順位生成部17は、256個のレジスタからなるFIFO部で構成しても良いが、この実施の形態では、処理速度の向上を図るために、第0位から第31位までの上位計32個のみをレジスタからなるFIFO部で構成し、完全な最新出現表作成動作をさせている。一方、第32位から第255位までは224バイトのデュアルポートのRAMで構成し、該当するカラーシンボルが第32位以下の第n位のときは、該当するカラーシンボルを第0位に繰り上げ、元第31位(=32番目)であったのものを第n位に入れ替える処理を行っている。なお、第32位以下をデュアルポートのRAMで構成したのは、並行処理により処理速度を上げるためで、低価格化や小型化等を特に考慮する場合は、シングルポートのRAMで構成するようにしても良い。
【0080】
予測表合成部18には、2次元色順位テーブル20のデータと、1次元色順位テーブル22のデータとが入力され、図8に示される一種の最新出現表となる色順位テーブル23が作成される。この色順位テーブル23は、図8に示すように、最大第0位から第3位までが2次元色順位テーブル20に相当する周辺画素から構成される。例えば、周辺画素のP0,P1,P2,P3の色が全て異なるときは、第0位から第3位までをそれらの画素が占めることとなる。一方、P0からP3までが全て同じ色のときは、第0位のみを占め、1次元色順位テーブル22の第1位のものが、この色順位テーブル23でも第1位となる。
【0081】
この色順位テーブル23は、第0位が、2次元色順位テーブル20の第0位であり、しかも1次元色順位テーブル22の第0位でもある。また、第255位、すなわち、上から256番目以後の順位のものには、コードとしてエスケープ符号を付すようにしている。具体的には、第255位には、“11111111”で現されるエスケープ符号と、“00000000”で現される「0」を示すコードとを出力するようにしている。また、第256位には同じく“11111111”のエスケープ符号と、“00000001”の「1」を示すコードとを出力するようにしている。
【0082】
このように、合成された色順位テーブル23は、周辺の画素の値である2次元色順位テーブル20の値と1次元色順位テーブル22との重複部分を削除しない構成となっており、削除を行うための検索(比較)動作が不要となり高速化される。なお、圧縮率の劣化は従来のものに比べ1%以下である一方、処理速度は2倍以上速くなっている。また、このようなエスケープ符号を使用せずに、色順位のコードのビット数を増加させて対応する手段も考えられるが、その場合は、ビット数の増加により符号化の効率が大幅に劣化してしまう。これに対し、エスケープ符号の利用は、圧縮率がほとんど劣化しないので極めて有利となる。
【0083】
合成された色順位テーブル23のデータが判別部15へ出力される。判別部15は、合成された色順位テーブル23のデータと、符号化しようとするカラー画素データ100Aのカラーシンボルとを照合し、符号化しようとするカラー画素データ100Aに対応した色順位データ120を出力するものとなっている。
【0084】
エントロピー符号器12は、先の状態信号Cxとこの色順位データ120を入力し、符号化データ200として出力する。
【0085】
次に、以上の構成を有する符号化システム1の動作について、図10に示すフローチャートに基づいて説明する。なお、説明に当たって、まず通常の場合の動作を説明し、次に各短冊L1〜L6の端部の例外処理について説明する。
【0086】
符号化に際しては、まず、メモリからデータを短冊状に取りだすための短冊生成工程が行われる。その後、具体的に各画素の符号化を開始する。通常の符号化処理においては、符号化対象画素より2つ前のカラー画素データ100Aが既に入力済(ステップS1)となっている。このデータおよび1ライン上の3つの参照画素のデータからマルコフモデル作成部11によってマルコフモデルのコンテクストが作成される(ステップS2)。
【0087】
このコンテクスト作成処理と併行して、色順位変換のため次の処理が行われる。すなわち、符号化対象画素の1画素前のデータも入力済(ステップS3)で、その画素の入力によって周辺画素の入力が全て完了し(ステップS4)、2次元色順位テーブル20が作成される(ステップS5)。一方、符号化対象画素の1画素前のデータの入力は、1次元色順位生成部17への直前画素入力(ステップS6)と同一であり、その入力により1次元色順位テーブル22が作成される(ステップS7)。
【0088】
次に、2次元色順位テーブル20および1次元色順位テーブル22の各データが予測表合成部18へ入力し、合成された色順位テーブル23が作成される(ステップS8)。このとき、第255位(第256番目)以下の順位のカラーシンボルには、全てエスケープ符号(=“11111111”)とそれぞれ異なる番号(0〜3)が付与される。
【0089】
次に、符号化対象のカラー画素データ100Aが入力してきて(ステップS9)、合成された色順位テーブル23のデータと照合される(ステップS10)。カラー画素データ100Aが、2次元色順位テーブル20中のものと異なるとき、1次元色順位テーブル22に相当する部分を検索し、該当するカラーシンボルを見つけ出す。そして、そのカラーシンボルが例えば1次元色順位テーブル22中の第10位(11番目)にあるとき、仮に2次元色順位テーブル20中の順位が4つあるとすると、3をプラスして、第13位となる色順位データ120を出力する(ステップS11)。このように、実質的な検索は、2次元色順位テーブル20と1次元色順位テーブル22に対して行われ、2次元色順位テーブル20中に見つかるときは、その検索された順位をそのまま出力し、1次元色順位テーブル22中にあるときは、所定の値をプラスして出力する。
【0090】
一方、その該当したカラーシンボルを1次元色順位テーブル22の第0位にもってくると共に、2次元色順位テーブル20および合成された色順位テーブル23の各第0位にそのカラーシンボルをもってくる。このような各テーブル20,22,23の更新作業をステップS12にて行う。この際、1次元色順位テーブル22および合成された色順位テーブル23の下位の部分では、その値が第0位から第31位までのときは、完全な最新出現表作成動作を行い、最新のものが第0位に上がり、その他のものは1つずつ繰り下がる。しかし、第32位以下のものが対象となったときは図9に示すように、元の第31位のものを該当の順位の所にもってくる入れ替え処理を行っている。
【0091】
出力された色順位データ120と、マルコフモデルのコンテクスト、すなわち状態信号Cxとからエントロピー符号器12で、符号化処理を行い(ステップS13)、符号化データ200を出力する(ステップS14)。そして、符号化が終了するのか否か判断し(ステップS15)、終了の場合は符号化を終了し、継続のときはステップS9に戻る。
【0092】
以上が通常の符号化のステップとなる。次に、各短冊L1〜L5の端部の例外処理について、説明する。
【0093】
まず、最初の短冊L1の最初の部分、すなわち図11(A)の最上部の左端の画素を符号化するときについて説明する。まず、対象となる符号化対象カラー画素データ100Aが入力される。すなわち、ステップS9が最初に実行される。このとき、周辺画素は入力されていないので、2次元色順位テーブル20は、1次元色順位テーブル22の第0位のものに全て初期化され、一方、1次元色順位テーブル22も、256色のカラーシンボルが第0位から第255位までに並べられて初期化されている。このため、合成された色順位テーブル23としては第0位から第255位までに並べられた256色のカラーシンボルの表が予測表合成部18内に存在することとなる。また、ラインバッファ10内も、当初はすべて「0」に初期化されている。なお、ラインバッファ10の初期値として、「0」以外の値のカラーシンボルを採用するようにしても良い。
【0094】
その後は、図10に示すステップS10、S11,S12,S13,S14,S15の作業を行い、ステップS9に戻る。このとき、各テーブルの更新(ステップS12)における2次元色順位テーブル20の更新では、2次元色順位テーブル20のP0の位置に入力されたカラー画素に対応するカラーシンボルを入れ込む処理をする。P1,P2,P3は、まだ生じていないので、ラインバッファ10の初期値「0」がカラーシンボルとなる。一方、1次元色順位テーブル22では、第0位の位置に入力されたカラー画素に対応するそのカラーシンボルを繰り上げる先頭移動処理すなわち最新出現表作成動作を行う。
【0095】
図11(B)に示す短冊L1の最上ラインでは、常に周辺画素としてはP0のみが入力されている状態となっている。一方、1次元色順位テーブル22は、常に最新出現表作成動作が行われ、最も最新に入力されてきたカラーシンボルを最上位に上げる処理を行っている。なお、マルコフモデルのコンテクストは、第1番目の画素の入力時には本来のものは作成されておらず、状態信号Cxとしては仮の値として1色としてCx=0を出力している。第2番目の画素の入力時も同様で、第3番目の画素の入力時点から図4に示すAの値が確定してくるが、やはり本来のマルコフモデルは形成できない。しかし、1ライン上の画素のカラーシンボル、すなわちインデックスが「0」に初期化されているので、P0のカラーシンボルが「0」であれば、状態信号は、1色を示すCx=0が出力され、P0のカラーシンボルが「0」でなければ、状態信号は、2色を示すCx=1が出力される。
【0096】
その後、短冊L1の第2ラインの左端(第17番目の画素)のカラー画素データ100Aが入力されてくると、周辺画素としてのP0,P1,P2は図12(A)に示すとおりとなる。すなわち、符号化対象画素Xの1画素前がP0で、15画素前がP2で、16画素前、すなわち1ライン上の同位置にくるのがP1となる。そして、P3はまだ生じていないので、カラーシンボル「0」が入っているものとして処理する。
【0097】
このように、この実施の形態では、周辺画素P0〜P3や参照画素A〜Dを符号化対象画素Xからラインバッファ10内で一定距離離れた位置の値としている。すなわち、図12(B)にも示されているように周辺画素P0は、1つ前、参照画素Aは2つ前、周辺画素P2(これは参照画素Cでもある)は15個前、周辺画素P1(これは参照画素Bでもある)は16個前、すなわち符号化対象画素の1ライン前の同じ位置、周辺画素P3(これは参照画素Dでもある)は17個前となる。以上のような考え方は、図12(C)に示すように、符号化対象画素Xや周辺画素等が、短冊L2と短冊L1に分離されている場合も同様となる。このようにして、17個分の画素をラインバッファ10内に保存しておけば参照画素や周辺画素として常に利用できることとなる。また、ラインバッファ10の初期値として「0」をセットするという簡単な作業を行うものの、符号化の途中で、「0」の値を仮想的に入れ込む等の煩わしい例外処理を行ってはいない。すなわち、この実施の形態では、煩わしい例外処理を特別に施すことなく、1つの短冊から次の短冊へ通常と変わらない同じ処理動作で進むことができる。
【0098】
また、短冊を横幅16画素単位で区切っていった場合、図3に示すように最後の短冊L5の横幅が16画素未満となることがある。その場合、その短冊L5の横幅が4画素以上の場合、図13に示すように、その横幅の画素数をnとすると、P0は符号化対象画素の1つ前、参照画素Aは2つ前、周辺画素P2(参照画素C)は(nー1)個前、周辺画素P1(参照画素B)はn個前、周辺画素P3(参照画素D)は(n+1)個前となる。
【0099】
短冊L5の横幅が3画素であると、図14(A)に示すように、参照画素Aが参照画素Cと同一となり周辺画素P2の場所となる。その他は横幅4画素のときと同じ関係となる。短冊L5の横幅が2画素であると、図14(B)に示すように、符号化対象画素Xの1つ前がP0となり、2つ前がP1となり、3つ前がP3となる。ここで、P2は、図13に示す関係では、(2−1)個前、すなわち1つ前となりP0と同じ値となる。しかし、P2に対応する参照画素Cは、1つ前とはならずP1の位置のものとなる。このため、参照画素B,C,Aが全てP1の位置となる。さらに、短冊L5の横幅が1画素であると、同様に図13の関係を準用し、図14(C)に示すように、符号化対象画素Xの1つ前がP0,P1,P2を示し、2つ前がP3を示すものとなる。ここで、参照画素A,B,C,Dは全て同じでP3の位置のものとなる。
【0100】
以上のような例外処理を行うと、例えば端部について、周辺画素や参照画素の位置関係上足りない部分に仮想的に“0”をおいて処理したり、横幅16画素未満の短冊については、横幅16画素となるように処理する場合に比べ処理が効率化されると共に、横幅自由な画素数の画像を簡単に扱えるようになる。
【0101】
次に、符号化システム1に対応したマルチカラー画像の復号化システム3について説明する。
【0102】
この復号化システム3は、短冊合成手段7と、周辺画素生成手段および参照画素生成手段となるラインバッファ30と、縮退手段となるマルコフモデル生成部31と、エントロピー復号化手段となるエントロピー復号器32と、予測手段となる予測器33とを含み、入力される符号化データ200のデータストリームをカラー画素データ100Bのデータストリームに変換して出力するように形成されている。このとき、復号化システム3のアルゴリズムは、符号化システム1のアルゴリズムと全く逆のアルゴリズムになるように構成されている。したがってカラー画素データ100Aのビット構成およびデータストリームと、カラー画素データ100Bのビット構成およびデータストリームとは全く同じものとなる。予測器33は、符号化システム1中の予測器13と全く同一構成となっている。すなわち、予測器33は、色順位生成部14と、エスケープ符号化発生手段を兼ねる判別部15とから構成される。また、色順位生成部14は、上位の色順位を決める2次元色順位生成部16と、下位の色順位を決める1次元色順位生成部17と、両生成部16,17からの出力を入力し合成された色順位テーブル23を生成する予測表合成部18とから構成される。さらに、2次元色順位生成部16は、優先順位切替部19と、2次元色順位テーブル20とから構成され、1次元色順位生成部17は、テーブル更新部21と、1次元色順位テーブル22とから構成されている。
【0103】
ラインバッファ30は、符号化システム1のラインバッファ10と同様に少なくとも17画素分を保存できるものとなっている。そして、その値を周辺画素として2次元色順位生成部16に入力し、2次元色順位テーブル20を作成すると共に、参照画素としてマルコフモデル生成部31に入力し状態信号Cxを生成している。
【0104】
エントロピー復号器32は、状態信号Cxを利用して、入力する符号化データ200を、エントロピー符号器12と逆の手順で復号化演算処理し、これを色順位データ120に変換して予測器33へ向け出力する。なお、エントロピー復号器32は、エントロピー符号器12とは全く逆のアルゴリズムでその演算を行うように形成しなければならない。したがって、エントロピー復号器32は、エントロピー符号器12に算術符号器が用いられた場合には、それと同様な構成の算術復号器として形成する必要があり、また、エントロピー符号器12にハフマン符号器が用いられた場合には、それと同じ構成のハフマン復号器として構成する必要がある。これにより、符号化データ200は、これと対をなす色順位データ120に正確に変換して出力されることとなる。
【0105】
予測器33は、予測手段として機能するものである。そして、その内部に符号化システム1の予測器13と同一の合成された色順位テーブル23が設定されており、入力される色順位データ120および周辺画素のデータに基づき、色順位テーブル23から対応するカラーシンボルをカラー画素データ100Bとして復号化し出力する。
【0106】
次に、このように構成される復号化システム3の動作について、図15に示すフローチャートに基づいて説明する。
【0107】
まず、復号化対象画素の符号化データ200がエントロピー符号器32へ入力する(ステップS31)。一方、2画素前のデータに基づきマルコフモデルのコンテクストが作成され(ステップS32)、状態信号Cxとしてエントロピー復号器32へ入力する。エントロピー復号器32は、符号化データ200を、状態信号Cxを利用して復号化処理する(ステップS33)。
【0108】
エントロピー復号器32による復号化処理によって、色順位データ120が出力し(ステップS34)、予測器33内の判別部15へ入力する。
【0109】
一方、既にカラー画素データ100Bとして復号化されたデータは、ラインバッファ30を経由して周辺画素として予測器33の優先順位切替部19へ入力する(ステップS35)と共に予測器33内のテーブル更新部21へ直前画素として入力する(ステップS36)。周辺画素が入力されると、2次元色順位テーブル20が作成される(ステップS37)。直前画素が入力されると、1次元色順位テーブル22が作成される(ステップS38)。
【0110】
ここで2次元色順位テーブル20は、図6に示すものと同一で、1次元色順位テーブル22は、図7に示すものと同一となっている。そして、テーブル更新部21は、図9に示すように、第0位から第31位までが完全な先頭移動動作を行うFIFO部となり、その下位は224バイトからなるRAMで構成されるものとなっている。
【0111】
予測表合成部18で、両テーブル20,22から合成された色順位テーブル23を作成する(ステップS39)。この色順位テーブル23のデータは、判別部15へ入力し、先の色順位データ120と照合される(ステップS40)。ここで色順位データは、例えば第63位のものであると“00111111”なる符号で、第256位であると、エスケープ符号“11111111”と“00000001”の符号となる。そして、照合の結果、合成された色順位テーブル23中の該当する順位の所のカラーシンボルのカラー画素データ100B(=インデックスコード)を出力する(ステップS41)。
【0112】
次に、例えば、第2位のコードが出てきたとき、対応するカラーシンボルのカラー画素データ100Bを出力すると共に、合成された色順位テーブル23中のそのカラーシンボルを第0位に繰り上げ、第0位のものを第1位に、第1位のものを第2位に繰り下げる更新処理を行う(ステップS42)。この更新は、2次元色順位テーブル20や1次元色順位テーブル22についても必要により適宜行われる。
【0113】
なお、更新作業の際、2次元色順位テーブル20は、P0,P1,P2,P3の順位が決まっているが、もし、復号化されるものがP0,P1,P2,P3のいずれかと同一であると、例えば、第2位にあるP2と同一であると、そのカラーシンボルを第0位に繰り上げる。このとき、1次元色順位テーブル22について、全く先頭移動処理を行わないとすると、符号化時の1次元色順位テーブル22とは異なるものとなってしまう。このため、2次元色順位テーブル22中の第2位の位置にあったカラーシンボルと同一のカラーシンボルを1次元色順位テーブル22の中で検索し、そのカラーシンボルを第0位に上げ、その他のものを並び替える先頭移動処理を行わせる。
【0114】
このとき、この1次元色順位テーブル22の検索は、1次元色順位テーブル22の中の第0位から第16位までの上位17個の検索に限定できる。すなわち、P0〜P3は、1次元色順位テーブル22の中の最新17個の画素の1つであるためである。このように、復号化される画素がP0〜P3のいずれか1つであると、1次元色順位テーブル22の更新のためには、最高17回の検索(比較)のみで良くなる。このように、最高17回に限定されるのは、画像が横幅16画素の短冊に区切られているため、ラインバッファ10に保存する参照画素を17個に限定できるためである。
【0115】
一方、復号化される画素がP0〜P3のいずれでもないときは、色順位データ120、例えば第150位と示す色順位データ120がステップS34で出力されると、P0〜P3で計4色となるときは、その色順位データ120に相当するものは、1次元色順位テーブル22中では、第153位に相当するものとなるので、検索をせず直接第153位のカラーシンボルを抜き出し第0位に繰り上げることとなる。
【0116】
このように、復号化の場合、最高16個の検索(比較)が行われるが、この16回という検索(比較)回数は、特開平6ー276041で示される従来の技術における重複カラーの削除のための検索回数(256×4)に比べれば極めて少なくなっており、非常な高速処理が可能となる。なお、復号化時の検索を符号化時と等価なものとし、1次元色順位テーブル22内を全て検索するようにしても良いが、高速処理の点では、上述した実施の形態の方が好ましい。
【0117】
カラー画素データ100Bが出力されると、ステップS43で復号化が終了なのか否か判断する。そして、新たな符号化データ200の入力がなく、復号化が終了であると判断すると終了する。一方、継続のときはステップS31に戻る。なお、復号化の際においても、短冊の端部や小さい幅の短冊に関する例外処理が図11から図14に示すものと同様なアルゴリズムで実行される。また、復号化されたカラー画素データ100Bは、短冊合成手段7による短冊復号工程によって短冊状に復号され、そのデータがメモリ(図示省略)に取り込まれ、図3に示すような全体画像として復号される。
【0118】
なお、この実施の形態において、第255位以下の順位のものはエスケープ符号と、全体順位(第1番目から数えるもの)から256を引いた数値を示す符号の2つの符号(計16ビット)を出力することとなるが、第255位以下というような順位が低いものは、ほとんど発生しないカラーコードを示しており、そのような2つの符号を出力することはほとんど発生しない。しかも、発生したとしてもその後は、出やすい順位に割り当てられるので、先に示したように圧縮率はほとんど劣化しない。これに比べ重複するカラーコードを削除し、順番を入れ替えるソーティング処理をなくすことができる効果は極めて大きなものとなる。
【0119】
この実施の形態のマルコフモデルは、従来のものと異なり、符号化対象画素の直前の画素を参照画素として採用していないが、圧縮率の劣化は数%に抑えられている。一方、処理速度は、エントロピー符号器12やエントロピー復号器32と色順位変換とのパイプライン処理が可能となり、2倍以上に高速化されている。なお、この実施の形態では、直前画素を周辺画素としては利用しているが、この実施の形態とは異なり、直前の画素を色順位テーブル23の作成のための周辺画素としても採用しない場合においても、圧縮率の劣化は10%程度に抑えられる一方、処理速度は2倍以上となる。
【0120】
さらに、この実施の形態のラインバッファ10,30は画像が短冊に区切られているため、小容量のものとすることができる。すなわち、マルコフモデルの参照画素、色順位変換のための周辺画素としては、1ライン上の画素を見る必要があるが、短冊的に横幅が区切られているので、1ライン上の画素を見るために保存しておくべき画素の数が少なくなる。このため、ラインバッファ10,30は小型化、小容量化でき、低コスト化できる。
【0121】
なお、上述の実施の形態は、本発明の好適な実施の形態の例であるが、これに限定されるものではなく本発明の要旨を逸脱しない範囲において、種々変形実施可能である。例えば、カラー画素データ100Aとしては、nビット(nは2以上の整数)のカラー画素データ100Aを対象とし、その符号化や復号化を行うように構成することができる。
【0122】
また、対象画像を短冊に区切る方法は、図23に示す重複したカラーシンボルを削除する従来の装置や方法に適用することもできる。その場合、処理を高速化できるという効果を有するものとなる。また、本実施の形態に示す合成された色順位テーブル23や図23に示す従来の合成された色順位テーブルを持たない、図16に示すような通常の符号化システム50や復号化システム60に、対象画像を短冊に区切る方法を採用することもできる。その場合、ラインバッファ51,61の低容量化、低コスト化等の効果を有するものとなる。
【0123】
さらに、短冊の横幅としては、ラインバッファ10,30の容量等を考慮すると8〜64画素が好ましいが、検索効率や端部の例外処理による圧縮効率を考慮すると16〜32画素が最も好ましい。さらに、1次元色順位生成部17内のFIFO部とRAMの構成比としては、FIFO部を全体の1/4〜1/32として残りをRAMとするのが好ましく、FIFO部を1/8〜1/16として残りをRAMとするのが、圧縮率がそれ程落ちず、しかも高速処理することができる点で最も好ましい。
【0124】
また、符号化や復号化の手段としては、算術符号型のエントロピー符号器12や復号器32の他に、ランレングス符号化(復号化)技術や他の符号化(復号化)技術を採用することができる。
【0125】
さらに、マルコフモデルのコンテクストとしては、1色から4色の4状態以外に図20に示すように異なる色がどこにあるかによって状態信号Cxも異ならせるようにしたりする等他の状態信号Cxを発生させるようにしても良い。
【0126】
また、マルコフモデルの参照画素と色順位変換のための周辺画素とを異ならしめるには、この実施の形態で示すように1画素前のものを参照画素として採用せず2画素前のものを採用する他に、3画素以上の前の参照画素として採用するようにしても良い。すなわち、1画素前に加え、2画素前の画素も参照画素として採用しないようにしても良い。
【0127】
このマルコフモデルのコンテクスト作成技術、すなわち、符号化対象画素の直前の画素を参照画素として採用しない技術は、色順位変換を行わせる技術と併行してきはなく単独として各種の符号化や復号化の技術に利用することができる。
【0128】
【発明の効果】
以上説明したように、本発明のマルチカラー画像の符号化装置およびその方法では、対象画像を短冊に区切ることにより、演算量の大幅な削減が可能となり符号化処理を高速化できると共に任意の画像サイズのマルチカラー画像を効率良く符号化できる。しかも、符号化に際し利用する周辺画素生成手段等、例えばラインバッファ等を低容量化かつ低コスト化させることができる。
【0129】
また、本発明のマルチカラー画像の復号化装置およびその方法では、対象画像を短冊に区切ることにより、演算量の大幅な削減が可能となり復号化処理を高速化できると共に任意の画像サイズのマルチカラー画像を効率良く符号化できる。しかも、復号化に際し利用する周辺画素生成手段等となるラインバッファを低容量化かつ低コスト化させることができる。
【図面の簡単な説明】
【図1】本発明のマルチカラー画像の符号化装置およびその方法を採用した符号化システムを示す図である。
【図2】本発明のマルチカラー画像の復号化装置およびその方法を採用した復号化システムを示す図である。
【図3】図1および図2の符号化システムおよび復号化システムに採用されるスキャン方法を説明するための図である。
【図4】図1および図2の符号化システムおよび復号化システムに採用されるマルコフモデルとそのコンテクストを説明する図で、(A)はマルコフモデルとして採用する参照画素の配置を示す図で、(B)はマルコフモデルのコンテクスト、すなわち状態信号の種類を示す図である。
【図5】図1および図2の符号化システムおよび復号化システムに採用される色順位テーブルの作成に使用される画素を説明するための図で、(A)は使用される画素の配置と画素優先順位を示す図で、(B)は(A)の各画素のカラーシンボルを示す図である。
【図6】図1および図2の符号化システムおよび復号化システムに採用される2次元色順位テーブルを示す図である。
【図7】図1および図2の符号化システムおよび復号化システムに採用される1次元色順位テーブルを示す図である。
【図8】図1および図2の符号化システムおよび復号化システムに採用される合成された色順位テーブルを示す図である。
【図9】図1および図2の符号化システムおよび復号化システムに採用される1次元色順位テーブルの構成とその更新処理を説明するための図である。
【図10】図1の符号化システムにおける符号化動作を示すフローチャートである。
【図11】図1の符号化システムの符号化動作における2次元色順位テーブル用の周辺画素の取扱いを説明する図で、(A)は最も初めの符号化対象画素を符号化する場合を説明するための図で、(B)は第1番目のライン中の符号化対象画素を符号化する場合を説明するための図である。
【図12】図1の符号化システムの符号化動作における2次元色順位テーブル用の周辺画素の取扱いを説明する図で、(A)は符号化対象画素が第2ラインの始めにきたときの符号化を説明するための図で、(B)は符号化対象画素が第2ラインの終端にきたときの符号化を説明するための図で、(C)は符号化対象画素が隣の短冊の最初の部分にきたときの符号化を説明するための図である。
【図13】図1の符号化システムの符号化動作における2次元色順位テーブル用の周辺画素およびマルコフモデル用の参照画素の取扱いを説明する図で、狭幅の短冊でも通常の短冊と同様な考えで取り扱うことができる場合を示す図である。
【図14】図1の符号化システムの符号化動作における2次元色順位テーブル用の周辺画素およびマルコフモデル用の参照画素の取扱いを説明する図で、通常の短冊とは異なる例外処理を施す必要がある場合を示し、(A)は横幅が3画素のときを、(B)は2画素のときを、(C)は1画素のときをそれぞれ示す図である。
【図15】図2の復号化システムにおける復号化動作を示すフローチャートである。
【図16】従来のマルチカラー画像の符号化システムおよび復号化システムのブロック図である。
【図17】従来の符号化対象画素データに対する参照画素データの説明図である。
【図18】従来のパラメータテーブルを示す図である。
【図19】状態縮退器を有する従来のマルチカラー画像の符号化システムおよび復号化システムのブロック図である。
【図20】従来の縮退テーブルの一例を示す図である。
【図21】従来の算術符号型のエントロピー符号器およびエントロピー復号器の説明図である。
【図22】従来のマルチカラー画像のインデックスを説明するための図である。
【図23】従来の合成された色順位テーブルの作成原理を示す説明図で、(A)は各画素の配置関係を示し、(B)は各画素のカラーシンボルを示し、(C)は合成された色順位テーブル(最新出現表)を示す図である。
【符号の説明】
1 符号化システム
3 復号化システム
5 短冊生成手段
7 短冊合成手段
10 ラインバッファ(周辺画素生成手段)
11 マルコフモデル作成部(縮退手段)
12 エントロピー符号器(エントロピー符号化手段)
13 予測器(予測手段)
14 色順位生成部
15 判別部(エスケープ符号発生手段を兼ねる)
16 2次元色順位生成部
17 1次元色順位生成部
18 予測表合成部
19 優先順位切替部
20 2次元色順位テーブル
21 テーブル更新部
22 1次元色順位テーブル
23 合成された色順位テーブル
30 ラインバッファ
31 マルコフモデル生成部(縮退手段)
32 エントロピー復号器(エントロピー復号化手段)
33 予測器
100A 符号化されるカラー画素データ
100B 復号化されたカラー画素データ
120 色順位データ
200 符号化データ
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a multi-color image encoding apparatus and method and a multi-color image decoding apparatus and method. More specifically, the present invention relates to an improvement in how to divide the target image, particularly when encoding and decoding a multi-color image.
[0002]
[Prior art]
Conventionally, an image called a multi-color image has been used in personal computers and game machines. This multi-color image is also called a representative color image or a limited color image. As shown in FIG. 22, a specific color, that is, a specific R (red), G (green), B (blue) ) Is an image in which an index is assigned to a color having a value of), and data is expressed by limited representative colors such as 16 colors or 256 colors using the data of the index.
[0003]
For such multi-color image data, if each color of R, G, and B is represented by 8 bits (256 types), a total of 24 bits are required, but the index itself is displayed by, for example, 8 bits. Therefore, the compression rate is considerable. However, although it is compressed, it still has a large amount of information, so if it is processed as it is without any contrivance, the memory capacity becomes large and the communication speed becomes slow, which is not practical. Therefore, the compression technique is very important for multicolor images as well as other image data. In particular, since the number of colors of a multi-color image is limited, lossless encoding and decoding, that is, a reversible compression technique is required.
[0004]
On the other hand, in recent years, a technique using an entropy encoder and a decoder has attracted attention as one of data compression techniques. As one of the entropy encoding and decoding techniques, for example, there is a technique using arithmetic encoding and decoding techniques. An outline of this technique is described in, for example, Japanese Patent Laid-Open Nos. 62-185413, 63-74324, 63-76525, and the like.
[0005]
FIG. 16 shows a conventional multi-color image encoding system 50 and decoding system 60 using such a technique. The encoding system 50 includes a line buffer 51 and an entropy encoder 52. The input index data, that is, the color pixel data 100 </ b> A is input to the line buffer 51 and the entropy encoder 52. As shown in FIG. 17, the color pixel data 100A is raster-scanned and sequentially input as pixel data in the horizontal scanning order. As a method of creating the index data, that is, the color pixel data 100A, a method of assigning an index in the order of input colors is generally used, as shown in FIG. For example, there is a phenomenon in which the colors are substantially different between “1” and “2”, or the colors are similar even when the index numbers are far, for example, “100” and “200”. In order to avoid such a phenomenon, as shown in Japanese Patent Application Laid-Open No. 5-328142, there are also those in which serial numbers are assigned to those having similar colors.
[0006]
The line buffer 51 in the encoding system 50 creates reference pixel data A, B, C, and D for the encoding target pixel X from the already input color pixel data 100A as reference pixel generation means. That is, the line buffer 51 stores a history of n lines (there are many 1 to 5 lines) when scanning an image. Each time the color pixel data 100A of the encoding target pixel X is input, a series of pixel data composed of the immediately preceding pixel A and the surrounding pixels B, C, and D is used as reference pixel data 110 as an entropy encoder. Output to 52.
[0007]
The entropy encoder 52 is formed using a technique such as arithmetic coding or Huffman coding, for example. Then, using the reference pixel data 110 as a status signal, the target color pixel data 100A is converted into encoded data 200 and output.
[0008]
On the other hand, the decoding system 60 includes a line buffer 61 and an entropy decoder 62. Here, the line buffer 61 and the entropy decoder 62 are formed so as to decode and output the input encoded data 200 in a procedure completely opposite to the line buffer 51 and the entropy encoder 52 of the encoding system 50. Yes.
[0009]
In this way, the encoding system 50 and the decoding system 60 encode the color pixel data 100A into the encoded data 200 using algorithms that are completely opposite to each other, and further convert the encoded data 200 into the color pixel data. 100B can be decoded and output. Therefore, this system can be widely used for various applications.
[0010]
By the way, in such a system, when the value of the color pixel data 100A, that is, the index number is biased near a certain number, the compression rate of the data is improved. In this system, the reference pixel data 110 is used as a status signal for the entropy encoder 52 and the entropy decoder 62. Therefore, if the number of states, that is, the number of reference pixels is increased, the data compression rate is similarly improved. That is, when the entropy encoder 52 and the decoder 62 are configured using a technique such as arithmetic coding or Huffman coding, if there is a large bias in the probability of occurrence of 0 or 1 symbols, the data compression rate is reduced. Can be increased. This is because in the entropy encoding technique, short encoded data is assigned to input data with a high occurrence probability, and relatively long encoded data is assigned to input data with a low occurrence rate.
[0011]
In order to obtain a large bias in the occurrence probability of symbols, that is, index numbers, conventionally, input data is classified into several states and encoded. This is because a good compression rate cannot be obtained without classification. For example, in the conventional method shown in FIG. 16, the line buffer 51, 61 is used to create reference pixel data, which is input to the entropy encoder 52 and the entropy decoder 62 as a classification state signal. The entropy encoder 52 and the entropy decoder 62 classify input data by using the state signal, and perform encoding and decoding. That is, the occurrence probability of each state of the reference pixel data is calculated, and short encoded data is assigned to a combination having a high occurrence probability. As a result, the data compression rate is increased.
[0012]
However, the entropy encoder 52 and the entropy decoder 62 described above require a number of encoding parameter tables corresponding to the number of states of the reference pixel data. For this reason, the larger the number of reference pixels in order to increase the compression ratio, the larger the parameter table for encoding and decoding. For this reason, there is a problem that the entropy encoder 52 and the entropy decoder 62 become large and expensive.
[0013]
For example, it is assumed that the color pixel data, that is, the index number is composed of 4-bit data (16 types) and the number of pixels of the reference pixel data 110 is four. In this case, the number of states of the encoding and decoding parameter table is 4 pixels × 4 bits = the number of states for 16 bits, that is, 2 16 Take the number of states. For this reason, 2 16 = 65536 parameter tables must be prepared. For this reason, each time the reference pixel is increased by one, the encoding and decoding parameter table is correspondingly increased, and the hardware configuring the entropy encoder 52 and the entropy decoder 62 is increased in size. Understood. In addition, the target pixel is also composed of 4 bits, that is, 4 planes, and a signal of 1 bit is assigned to each plane. As a result, 16 bits (colors) are obtained with 4 bits, so the parameter table is 65536 × 16. (See FIG. 18).
[0014]
In order to solve such a problem, the color symbol conversion method of calculating the color frequency deviation of the target pixel, that is, the index number corresponding to the color, and rearranging the index numbers corresponding to the appearance frequency order ( JP-A-6-276041). That is, by this, short encoded data is assigned to those with a high appearance frequency, and the compression rate is further increased. This publication also discloses a technique for reducing the parameter table according to the number of states degenerated in the entropy encoder 52 and the entropy decoder 62.
[0015]
The feature of the system for reducing the number of states disclosed in Japanese Patent Laid-Open No. 6-276041 is that, as shown in FIG. 19, the entropy encoder 52 and the entropy are the same as in the conventional encoding system 50 and decoding system 60. The reference pixel data 110 is input to the decoder 62 as a state signal. At the time of input, the state signal 140 is converted from the state signal degenerater 53, which degenerates the reference pixel data 110 output from the line buffers 51 and 61. It is in the point generated by 63.
[0016]
The state degeneration units 53 and 63 are configured to degenerate the input reference pixel data 110 into a state signal 140 having a smaller number of bits and output it to the corresponding entropy encoder 52 and entropy decoder 62. Yes. Each of the predictors 54 and 64 has, in its memory, a color order table (details will be described later) for converting the color pixel data into the color order based on the appearance frequency of the color symbols and vice versa. It is what.
[0017]
Note that degeneration is an operation of classifying the original state into the number of states after degeneration. This classification is performed by selecting the combination so that entropy (average information amount for displaying one symbol) after classification is minimized. Then, an identification bit is added to the number of states after degeneration, that is, the number of states after classification. This is the status signal 140.
[0018]
By the way, as a reduction table used for the state reduction units 53 and 63, a reduction table for specifying the relationship between the color symbol combination pattern of the reference pixel data 110 and the reduction data is set, and this reduction table is used for input. There is a method in which a combination pattern of color symbols in the reference pixel data 110 is converted into degenerate data and output.
[0019]
FIG. 20 shows an example of the degeneration operation performed using such a method. Here, in order to simplify the description, as shown in FIG. 20A, for the encoding target pixel X, a Markov model formed of three pixels A, B, and C is used as a reference pixel pattern. Will be described as an example.
[0020]
When the reference pixel is composed of three pixels as shown in FIG. 20A, there are five color symbol combination patterns as shown in FIG. 20B. That is, the pattern is classified into five patterns: a pattern in which the color symbols of all three pixels match, a pattern corresponding to the case in which only two color symbols match, and a pattern in which the color symbols of all pixels are different. The
[0021]
Therefore, by using the table shown in FIG. 20B as the degeneration table of the state degeneration units 53 and 63, a combination of three pixels can be originally obtained. 12 The pattern state can be reduced to five states S1 to S5 shown in FIG. By doing so, the reference pixel data 110 can be effectively degenerated, and the number of states of the entropy encoder 52 and the entropy decoder 62 can be significantly reduced.
[0022]
By the way, a general technique of such arithmetic coding and decoding has already been described in detail in p26 to 44 and p44 to p50 of 1 image coding standard JBIG (International Standard ISO / IEC11544). Then, it will be briefly described as a prerequisite technique for developing the present invention described later.
[0023]
An example of the arithmetic code type entropy encoder 52 used in FIG. 16 is shown in FIG. Note that the configuration of the arithmetic decoding type entropy decoder 62 is substantially the same as the configuration of the entropy encoder 52, and thus the description thereof is omitted here.
[0024]
The entropy encoder 52 includes an arithmetic operation unit 55 and occurrence probability generation means 56 that functions as a state memory. In the occurrence probability generation means 56, a state parameter table necessary for determining the symbol occurrence probability required for encoding is written. The state parameter is specified by an input state signal. Then, the occurrence probability calculation parameter of the occurrence probability generation means 56 is output to the arithmetic operation unit 55 with respect to the state parameter table specified by the state signal. The arithmetic operation unit 55 performs entropy encoding based on the occurrence probability input in this way, and converts the input color rank data 120 into encoded data 200 and outputs it. Then, the occurrence probability for the state signal is recalculated based on the value of the encoded color rank data 120, and is input to the occurrence probability generation means 56 as an operation parameter update value. By storing this update result in the table as the occurrence probability of the next data, the compression efficiency of the entropy encoder 52 is improved.
[0025]
In order to generate the color order data 120, the color order table is arranged in the predictors 54 and 64 as described above. As an example of this color order table, one shown in FIG. 23 is known (see Japanese Patent Laid-Open No. 6-276041). In this example, when determining the color order table for the encoding target pixel X, the two-dimensional peripheral pixel data R0, R1, R2, and R3 are used as upper color order data, and the encoding target pixel X and A one-dimensional table of the same line is used as lower color order data. At this time, after the color symbols of the peripheral pixel data R0, R1, R2, and R3 are removed from the one-dimensional table, the upper and lower color order data are docked to form a color order table for the encoding target pixel X.
[0026]
A specific example of how the color order table is created will be described with reference to FIG. Consider a case where 16 color symbols are encoded. If the color order is fixed at the positions R0, R1, R2,... R8... Of each pixel as shown in FIG. 23 (A), the respective color symbols are C4, C3 as shown in FIG. , C6, C5, C2, C2,..., The color rank table that becomes the latest appearance table is as shown in FIG. That is, the highest level is C4 of R0, the second is C3 of R1, the third is C6 of R2, the fourth is C5 of R3, the fifth is C2 of R4, the sixth is C2 in R5, but C2 is Since it has already occurred and C4 of R6 has already occurred, the sixth is C0 of R7. In this way, the color order data excluding the color symbols already appearing in the upper rank, that is, the color symbols appearing in R0 to R3, are added to the data of R0 to R3, and the first to 16th color symbols of 16 colors are determined. . At this time, the upper four surrounding pixels can be made variable by learning.
[0027]
[Problems to be solved by the invention]
The color order table for performing the two-dimensional color order conversion shown in FIG. 23 deletes from the one-dimensional table the overlapping color symbols of the two-dimensional peripheral pixels and the one-dimensional table when the table is created. Work is needed. This process of deleting duplicate color symbols from the one-dimensional table increases the amount of processing as the number of bits of the color symbol index code increases. That is, as shown in FIG. 23, if the number of all color symbols is 16 colors, that is, if 4 bits are sufficient as an index code, duplicate color symbols are searched and the corresponding color symbols are deleted from the one-dimensional table. However, when the index code is 8 bits, there are 256 colors, and the operation of searching for and deleting duplicate color symbols becomes enormous.
[0028]
For example, when the peripheral pixel data R0, R1, R2, and R3 are all different colors, the four colors are searched from 256 colors in the one-dimensional table, and when the same color is found, the color symbol is deleted, Subsequent ranks are narrowed down and the 256th rank is assigned to the last color symbol. For this reason, a maximum of 256 × 4 comparisons must be made. This amount of work is extremely enormous. Further, in the one-dimensional table constituting the color order table shown in FIG. 23 and the color order table comprising only the one-dimensional table as shown in FIG. 45 of Japanese Patent Laid-Open No. 6-276041, a FIFO comprising a plurality of registers is used. In other words, the latest appearance table creation process of the so-called move to front process is performed. In the sorting process when creating the latest appearance table, the calculation amount increases as the number of bits of the index code increases, and the processing amount increases. For this reason, when an index code having a large number of bits is handled, the processing speed at the time of encoding or decoding a multi-color image is reduced.
[0029]
The line buffer 51 of the encoding system 50 and the line buffer 61 of the decoding system 60 as shown in FIGS. 16 and 19 can store a large number of pixels in order to generate reference pixels and peripheral pixels. ing. For this reason, the line buffers 51 and 61 are enlarged, and as a result, the apparatus is enlarged and expensive. Also, in the conventional apparatus shown in FIGS. 16 and 19, since the image is compressed or decoded with a fixed length in the horizontal direction, an arbitrary image size cannot be efficiently compressed or decoded. It has become.
[0030]
The present invention has been made in response to the above problems, and a multicolor image encoding apparatus and method capable of using peripheral pixel generation means such as a low-capacity line buffer for encoding and decoding. Another object of the present invention is to provide a multicolor image decoding apparatus and method.
[0031]
[Means for Solving the Problems]
In order to achieve such an object, according to the first aspect of the present invention, in a multi-color image encoding device that encodes input target color pixel data into encoded data and outputs the encoded data, the target image to be encoded is detected. A strip generation means for outputting pixel data corresponding to the strip, and a two-dimensional peripheral pixel corresponding to the pixel data based on the pixel data corresponding to the strip. Peripheral pixel data and encoding target pixel 4 surrounding reference pixels excluding the previous pixel Line buffer means for generating reference pixel data for and outputting the peripheral pixel data and reference pixel data, creating a color order table based on the peripheral pixel data, and based on the reference pixel data A Markov model context is created, and the encoding target pixels located in the strips are sequentially encoded based on the color order table and the context.
[0032]
Thus, since the target image is divided into strips having a limited number of pixels, the circuit scale and the amount of memory can be reduced when generating peripheral pixels and reference pixels using a line buffer that embodies the line buffer means. . As a result, the apparatus can be reduced in size and cost.
In addition, when encoding multicolor images, create a context for the Markov model. 4 surrounding pixels excluding the previous pixel Therefore, the encoding process can be speeded up.
[0033]
Furthermore, in the second aspect of the present invention, in the multi-color image encoding method that encodes the input target color pixel data into encoded data and outputs the encoded data, the target image to be encoded has a limited number of pixels. A strip generation step for outputting pixel data corresponding to the strip by dividing into strips having a horizontal width, and peripheral pixel data and encoding for a two-dimensional peripheral pixel corresponding to the pixel data based on the pixel data corresponding to the strip Of the target pixel 4 surrounding pixels excluding the previous pixel A line buffer step for generating reference pixel data for the reference pixel and outputting the peripheral pixel data and the reference pixel data, and creating a color order table based on the peripheral pixel data, and the reference pixel A Markov model context is created based on the data, and the encoding target pixels located in each strip are sequentially encoded based on the color order table and the context.
[0034]
In this way, the target image is divided into strips having a limited width of the number of pixels, so the circuit scale and memory amount of the line buffer used in the peripheral pixel generation process and the reference pixel generation process used in the line buffer process, etc. Can be reduced. As a result, it is possible to reduce the size and cost of an apparatus that embodies this method.
In addition, when encoding multicolor images, create a context for the Markov model. 4 surrounding pixels excluding the previous pixel Therefore, the encoding process can be speeded up.
[0035]
Furthermore, in the invention described in claim 3, in a multi-color image decoding apparatus that decodes input target encoded data into decoded data and outputs the decoded target data, the target image to be decoded has a limited number of pixels. A strip compositing means for dividing and decoding into strips having a width, and generating two-dimensional peripheral pixel data and reference pixel data corresponding to the pixel data based on the pixel data corresponding to the strip, and the peripheral pixel data and the peripheral pixel data Line buffer means for outputting reference pixel data, and creating a color order table based on the peripheral pixel data; 4 surrounding pixels excluding the previous pixel Based on the decoded data, a Markov model context is created, and based on the color order table and the context, the target images to be decoded are sequentially decoded in a strip shape.
[0036]
In this way, the target image is divided into strips having a limited width of the number of pixels, so that the circuit scale and memory amount when generating peripheral pixels and reference pixels with a line buffer that embodies the line buffer means are reduced. it can. As a result, the apparatus can be reduced in size and cost.
In addition, when decoding multicolor images, create a context for the Markov model. 4 surrounding pixels excluding the previous pixel Therefore, it is possible to increase the speed of the decoding process.
[0037]
In addition, in the invention according to claim 4, in the decoding method of the multi-color image in which the input target encoded data is decoded into the decoded data and output, the target image to be decoded is limited in the number of pixels. A two-dimensional peripheral pixel data and reference pixel data corresponding to the pixel data based on the strip composition step for decoding the strip into a strip having a horizontal width and decoding, and the pixel data corresponding to the strip, and the peripheral pixel data and A line buffer step for outputting the reference pixel data, and creating a color order table based on the peripheral pixel data; 4 surrounding pixels excluding the previous pixel Based on the decoded data, a Markov model context is created, and based on the color order table and the context, the target images to be decoded are sequentially decoded in a strip shape.
[0038]
In this way, the target image is divided into strips having a width of a limited number of pixels, so the circuit scale and memory amount of the line buffer used for peripheral pixel generation and reference pixel generation used in the line buffer process are reduced. it can. As a result, it is possible to reduce the size and cost of an apparatus that embodies this method.
In addition, when decoding multicolor images, create a context for the Markov model. 4 surrounding reference pixels excluding the previous pixel Therefore, the decoding process can be speeded up.
[0065]
DETAILED DESCRIPTION OF THE INVENTION
An embodiment of the present invention will be described with reference to FIGS. In addition, the same code | symbol is attached | subjected and demonstrated to each data corresponding to the data in a prior art.
[0066]
FIG. 1 shows a preferred embodiment of a multi-color image encoding system 1 according to the present invention. FIG. 2 shows a preferred embodiment of a multi-color image decoding system 3 corresponding to the encoding system 1 of FIG.
[0067]
The encoding system 1 includes a strip generation unit 5, a line buffer 10 serving as a peripheral pixel generation unit and a reference pixel generation unit, a Markov model generation unit 11 serving as a degeneration unit, and an entropy encoder 12 serving as an entropy coding unit. And a predictor 13 serving as a predicting unit, and is configured to convert an input data stream of color pixel data 100A into a data stream of encoded data 200 and output the data stream.
[0068]
The predictor 13 includes a color rank generation unit 14 and a determination unit 15 that also serves as an escape code generation unit. The color order generation unit 14 also receives the outputs from the two-dimensional color order generation unit 16 that determines the upper color order, the one-dimensional color order generation unit 17 that determines the lower color order, and the generation units 16 and 17. The combined color order table 23 and the generated prediction table synthesis unit 18 are configured. Further, the two-dimensional color order generation unit 16 includes a priority order switching unit 19 and a two-dimensional color order table 20, and the one-dimensional color order generation unit 17 includes a table update unit 21 and a one-dimensional color order table 22. It consists of and.
[0069]
In this embodiment, the color pixel data 100A to be encoded is a multi-color pixel, is composed of 8-bit index code data per pixel, and can display color symbols for 256 colors.
[0070]
The input color pixel data 100 </ b> A is supplied to the line buffer 10 and the table updating unit 21 in the predictor 13.
[0071]
As shown in FIG. 3, the line buffer 10 has a function of inputting and storing pixel data of a portion obtained by dividing a target image into strips having a limited number of pixels. Specifically, an entire image as shown in FIG. 3 is taken into a memory (not shown), and then the memory is accessed to take out data. At that time, the data is extracted in the shape of strips L1 to L5 shown in FIG. The line buffer 10 stores at least the 17 most recently input pixels in each of the strips L1 to L5 divided into 16 horizontal pixels. Then, the value is input as a peripheral pixel to the two-dimensional color rank generation unit 16 to create a two-dimensional color rank table 20, and is also input as a reference pixel to the Markov model generation unit 11 to generate a state signal Cx.
[0072]
As shown in FIG. 4, the Markov model generation unit 11 has four pixels (A, B, C, D) around the pixel X to be encoded, excluding the immediately preceding pixel (indicated by “−”) as a reference pixel. And the state signal Cx is generated. Here, without adopting the previous pixel, 2 The reason why A, which is the pixel before the pixel, is used as the reference pixel is as follows. When the immediately preceding pixel is adopted as a reference pixel as in the conventional case, the state signal Cx input to the entropy encoder 12 or the entropy decoder 32, that is, the context of the Markov model, is not determined until the color symbol of the pixel is determined, and encoding is performed. And the decryption processing operation cannot be accelerated. In this embodiment, A, which is a pixel two pixels before, is used as a reference pixel in order to increase the speed.
[0073]
The entropy encoder 12 is an arithmetic entropy encoder shown in FIG. That is, it has a conversion table (not shown) for each state parameter therein.
[0074]
The predictor 13 functions as a prediction unit. Then, the color pixel data 100A to be encoded is input to the color order generation unit 14 and the determination unit 15 in the predictor 13, respectively. In addition, peripheral color data is input from the line buffer 10 to the color order generation unit 14.
[0075]
The peripheral pixel data input from the line buffer 10 is input to the priority switching unit 19. The peripheral pixel data is pixels P0, P1, P2, and P3 around the encoding target pixel X as shown in FIG. Here, the reference pixels A, B, C, and D of the Markov model shown above are B = P1, C = P2, and D = P3, and only the pixel A is different.
[0076]
The priority switching unit 19 is configured to change the priority for generating the two-dimensional color order table 20 based on a predetermined switching command. However, in this embodiment, the order and position of P0, P1, P2, and P3 are fixed as shown in FIGS. As a method of switching without fixing, for example, pre-scanning is performed on an image to be encoded, and a priority pattern of peripheral pixels that can obtain a good compression rate is obtained in advance, or encoding or decoding is performed. It is possible to employ a method of calculating the number of times of matching color symbols during the operation and outputting a switching command to bring the pixel at the position with the highest number of matches to the upper level.
[0077]
Based on the command from the priority switching unit 19, a two-dimensional color order table 20 (see FIG. 6) is created, which is a higher rank of the color order table in the prediction table synthesis unit 18. The color order table in the prediction table synthesizing unit 18 is the so-called latest appearance table as shown in FIG. 8, and the upper four levels in this embodiment, the highest four from the highest 0 to the third in this embodiment, are two-dimensional colors. It is obtained from the ranking table 20. The two-dimensional color order table 20 is stored in a memory (not shown).
[0078]
When the color pixel data 100A is input to the table update unit 21 in the one-dimensional color order generation unit 17, the table update unit 21 searches the one-dimensional color order table 22 stored in the memory to input color pixels. The latest appearance table creation operation for raising the color rank of the color symbol corresponding to the data to the 0th place is performed. For example, when the color symbol C4 at the position of T0 in FIG. 5 is input, the table updating unit 21 searches the one-dimensional color order table 22, extracts the corresponding color symbol C4, and sets the color order of the C4 to the first. It moves up to 0th place, C2 which was 0th place before is moved to 1st place, C0 which was 1st place is moved down to 2nd place in order. Then, the updated one-dimensional color order table 22 is stored in a memory (not shown).
[0079]
The one-dimensional color order generation unit 17 may be composed of a FIFO unit composed of 256 registers, but in this embodiment, in order to improve the processing speed, the upper rank from the 0th place to the 31st place Only 32 in total are composed of FIFO units composed of registers, and a complete latest appearance table creation operation is performed. On the other hand, the 32nd to 255th positions are composed of a 224 byte dual port RAM, and when the corresponding color symbol is the nth place below the 32nd place, the corresponding color symbol is moved up to the 0th place, A process of replacing the original 31st place (= 32nd place) with the nth place is performed. The reason why the 32nd and lower ranks are composed of dual-port RAMs is to increase the processing speed by parallel processing, and in particular when considering cost reduction and downsizing, they should be composed of single-port RAMs. May be.
[0080]
The prediction table synthesizing unit 18 receives the data of the two-dimensional color order table 20 and the data of the one-dimensional color order table 22, and creates a color order table 23 as a kind of latest appearance table shown in FIG. The As shown in FIG. 8, the color order table 23 is composed of peripheral pixels corresponding to the two-dimensional color order table 20 in the maximum 0th to 3rd positions. For example, when the colors of P0, P1, P2, and P3 of the peripheral pixels are all different, those pixels occupy from the 0th place to the 3rd place. On the other hand, when all of P0 to P3 have the same color, only the 0th place is occupied, and the first place in the one-dimensional color order table 22 is also the first place in the color order table 23.
[0081]
In the color order table 23, the 0th place is the 0th place in the two-dimensional color order table 20 and the 0th place in the one-dimensional color order table 22. In addition, an escape code is attached as a code to the 255th place, that is, the order of 256th and later from the top. Specifically, at the 255th place, an escape code represented by “11111111” and a code indicating “0” represented by “00000000” are output. Similarly, an escape code of “11111111” and a code indicating “1” of “00000001” are output to the 256th place.
[0082]
As described above, the synthesized color order table 23 is configured not to delete the overlapping portion between the values of the two-dimensional color order table 20 and the one-dimensional color order table 22 which are the values of surrounding pixels. A search (comparison) operation is not required, and the speed is increased. The deterioration of the compression rate is 1% or less compared to the conventional one, while the processing speed is more than twice as fast. In addition, it is possible to respond by increasing the number of bits of the code of the color order without using such an escape code. However, in this case, the efficiency of encoding is greatly deteriorated due to the increase in the number of bits. End up. On the other hand, the use of the escape code is extremely advantageous because the compression rate hardly deteriorates.
[0083]
The combined data of the color order table 23 is output to the determination unit 15. The discriminating unit 15 collates the data of the color order table 23 combined with the color symbol of the color pixel data 100A to be encoded, and obtains the color order data 120 corresponding to the color pixel data 100A to be encoded. Output.
[0084]
The entropy encoder 12 receives the previous status signal Cx and the color rank data 120 and outputs the encoded data 200.
[0085]
Next, the operation of the encoding system 1 having the above configuration will be described based on the flowchart shown in FIG. In the description, first, an operation in a normal case will be described, and then an exception process at the end of each of the strips L1 to L6 will be described.
[0086]
In encoding, first, a strip generation process for extracting data from the memory into a strip shape is performed. Thereafter, the encoding of each pixel is specifically started. In the normal encoding process, the color pixel data 100A two before the encoding target pixel has already been input (step S1). A Markov model context is created by the Markov model creation unit 11 from this data and data of three reference pixels on one line (step S2).
[0087]
In parallel with this context creation processing, the following processing is performed for color order conversion. That is, the data one pixel before the pixel to be encoded has also been input (step S3), and the input of all the peripheral pixels is completed by the input of the pixel (step S4), and the two-dimensional color order table 20 is created ( Step S5). On the other hand, the input of data one pixel before the encoding target pixel is the same as the previous pixel input (step S6) to the one-dimensional color order generation unit 17, and the one-dimensional color order table 22 is created by the input. (Step S7).
[0088]
Next, the respective data of the two-dimensional color order table 20 and the one-dimensional color order table 22 are input to the prediction table composition unit 18, and the synthesized color order table 23 is created (step S8). At this time, numbers (0 to 3) different from the escape code (= “11111111”) are all assigned to the color symbols of the 255th (256th) and lower ranks.
[0089]
Next, the color pixel data 100A to be encoded is input (step S9) and collated with the data of the synthesized color order table 23 (step S10). When the color pixel data 100A is different from that in the two-dimensional color order table 20, the part corresponding to the one-dimensional color order table 22 is searched to find the corresponding color symbol. For example, if the color symbol is in the 10th position (11th) in the one-dimensional color order table 22, and there are four orders in the two-dimensional color order table 20, the 3 is added, The color rank data 120 which is the 13th place is output (step S11). In this way, the substantial search is performed on the two-dimensional color order table 20 and the one-dimensional color order table 22, and when found in the two-dimensional color order table 20, the searched order is output as it is. If it is in the one-dimensional color order table 22, a predetermined value is added and output.
[0090]
On the other hand, the corresponding color symbol is brought to the 0th place of the one-dimensional color order table 22, and the color symbol is brought to the 0th place of the two-dimensional color order table 20 and the combined color order table 23. Such updating of the tables 20, 22, 23 is performed in step S12. At this time, in the lower part of the one-dimensional color order table 22 and the synthesized color order table 23, when the value is from the 0th place to the 31st place, a complete latest appearance table creation operation is performed, Things go up to the 0th place, others go down one by one. However, when the number 32 or lower is the target, as shown in FIG. 9, the replacement process is performed to bring the original number 31 to the corresponding rank.
[0091]
The entropy encoder 12 performs encoding processing from the output color rank data 120 and the Markov model context, that is, the state signal Cx (step S13), and outputs the encoded data 200 (step S14). Then, it is determined whether or not the encoding is finished (step S15). If it is finished, the coding is finished, and if it is continued, the process returns to step S9.
[0092]
The above is the normal encoding step. Next, exception processing at the end of each strip L1 to L5 will be described.
[0093]
First, the case where the first portion of the first strip L1, that is, the leftmost pixel at the top of FIG. 11A is encoded will be described. First, target encoding target color pixel data 100A is input. That is, step S9 is executed first. At this time, since the peripheral pixels are not input, the two-dimensional color order table 20 is initialized to the zeroth one of the one-dimensional color order table 22, while the one-dimensional color order table 22 is also 256 colors. The color symbols are arranged from the 0th place to the 255th place and are initialized. For this reason, as the synthesized color order table 23, a table of 256 color symbols arranged from the 0th place to the 255th place exists in the prediction table composition unit 18. The line buffer 10 is also initially initialized to “0”. Note that a color symbol having a value other than “0” may be employed as the initial value of the line buffer 10.
[0094]
Thereafter, steps S10, S11, S12, S13, S14, and S15 shown in FIG. 10 are performed, and the process returns to step S9. At this time, in the update of the two-dimensional color order table 20 in the update of each table (step S12), a process of inserting a color symbol corresponding to the color pixel input at the position P0 of the two-dimensional color order table 20 is performed. Since P1, P2, and P3 have not yet occurred, the initial value “0” of the line buffer 10 becomes a color symbol. On the other hand, in the one-dimensional color order table 22, a leading movement process for moving up the color symbol corresponding to the color pixel input at the 0th position, that is, the latest appearance table creation operation is performed.
[0095]
In the uppermost line of the strip L1 shown in FIG. 11B, only P0 is always input as the peripheral pixel. On the other hand, the one-dimensional color rank table 22 always performs the latest appearance table creation operation, and performs the process of raising the most recently input color symbol to the top. Note that the original Markov model context is not created when the first pixel is input, and the status signal Cx outputs Cx = 0 as one color as a temporary value. The same applies to the input of the second pixel, and the value A shown in FIG. 4 is determined from the input time of the third pixel, but the original Markov model cannot be formed. However, since the color symbol of the pixel on one line, that is, the index is initialized to “0”, if the color symbol of P0 is “0”, the status signal is output as Cx = 0 indicating one color If the color symbol of P0 is not “0”, Cx = 1 indicating two colors is output as the status signal.
[0096]
Thereafter, when the color pixel data 100A at the left end (17th pixel) of the second line of the strip L1 is input, P0, P1, and P2 as peripheral pixels are as shown in FIG. That is, the pixel one pixel before the encoding target pixel X is P0, the pixel 15 pixels before is P2, and the pixel 16 pixels before, that is, the same position on one line is P1. Since P3 has not yet occurred, processing is performed assuming that the color symbol “0” is contained.
[0097]
As described above, in this embodiment, the peripheral pixels P0 to P3 and the reference pixels A to D are set to values at positions away from the encoding target pixel X within the line buffer 10 by a certain distance. That is, as shown in FIG. 12B, the peripheral pixel P0 is one previous, the reference pixel A is two previous, the peripheral pixel P2 (which is also the reference pixel C) is fifteen, the peripheral The pixel P1 (which is also the reference pixel B) is 16 previous, that is, the same position one line before the encoding target pixel, and the peripheral pixel P3 (which is also the reference pixel D) is 17 previous. The concept described above is the same when the encoding target pixel X, peripheral pixels, and the like are separated into strips L2 and strips L1, as shown in FIG. In this way, if 17 pixels are stored in the line buffer 10, they can always be used as reference pixels and peripheral pixels. Further, although a simple operation of setting “0” as the initial value of the line buffer 10 is performed, troublesome exception processing such as virtually inserting a value of “0” is not performed during the encoding. . That is, in this embodiment, it is possible to proceed from one strip to the next strip with the same processing operation as usual without specially performing troublesome exception processing.
[0098]
Further, when the strip is divided in units of 16 pixels in width, the width of the last strip L5 may be less than 16 pixels as shown in FIG. In this case, when the width of the strip L5 is 4 pixels or more, as shown in FIG. 13, if the number of pixels of the width is n, P0 is one pixel before the encoding target pixel and the reference pixel A is two pixels before The peripheral pixel P2 (reference pixel C) is (n−1) previous, the peripheral pixel P1 (reference pixel B) is n previous, and the peripheral pixel P3 (reference pixel D) is (n + 1) previous.
[0099]
When the width of the strip L5 is 3 pixels, as shown in FIG. 14A, the reference pixel A is the same as the reference pixel C and becomes a place of the peripheral pixel P2. Otherwise, the relationship is the same as when the width is 4 pixels. If the width of the strip L5 is 2 pixels, as shown in FIG. 14B, the previous pixel X is P0, the second is P1, and the third is P3. Here, in the relationship shown in FIG. 13, P2 is (2-1) previous, that is, one before, and has the same value as P0. However, the reference pixel C corresponding to P2 is not the previous one, but is at the position of P1. For this reason, the reference pixels B, C, and A are all at the position P1. Further, if the width of the strip L5 is one pixel, the relationship of FIG. 13 is applied mutatis mutandis, and as shown in FIG. 14C, the previous pixel X to be encoded indicates P0, P1, and P2. The last two indicate P3. Here, the reference pixels A, B, C, and D are all the same and are at the position P3.
[0100]
When the exception processing as described above is performed, for example, the edge portion is processed by virtually putting “0” in a portion where the positional relationship between the peripheral pixel and the reference pixel is insufficient, or for a strip having a width of less than 16 pixels, The processing is more efficient than the case of processing to have a horizontal width of 16 pixels, and an image having a horizontal width can be easily handled.
[0101]
Next, a multi-color image decoding system 3 corresponding to the encoding system 1 will be described.
[0102]
The decoding system 3 includes a strip synthesizing unit 7, a line buffer 30 serving as a peripheral pixel generating unit and a reference pixel generating unit, a Markov model generating unit 31 serving as a degeneration unit, and an entropy decoder 32 serving as an entropy decoding unit. And a predictor 33 serving as a prediction means, and is configured to convert the input encoded data 200 data stream into a color pixel data 100B data stream and output the data stream. At this time, the algorithm of the decoding system 3 is configured to be exactly the reverse of the algorithm of the encoding system 1. Therefore, the bit configuration and data stream of the color pixel data 100A and the bit configuration and data stream of the color pixel data 100B are exactly the same. The predictor 33 has the same configuration as the predictor 13 in the encoding system 1. That is, the predictor 33 includes a color rank generation unit 14 and a determination unit 15 that also serves as an escape encoding generation unit. The color order generation unit 14 also receives the outputs from the two-dimensional color order generation unit 16 that determines the upper color order, the one-dimensional color order generation unit 17 that determines the lower color order, and the generation units 16 and 17. And a prediction table synthesizing unit 18 for generating a synthesized color order table 23. Further, the two-dimensional color order generation unit 16 includes a priority order switching unit 19 and a two-dimensional color order table 20, and the one-dimensional color order generation unit 17 includes a table update unit 21 and a one-dimensional color order table 22. It consists of and.
[0103]
The line buffer 30 can store at least 17 pixels as in the line buffer 10 of the encoding system 1. Then, the values are input as peripheral pixels to the two-dimensional color rank generation unit 16 to create the two-dimensional color rank table 20, and are also input as reference pixels to the Markov model generation unit 31 to generate the state signal Cx.
[0104]
The entropy decoder 32 uses the state signal Cx to decode the input encoded data 200 in the reverse procedure of the entropy encoder 12, converts this into color rank data 120, and converts it into the color rank data 120. Output to. It should be noted that the entropy decoder 32 must be formed so as to perform the operation with an algorithm completely opposite to that of the entropy encoder 12. Therefore, the entropy decoder 32 needs to be formed as an arithmetic decoder having the same configuration when an arithmetic encoder is used for the entropy encoder 12, and the entropy encoder 12 has a Huffman encoder. When used, it is necessary to configure as a Huffman decoder having the same configuration. As a result, the encoded data 200 is accurately converted into color order data 120 paired therewith and output.
[0105]
The predictor 33 functions as a prediction unit. Then, a synthesized color order table 23 that is the same as that of the predictor 13 of the encoding system 1 is set therein, and the color order table 23 corresponds to the input color order data 120 and the data of surrounding pixels. The color symbol to be decoded is decoded and output as color pixel data 100B.
[0106]
Next, the operation of the decoding system 3 configured as described above will be described based on the flowchart shown in FIG.
[0107]
First, the encoded data 200 of the decoding target pixel is input to the entropy encoder 32 (step S31). On the other hand, a Markov model context is created based on the data two pixels before (step S32), and is input to the entropy decoder 32 as the state signal Cx. The entropy decoder 32 decodes the encoded data 200 using the state signal Cx (step S33).
[0108]
Through the decoding process by the entropy decoder 32, the color rank data 120 is output (step S34) and input to the determination unit 15 in the predictor 33.
[0109]
On the other hand, data that has already been decoded as the color pixel data 100B is input to the priority switching unit 19 of the predictor 33 as peripheral pixels via the line buffer 30 (step S35) and at the same time, a table update unit in the predictor 33 21 is input as the immediately preceding pixel to step 21 (step S36). When the peripheral pixels are input, the two-dimensional color order table 20 is created (step S37). When the immediately preceding pixel is input, the one-dimensional color order table 22 is created (step S38).
[0110]
Here, the two-dimensional color order table 20 is the same as that shown in FIG. 6, and the one-dimensional color order table 22 is the same as that shown in FIG. Then, as shown in FIG. 9, the table update unit 21 is a FIFO unit that performs complete head movement operation from the 0th place to the 31st place, and its lower part is composed of a RAM of 224 bytes. ing.
[0111]
The prediction table synthesis unit 18 creates a color order table 23 synthesized from both tables 20 and 22 (step S39). The data of the color order table 23 is input to the determination unit 15 and collated with the previous color order data 120 (step S40). Here, the color order data is, for example, the code “00111111” for the 63rd place, and the escape codes “11111111” and “00000001” for the 256th place. As a result of the collation, the color pixel data 100B (= index code) of the color symbol at the corresponding rank in the combined color rank table 23 is output (step S41).
[0112]
Next, for example, when the code of the second place comes out, the color pixel data 100B of the corresponding color symbol is output, and the color symbol in the synthesized color order table 23 is moved up to the 0th place. Update processing is performed to lower the 0th one to the first and the first one to the second (step S42). This update is also performed as necessary for the two-dimensional color order table 20 and the one-dimensional color order table 22.
[0113]
In the update operation, the order of P0, P1, P2, and P3 is determined in the two-dimensional color order table 20, but what is decoded is the same as any one of P0, P1, P2, and P3. For example, if it is the same as P2 in the second place, the color symbol is moved up to the 0th place. At this time, if the leading movement process is not performed at all for the one-dimensional color order table 22, the one-dimensional color order table 22 at the time of encoding will be different. Therefore, the same color symbol as the color symbol that was in the second position in the two-dimensional color order table 22 is searched in the one-dimensional color order table 22, and the color symbol is raised to the zeroth position. The top move process to rearrange things is performed.
[0114]
At this time, the search of the one-dimensional color order table 22 can be limited to the top 17 searches from the 0th place to the 16th place in the one-dimensional color order table 22. That is, P0 to P3 are one of the latest 17 pixels in the one-dimensional color order table 22. In this way, if the pixel to be decoded is any one of P0 to P3, only a maximum of 17 searches (comparisons) are required for updating the one-dimensional color order table 22. As described above, the reason why the number of times is limited to 17 times is that the image is divided into strips having a width of 16 pixels, so that the number of reference pixels stored in the line buffer 10 can be limited to 17.
[0115]
On the other hand, when the pixel to be decoded is not any of P0 to P3, when the color rank data 120, for example, the color rank data 120 indicating the 150th rank is output in step S34, a total of four colors are obtained in P0 to P3. In this case, since the color order data 120 corresponds to the 153rd place in the one-dimensional color order table 22, the 153rd place color symbol is directly extracted without searching. It will be moved up.
[0116]
In this way, in the case of decoding, a maximum of 16 searches (comparisons) are performed. The number of searches (comparisons) of 16 times is the same as that of the conventional technique disclosed in Japanese Patent Laid-Open No. 6-276041. Therefore, the number of searches (256 × 4) is extremely small, and extremely high-speed processing is possible. The search at the time of decoding may be equivalent to that at the time of encoding, and the entire one-dimensional color order table 22 may be searched. However, the above-described embodiment is preferable in terms of high-speed processing. .
[0117]
When the color pixel data 100B is output, it is determined in step S43 whether or not decoding is completed. Then, when it is determined that there is no input of new encoded data 200 and decoding is completed, the process ends. On the other hand, when continuing, it returns to step S31. In the decoding process, exception processing relating to the end of the strip or the strip having a small width is executed by the same algorithm as shown in FIGS. The decoded color pixel data 100B is decoded into a strip shape by a strip decoding process by the strip synthesis means 7, and the data is taken into a memory (not shown) and decoded as an entire image as shown in FIG. The
[0118]
In this embodiment, two codes (16 bits in total), which are an escape code and codes indicating a numerical value obtained by subtracting 256 from the overall rank (those counted from the first), are those having a rank of 255th or lower. Although the output is low, a code with a low rank of 255th or lower indicates a color code that hardly occurs, and the output of such two codes hardly occurs. Moreover, even if it occurs, since it is assigned to a rank that is easy to appear, the compression rate hardly deteriorates as described above. Compared to this, the effect that the overlapping color code can be deleted and the sorting process for changing the order can be eliminated is extremely large.
[0119]
Unlike the conventional Markov model of this embodiment, the pixel immediately before the encoding target pixel is not adopted as the reference pixel, but the deterioration of the compression rate is suppressed to several percent. On the other hand, the processing speed can be pipelined between the entropy encoder 12 and the entropy decoder 32 and the color rank conversion, and the processing speed has been increased by more than twice. In this embodiment, the immediately preceding pixel is used as a peripheral pixel. However, unlike this embodiment, in the case where the immediately preceding pixel is not adopted as a peripheral pixel for creating the color order table 23. However, the deterioration of the compression rate is suppressed to about 10%, while the processing speed becomes twice or more.
[0120]
Furthermore, the line buffers 10 and 30 of this embodiment can have a small capacity because the images are partitioned into strips. That is, as the reference pixel of the Markov model and the peripheral pixel for color order conversion, it is necessary to see a pixel on one line, but since the horizontal width is sectioned in a strip shape, the pixel on one line is seen. The number of pixels that should be stored in is reduced. Therefore, the line buffers 10 and 30 can be reduced in size and capacity, and the cost can be reduced.
[0121]
The above-described embodiment is an example of a preferred embodiment of the present invention, but the present invention is not limited to this, and various modifications can be made without departing from the gist of the present invention. For example, the color pixel data 100A can be configured to encode and decode n-bit (n is an integer of 2 or more) color pixel data 100A.
[0122]
Further, the method of dividing the target image into strips can be applied to a conventional apparatus or method for deleting duplicate color symbols shown in FIG. In that case, the processing can be speeded up. Further, a normal encoding system 50 or decoding system 60 as shown in FIG. 16 which does not have the combined color order table 23 shown in this embodiment and the conventional combined color order table shown in FIG. A method of dividing the target image into strips can also be adopted. In this case, the line buffers 51 and 61 have effects such as a reduction in capacity and cost.
[0123]
Further, the width of the strip is preferably 8 to 64 pixels in consideration of the capacity of the line buffers 10 and 30 and the like, but 16 to 32 pixels is most preferable in consideration of the search efficiency and the compression efficiency due to the exception processing at the end. Further, as a configuration ratio of the FIFO unit and the RAM in the one-dimensional color order generation unit 17, it is preferable that the FIFO unit is 1/4 to 1/32 of the whole and the rest is a RAM, and the FIFO unit is 1/8 to It is most preferable to use 1/16 as the remaining RAM because the compression rate does not drop so much and high-speed processing is possible.
[0124]
As encoding and decoding means, in addition to the arithmetic code type entropy encoder 12 and the decoder 32, a run-length encoding (decoding) technique and other encoding (decoding) techniques are adopted. be able to.
[0125]
Further, as the context of the Markov model, other state signals Cx are generated such as changing the state signal Cx depending on where there are different colors as shown in FIG. 20 in addition to the four states of one to four colors. You may make it let it.
[0126]
Also, in order to make the reference pixel of the Markov model different from the peripheral pixel for color order conversion, the pixel before one pixel is not adopted as the reference pixel as shown in this embodiment, but the pixel before two pixels is adopted. In addition, it may be adopted as a reference pixel before three or more pixels. That is, in addition to the previous pixel, the previous two pixels may not be used as the reference pixel.
[0127]
This Markov model context creation technology, that is, the technology that does not employ the pixel immediately before the pixel to be encoded as the reference pixel is not parallel to the technology that performs the color order conversion, and is various encoding and decoding technologies independently. Can be used.
[0128]
【The invention's effect】
As described above, in the multi-color image encoding apparatus and method according to the present invention, by dividing the target image into strips, it is possible to significantly reduce the amount of calculation, speeding up the encoding process, and arbitrary images. Multi-color images of size can be encoded efficiently. In addition, it is possible to reduce the capacity and cost of peripheral pixel generation means used for encoding, such as a line buffer.
[0129]
In the multicolor image decoding apparatus and method according to the present invention, the amount of calculation can be greatly reduced by dividing the target image into strips, the decoding process can be speeded up, and a multicolor of an arbitrary image size can be obtained. Images can be encoded efficiently. In addition, it is possible to reduce the capacity and the cost of the line buffer serving as the peripheral pixel generating means used for decoding.
[Brief description of the drawings]
FIG. 1 is a diagram illustrating a multicolor image encoding apparatus and encoding system according to the present invention.
FIG. 2 is a diagram illustrating a decoding system employing the multi-color image decoding apparatus and method according to the present invention.
FIG. 3 is a diagram for explaining a scanning method employed in the encoding system and the decoding system of FIGS. 1 and 2;
FIG. 4 is a diagram for explaining a Markov model employed in the encoding system and the decoding system in FIGS. 1 and 2 and its context; FIG. 4A is a diagram showing an arrangement of reference pixels employed as the Markov model; (B) is a figure which shows the context of a Markov model, ie, the kind of state signal.
FIG. 5 is a diagram for explaining pixels used to create a color order table employed in the encoding system and the decoding system of FIGS. 1 and 2; FIG. It is a figure which shows a pixel priority, (B) is a figure which shows the color symbol of each pixel of (A).
6 is a diagram showing a two-dimensional color order table employed in the encoding system and the decoding system of FIGS. 1 and 2. FIG.
7 is a diagram showing a one-dimensional color order table employed in the encoding system and the decoding system of FIGS. 1 and 2. FIG.
8 is a diagram showing a combined color order table employed in the encoding system and decoding system of FIGS. 1 and 2. FIG.
FIG. 9 is a diagram for explaining a configuration of a one-dimensional color order table employed in the encoding system and the decoding system of FIGS. 1 and 2 and an update process thereof.
FIG. 10 is a flowchart showing an encoding operation in the encoding system of FIG. 1;
11 is a diagram for explaining the handling of peripheral pixels for a two-dimensional color order table in the encoding operation of the encoding system of FIG. 1, and FIG. 11A illustrates the case of encoding the first encoding target pixel. (B) is a figure for demonstrating the case where the encoding object pixel in the 1st line is encoded.
12 is a diagram for explaining the handling of peripheral pixels for the two-dimensional color order table in the encoding operation of the encoding system of FIG. 1, and (A) is a diagram when the encoding target pixel comes to the beginning of the second line. FIG. 4B is a diagram for explaining encoding, and FIG. 5B is a diagram for explaining encoding when the encoding target pixel comes to the end of the second line, and FIG. It is a figure for demonstrating encoding when it comes to the first part.
FIG. 13 is a diagram for explaining the handling of peripheral pixels for a two-dimensional color order table and reference pixels for a Markov model in the encoding operation of the encoding system of FIG. 1, and a narrow strip is the same as a normal strip; It is a figure which shows the case where it can handle with thought.
14 is a diagram for explaining the handling of peripheral pixels for a two-dimensional color order table and reference pixels for a Markov model in the encoding operation of the encoding system of FIG. 1, and it is necessary to perform exception processing different from a normal strip; (A) shows a case where the horizontal width is 3 pixels, (B) shows a case where it has 2 pixels, and (C) shows a case where it has 1 pixel.
FIG. 15 is a flowchart showing a decoding operation in the decoding system of FIG. 2;
FIG. 16 is a block diagram of a conventional multi-color image encoding system and decoding system.
FIG. 17 is an explanatory diagram of reference pixel data with respect to conventional encoding target pixel data.
FIG. 18 is a diagram showing a conventional parameter table.
FIG. 19 is a block diagram of a conventional multi-color image encoding system and decoding system having a state degeneration unit.
FIG. 20 is a diagram illustrating an example of a conventional degeneration table.
FIG. 21 is an explanatory diagram of a conventional arithmetic code type entropy encoder and entropy decoder;
FIG. 22 is a diagram for explaining an index of a conventional multi-color image.
FIGS. 23A and 23B are explanatory diagrams showing the principle of creating a conventional combined color order table, where FIG. 23A shows the arrangement relationship of each pixel, FIG. 23B shows the color symbol of each pixel, and FIG. It is a figure which shows the performed color order table (latest appearance table).
[Explanation of symbols]
1 Coding system
3 Decryption system
5 Strip generation means
7 Strip synthesis method
10 line buffer (peripheral pixel generation means)
11 Markov model generator (degeneration means)
12 Entropy encoder (entropy encoding means)
13 Predictor (prediction means)
14 color order generator
15 Discriminator (also serves as escape code generation means)
16 Two-dimensional color order generation unit
17 One-dimensional color order generator
18 Prediction table composition part
19 Priority switching unit
20 2D color order table
21 Table update section
22 One-dimensional color order table
23 Combined color order table
30 line buffer
31 Markov model generator (degeneration means)
32 Entropy decoder (entropy decoding means)
33 Predictor
100A color pixel data to be encoded
100B Decoded color pixel data
120 color ranking data
200 encoded data

Claims (4)

入力される対象カラー画素データを符号化データに符号化し、出力するマルチカラー画像の符号化装置において、
符号化の対象となる対象画像を、限定した画素数の横幅を有する短冊に区切り、前記短冊に対応する画素データを出力する短冊生成手段と、
前記短冊に対応する画素データに基づき、当該画素データに対応する2次元の周辺画素に対する周辺画素データおよび符号化対象画素の直前の画素を除いた周辺の4画素の参照画素に対する参照画素データを生成し、前記周辺画素データおよび参照画素データを出力するラインバッファ手段と、を有し、
前記周辺画素データに基づいて、色順位テーブルを作成し、前記参照画素データに基づいてマルコフモデルのコンテクストを作成し、
前記色順位テーブルおよび前記コンテクストに基づいて、前記各短冊内に位置する前記符
号化対象画素を順次符号化することを特徴とする符号化装置。
In a multi-color image encoding device that encodes input target color pixel data into encoded data and outputs the encoded data,
A strip generation unit that divides a target image to be encoded into strips having a limited number of pixels and outputs pixel data corresponding to the strips;
Based on the pixel data corresponding to the strip, the peripheral pixel data for the two-dimensional peripheral pixel corresponding to the pixel data and the reference pixel data for the peripheral four reference pixels excluding the pixel immediately before the pixel to be encoded are generated. And line buffer means for outputting the peripheral pixel data and the reference pixel data,
Create a color order table based on the surrounding pixel data, create a Markov model context based on the reference pixel data,
An encoding apparatus that sequentially encodes the encoding target pixels located in the strips based on the color order table and the context.
入力される対象カラー画素データを符号化データに符号化し、出力するマルチカラー画像の符号化方法において、
符号化の対象となる対象画像を、限定した画素数の横幅を有する短冊に区切り、前記短冊に対応する画素データを出力する短冊生成工程と、
前記短冊に対応する画素データに基づき、当該画素データに対応する2次元の周辺画素に対する周辺画素データおよび符号化対象画素の直前の画素を除いた周辺の4画素の参照画素に対する参照画素データを生成し、前記周辺画素データおよび参照画素データを出力するラインバッファ工程と、を有し、
前記周辺画素データに基づいて、色順位テーブルを作成し、前記参照画素データに基づいてマルコフモデルのコンテクストを作成し、前記色順位テーブルおよび前記コンテクストに基づいて、前記各短冊内に位置する前記符号化対象画素を順次符号化することを特徴とする符号化方法。
In the encoding method of the multi-color image which encodes the object color pixel data to be input into encoded data and outputs the encoded color pixel data,
A strip generation step of dividing the target image to be encoded into strips having a limited number of pixels and outputting pixel data corresponding to the strips;
Based on the pixel data corresponding to the strip, the peripheral pixel data for the two-dimensional peripheral pixel corresponding to the pixel data and the reference pixel data for the peripheral four reference pixels excluding the pixel immediately before the pixel to be encoded are generated. And a line buffer step for outputting the peripheral pixel data and the reference pixel data,
A color rank table is created based on the peripheral pixel data, a Markov model context is created based on the reference pixel data, and the code located in each strip based on the color rank table and the context An encoding method characterized by sequentially encoding pixels to be encoded.
入力される対象符号化データを復号化データに復号化し出力するマルチカラー画像の復号化装置において、
復号化の対象となる対象画像を、限定した画素数の横幅を有する短冊に区切って復号する短冊合成手段と、
前記短冊に対応する画素データに基づき、当該画素データに対応する2次元の周辺画素データおよび参照画素データを生成し、前記周辺画素データおよび前記参照画素データを出力するラインバッファ手段と、を有し、
前記周辺画素データに基づいて、色順位テーブルを作成し、直前の画素を除いた周辺の4画素の復号化データに基づいてマルコフモデルのコンテクストを作成し、
前記色順位テーブルおよび前記コンテクストに基づいて、短冊状に前記復号化の対象とな
る対象画像を順次復号化することを特徴とする復号化装置。
In a multi-color image decoding apparatus that decodes input target encoded data into decoded data and outputs the decoded data,
Strip synthesis means for decoding a target image to be decoded by dividing the target image into strips having a horizontal width of a limited number of pixels;
Line buffer means for generating two-dimensional peripheral pixel data and reference pixel data corresponding to the pixel data based on the pixel data corresponding to the strip and outputting the peripheral pixel data and the reference pixel data; ,
Create a color order table based on the surrounding pixel data, create a Markov model context based on the decoded data of the surrounding 4 pixels excluding the previous pixel ,
A decoding apparatus that sequentially decodes the target images to be decoded in a strip shape based on the color order table and the context.
入力される対象符号化データを復号化データに復号化し出力するマルチカラー画像の復号化方法において、
復号化の対象となる対象画像を、限定した画素数の横幅を有する短冊に区切って復号する短冊合成工程と、
前記短冊に対応する画素データに基づき、当該画素データに対応する2次元の周辺画素データおよび参照画素データを生成し、前記周辺画素データおよび前記参照画素データを出力するラインバッファ工程と、を有し、
前記周辺画素データに基づいて、色順位テーブルを作成し、直前の画素を除いた周辺の4画素の復号化データに基づいてマルコフモデルのコンテクストを作成し、
前記色順位テーブルおよび前記コンテクストに基づいて、短冊状に前記復号化の対象とな
る対象画像を順次復号化することを特徴とする復号化方法。
In a decoding method of a multi-color image in which input target encoded data is decoded into decoded data and output,
A strip synthesis step of decoding a target image to be decoded by dividing the target image into strips having a limited number of pixel widths; and
A line buffer step of generating two-dimensional peripheral pixel data and reference pixel data corresponding to the pixel data based on the pixel data corresponding to the strip, and outputting the peripheral pixel data and the reference pixel data; ,
Create a color order table based on the surrounding pixel data, create a Markov model context based on the decoded data of the surrounding 4 pixels excluding the previous pixel ,
A decoding method comprising: sequentially decoding the target images to be decoded in a strip shape based on the color order table and the context.
JP27025297A 1997-01-14 1997-10-02 Multi-color image encoding apparatus and method, and multi-color image decoding apparatus and method Expired - Fee Related JP4034385B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP27025297A JP4034385B2 (en) 1997-01-14 1997-10-02 Multi-color image encoding apparatus and method, and multi-color image decoding apparatus and method

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP500697 1997-01-14
JP9-5006 1997-01-14
JP27025297A JP4034385B2 (en) 1997-01-14 1997-10-02 Multi-color image encoding apparatus and method, and multi-color image decoding apparatus and method

Publications (2)

Publication Number Publication Date
JPH10262154A JPH10262154A (en) 1998-09-29
JP4034385B2 true JP4034385B2 (en) 2008-01-16

Family

ID=26338879

Family Applications (1)

Application Number Title Priority Date Filing Date
JP27025297A Expired - Fee Related JP4034385B2 (en) 1997-01-14 1997-10-02 Multi-color image encoding apparatus and method, and multi-color image decoding apparatus and method

Country Status (1)

Country Link
JP (1) JP4034385B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2408454C (en) * 2000-05-09 2007-12-04 Colorzip Media, Inc. Machine readable code and method and device of encoding and decoding the same
JP3729172B2 (en) * 2002-12-16 2005-12-21 ソニー株式会社 Image encoding apparatus and method, and encoded image decoding apparatus and method

Also Published As

Publication number Publication date
JPH10262154A (en) 1998-09-29

Similar Documents

Publication Publication Date Title
US6947592B2 (en) Encoding method of a color image and its encoding device and a decoding method of the color image and its decoding device
US6614939B1 (en) Image compression apparatus and decoding apparatus suited to lossless image compression
JPH06231234A (en) Compression method of image frame and data processing system
US5124791A (en) Frame-to-frame compression of vector quantized signals and other post-processing
US6327383B2 (en) Multi-color image encoding apparatus and method, multi-color image decoding apparatus and method
CN110113617B (en) Image compression and decompression method and device, electronic equipment and storage medium
CN112118449B (en) Method and device for compressing and decompressing image
JP4034385B2 (en) Multi-color image encoding apparatus and method, and multi-color image decoding apparatus and method
JPH11308465A (en) Encoding method for color image, encoder therefor, decoding method for color image and decoder therefor
JP3648943B2 (en) Multi-color image encoding apparatus and method, and multi-color image decoding apparatus and method
US6219445B1 (en) Multi-color image encoding and/or decoding apparatus containing color order table and the method thereof
JPH09139955A (en) Data coding device, its method, data decoding device and its method
US20030123087A1 (en) Image compression method, decompression method thereof and program therefor
JP4233302B2 (en) Data encoding device, data decoding device, data encoding method, data decoding method, program for causing computer to realize these methods, and recording medium
JPH1013842A (en) Markov model image coder
JP2008124632A (en) Image encoding apparatus, image decoding apparatus, image encoding method, image decoding method, image encoding program, image decoding program, recording medium recording image encoding program, and recording medium recording image decoding program
JPH11149551A (en) Device for encoding multi-color picture and method therefor and device for decoding multi-color picture and method therefor
JPH11272843A (en) Device and method for encoding color image, and device and method for decoding color image
JPH1130978A (en) Color image encoding method and its encoder and color image decoding method and its decoder
JPH09246992A (en) Data encoder and method therefor and data decoder and method therefor
JP2708252B2 (en) Image data compression method
JP2000244745A (en) Image encoding device and method, and image decoding device and method
JPH0738447A (en) Run length extract method in huffman coding and huffman code conversion method and mh code processing method
JPH11272842A (en) Device and method for encoding moving picture consisting of multicolor image and device and method for decoding moving picture consisting of multicolor image
JP2755464B2 (en) Image data compression method

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20050124

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20050201

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20050325

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20050426

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20050623

A911 Transfer to examiner for re-examination before appeal (zenchi)

Free format text: JAPANESE INTERMEDIATE CODE: A911

Effective date: 20050701

A912 Re-examination (zenchi) completed and case transferred to appeal board

Free format text: JAPANESE INTERMEDIATE CODE: A912

Effective date: 20050729

RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20070410

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20070918

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20071025

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

Free format text: PAYMENT UNTIL: 20101102

Year of fee payment: 3

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

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20111102

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20111102

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20121102

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20121102

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20131102

Year of fee payment: 6

LAPS Cancellation because of no payment of annual fees